Skip to content

Commit 1bf7320

Browse files
authored
feat: Oracle 9i support (experimental) (#292)
* Add support for Oracle 9i. * Rework the method of skipping collections not available in 9i. * Files for skipping extracts not available in 9i. Force collection type to 'NoDiagnostics' fir 9i. * Add "This file intentionally left empty" to the special 9i files. * Version bump for release.
1 parent 843654c commit 1bf7320

17 files changed

+143
-25
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.3.15
2+
current_version = 4.3.16
33
commit = False
44
tag = False
55

scripts/collector/oracle/collect-data.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
### Setup directories needed for execution
1818
#############################################################################
19-
OpVersion="4.3.15"
19+
OpVersion="4.3.16"
20+
dbmajor=""
2021

2122
LOCALE=$(echo $LANG | cut -d '.' -f 1)
2223
export LANG=C
@@ -90,7 +91,7 @@ set pagesize 0 lines 400 feedback off verify off heading off echo off timing off
9091
column vname new_value v_name noprint
9192
select min(object_name) as vname from dba_objects where object_name in ('V\$INSTANCE', 'GV\$INSTANCE');
9293
select 'DMAFILETAG~'|| i.version||'|'||substr(replace(i.version,'.',''),0,3)||'_'||'${OpVersion}_'||i.host_name||'_'||d.name||'_'||i.instance_name||'_'||to_char(sysdate,'MMDDRRHH24MISS')||'~'
93-
from ( SELECT version, host_name, instance_name FROM &&v_name WHERE instance_number = (SELECT min(instance_number) FROM &&v_name) ) i, v\$database d;
94+
from ( SELECT case when version like '9%' then '0' || version else version end as version, host_name, instance_name FROM &&v_name WHERE instance_number = (SELECT min(instance_number) FROM &&v_name) ) i, v\$database d;
9495
exit;
9596
EOF
9697
}
@@ -183,6 +184,7 @@ ZIPFILE=opdb_oracle_${DIAGPACKACCESS}__${V_FILE_TAG}${V_ERR_TAG}.zip
183184

184185
locale > ${OUTPUT_DIR}/opdb__${V_FILE_TAG}_locale.txt
185186

187+
echo "dbmajor = ${dbmajor}" >> ${OUTPUT_DIR}/opdb__defines__${V_FILE_TAG}.csv
186188
echo "ZIPFILE: " $ZIPFILE >> ${OUTPUT_DIR}/opdb__defines__${V_FILE_TAG}.csv
187189

188190
cd ${OUTPUT_DIR}
@@ -300,6 +302,11 @@ if [ $retval -eq 0 ]; then
300302
if [ "${dbmajor}" = "10" ]
301303
then
302304
echo "Oracle 10 support is experimental."
305+
else if [ "${dbmajor}" = "09" ]
306+
then
307+
echo "Oracle 9 support is experimental."
308+
DIAGPACKACCESS="NoDiagnostics"
309+
fi
303310
fi
304311
V_TAG="$(echo ${sqlcmd_result} | cut -d '|' -f2).csv"; export V_TAG
305312
executeOP "${connectString}" ${OpVersion} ${DIAGPACKACCESS}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-- This file intentionally left empty
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2022 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
-- This file intentionally left empty
17+
spool &outputdir/opdb__cpucoresusage__&v_tag
18+
prompt PKEY|DT|CPU_COUNT|CPU_CORE_COUNT|CPU_SOCKET_COUNT|DMA_SOURCE_ID
19+
spool off
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2022 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
-- This file intentionally left empty
17+
spool &outputdir/opdb__dbfeatures__&v_tag
18+
prompt PKEY|CON_ID|NAME|CURRE|DETECTED_USAGES|TOTAL_SAMPLES|FIRST_USAGE|LAST_USAGE|AUX_COUNT|DMA_SOURCE_ID
19+
spool off
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2022 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
-- This file intentionally left empty
17+
spool &outputdir/opdb__dbhwmarkstatistics__&v_tag
18+
prompt PKEY|DESCRIPTION|HIGHWATER|LAST_VALUE|CON_ID|DMA_SOURCE_ID
19+
spool off

scripts/collector/oracle/sql/extracts/columntypes.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ COLUMN TIMESTAMP_WITH_LOCAL_TIME_Z_CO HEADING TIMESTAMP_WITH_LOCAL_TIME_Z_COUNT
2020
COLUMN TIMESTAMP_WITH_TIME_ZONE_COL_C HEADING TIMESTAMP_WITH_TIME_ZONE_COL_COUNT FORMAT 9999999999999999999999999999999
2121

2222
spool &outputdir/opdb__columntypes__&v_tag
23-
2423
WITH coltypes AS (
2524
SELECT
2625
to_char(con_id) as con_id,
@@ -138,7 +137,8 @@ WITH coltypes AS (
138137
&v_a_con_id AS con_id,
139138
a.owner,
140139
table_name,
141-
regexp_replace(data_type, '\([[:digit:]]\)', '(x)') AS data_type,
140+
@&EXTRACTSDIR/&v_data_type_exp
141+
AS data_type,
142142
data_type_owner,
143143
1 AS col_count
144144
FROM
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CASE WHEN instr(data_type, '(') = 0 THEN data_type
2+
ELSE
3+
substr(data_type,
4+
1,
5+
CASE
6+
WHEN instr(data_type, '(') > 0 THEN
7+
instr(data_type, '(')
8+
ELSE
9+
length(data_type)
10+
END
11+
) ||'x' ||
12+
CASE
13+
WHEN instr(data_type, ')') > 0 THEN
14+
substr(data_type,
15+
instr(data_type, ')'),
16+
length(data_type))
17+
ELSE
18+
NULL
19+
END
20+
END
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
regexp_replace(data_type, '\([[:digit:]]\)', '(x)')

scripts/collector/oracle/sql/extracts/dataguard.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ SELECT '&&v_host'
4646
REPLACE(alternate ,'|', ' ')alternate,
4747
transmit_mode,
4848
affirm,
49-
REPLACE(valid_role ,'|', ' ') valid_role,
50-
verify,
51-
'N/A' log_archive_config
49+
&v_dg_valid_role AS valid_role,
50+
&v_dg_verify AS verify,
51+
'N/A' as log_archive_config
5252
FROM gv$archive_dest a
5353
WHERE destination IS NOT NULL)
5454
SELECT pkey , con_id , inst_id , log_archive_config , dest_id , dest_name , destination , status ,

0 commit comments

Comments
 (0)