Skip to content

Commit

Permalink
Handle embedded pipe characters in data. (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpuziewicz authored Oct 13, 2022
1 parent 613c3ac commit a34d3fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions db_assessment/dbSQLCollector/extracts/dataguard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ SELECT '&&v_host'
|| '&&v_dbname'
|| '_'
|| '&&v_hora' AS pkey,
&v_a_con_id as con_id, inst_id, dest_id, dest_name, destination, status, target, schedule, register,
alternate, transmit_mode, affirm, valid_role, verify,
CASE WHEN target = 'STANDBY' OR target = 'REMOTE' THEN (SELECT DECODE(listagg(value, ';') WITHIN GROUP (ORDER BY value), NULL, 'LOG_ARCHIVE_CONFIG_NOT_CONFIGURED', listagg(value, ';') WITHIN GROUP (ORDER BY value)) FROM gv$parameter WHERE UPPER(name) = 'LOG_ARCHIVE_CONFIG') ELSE 'LOCAL_DESTINATION_CONFIG_NOT_APPLICABLE' END log_archive_config
&v_a_con_id as con_id, inst_id,
dest_id,
dest_name,
REPLACE(destination ,'|', ' ')destination,
status,
REPLACE(target ,'|', ' ')target,
schedule,
register,
REPLACE(alternate ,'|', ' ')alternate,
transmit_mode,
affirm,
REPLACE(valid_role ,'|', ' ') valid_role,
verify,
REPLACE(SUBSTR(CASE WHEN target = 'STANDBY' OR target = 'REMOTE' THEN (SELECT DECODE(listagg(value, ';') WITHIN GROUP (ORDER BY value), NULL, 'LOG_ARCHIVE_CONFIG_NOT_CONFIGURED', listagg(value, ';') WITHIN GROUP (ORDER BY value)) FROM gv$parameter WHERE UPPER(name) = 'LOG_ARCHIVE_CONFIG') ELSE 'LOCAL_DESTINATION_CONFIG_NOT_APPLICABLE' END, 1, 100), '|', ' ') log_archive_config
FROM gv$archive_dest a
WHERE destination IS NOT NULL)
SELECT pkey , con_id , inst_id , log_archive_config , dest_id , dest_name , destination , status ,
Expand Down
6 changes: 3 additions & 3 deletions db_assessment/dbSQLCollector/extracts/dbparameters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SELECT '&&v_host'
|| '&&v_hora' AS pkey,
inst_id,
&v_a_con_id AS con_id,
REPLACE(name, ',', '/') name,
TRANSLATE(REPLACE(SUBSTR(value, 1, 60), ',', '/'), chr(10)||chr(13) , ' ') value,
TRANSLATE(REPLACE(SUBSTR(&v_dbparam_dflt_col, 1, 30), ',', '/'), chr(10)||chr(13), ' ') default_value,
replace(name, chr(39), chr(34)) name,
TRANSLATE(SUBSTR(value, 1, 60), chr(124)||chr(10)||chr(13)||chr(39), ' ') value,
TRANSLATE(SUBSTR(&v_dbparam_dflt_col, 1, 30), chr(124)||chr(10)||chr(13)||chr(39), ' ') default_value,
isdefault
FROM gv$parameter a
ORDER BY 2,3 )
Expand Down

0 comments on commit a34d3fb

Please sign in to comment.