Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #42 from amreo/master
Browse files Browse the repository at this point in the history
Various fix
  • Loading branch information
amreo authored Nov 18, 2019
2 parents 4351027 + b7b5d8e commit d9f19c1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 23 deletions.
6 changes: 3 additions & 3 deletions fetch/feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

if [ $DBV == "11" ] || [ $DBV == "12" ]; then
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/feature.sql
else
if [ $DBV == "9" ] || [ $DBV == "10" ]; then
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/feature-10.sql
else
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/feature.sql
fi
2 changes: 1 addition & 1 deletion fetch/license
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ else
fi


if [ $DBV == "10" ]; then
if [ $DBV == "10" ] || [ $DBV == "9" ]; then
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/license-10.sql $LICENSING_CPU_CORES $FACTOR
else
sqlplus -S "/ AS SYSDBA" @${ERCOLE_HOME}/sql/license.sql $LICENSING_CPU_CORES $FACTOR $DB_ONE
Expand Down
4 changes: 2 additions & 2 deletions fetch/patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export ORACLE_SID=$SID
export ORACLE_HOME=$HOME
export PATH=$HOME/bin:$PATH

if [ $DBV == "12" ]; then
if [ $DBV -gt "11" ]; then
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/patch-12.sql
else
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/patch.sql
fi
fi
2 changes: 1 addition & 1 deletion fetch/psu
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export PATH=$HOME/bin:$PATH
ERCOLE_HOME=$(dirname "$0")
ERCOLE_HOME="$(dirname "$ERCOLE_HOME")"

if [ $DBV == "10" ] || [ $DBV == "11" ]; then
if [ $DBV -lt "12" ]; then
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/psu-1.sql
else
sqlplus -S "/ AS SYSDBA" < ${ERCOLE_HOME}/sql/psu-2.sql
Expand Down
9 changes: 1 addition & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,7 @@ func buildData(configuration config.Configuration) {
out = fetcher(configuration, "dbversion", db.DBName, db.OracleHome)
outVersion := string(out)

dbVersion := "12"
if strings.HasPrefix(outVersion, "11") {
dbVersion = "11"
} else if strings.HasPrefix(outVersion, "10") {
dbVersion = "10"
} else if strings.HasPrefix(outVersion, "9") {
dbVersion = "9"
}
dbVersion := strings.Split(outVersion, ".")[0]

if configuration.Forcestats {
fetcher(configuration, "stats", db.DBName, db.OracleHome)
Expand Down
16 changes: 8 additions & 8 deletions sql/dbmounted.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ select
(select value from v$nls_parameters where parameter='NLS_NCHAR_CHARACTERSET') as NCharset,
(select value from v$parameter where name='db_block_size') as Blocksize,
(select value from v$parameter where name='cpu_count') as Cpu_count,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS='',.'''),',') from v$parameter where name='sga_target') as Sga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS='',.'''),',') from v$parameter where name='pga_aggregate_target') as Pga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS='',.'''),',') from v$parameter where name='memory_target') as Pga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS='',.'''),',') from v$parameter where name='sga_max_size') as sga_max_size,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS=''.,'''),',') from v$parameter where name='sga_target') as Sga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS=''.,'''),',') from v$parameter where name='pga_aggregate_target') as Pga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS=''.,'''),',') from v$parameter where name='memory_target') as Pga_Target,
(select rtrim(to_char(value/1024/1024/1024, 'FM9G999G999D999', 'NLS_NUMERIC_CHARACTERS=''.,'''),',') from v$parameter where name='sga_max_size') as sga_max_size,
--(select round(sum(bytes/1024/1024/1024)) from dba_segments),
'N/A',
'0',
--((select round(sum(bytes/1024/1024/1024)) from v$datafile)+(select round(sum(bytes/1024/1024/1024)) from v$tempfile)+(select round(sum(bytes/1024/1024/1024)) from v$log)),
'N/A',
'0',
--((select round(sum(decode(autoextensible,'NO',bytes/1024/1024/1024,'YES',maxbytes/1024/1024/1024))) from v$datafile)+(select round(sum(bytes/1024/1024/1024)) from v$tempfile)+(select round(sum(bytes/1024/1024/1024)) from v$log)),
'N/A',
'0',
--(SELECT replace(replace(output,'Elapsed:',''),chr(32), '') FROM TABLE (DBMS_WORKLOAD_REPOSITORY.awr_report_text (:dbid, :inst_num, :bid, :eid, 0)) where rownum <20 and output like '%Elapsed: %'),
--(SELECT replace(replace(output,'DB Time:',''),chr(32), '') FROM TABLE (DBMS_WORKLOAD_REPOSITORY.awr_report_text (:dbid, :inst_num, :bid, :eid, 0)) where rownum <20 and output like '%DB Time: %'),
--:elapsed,:dbtime,(select :result from dual),
'N/A','N/A','N/A',
'0','0','0',
(select case when (select count(*) from v$datafile where name like '+%') > 0 then 'Y' else 'N' end as "ASM" from dual ),
case when ( select count(*) from V$DATAGUARD_CONFIG) > 1 then 'Y' else 'N' end as "Dataguard"
from dual;
Expand Down

0 comments on commit d9f19c1

Please sign in to comment.