Posts

Showing posts from May, 2016

Extract Data Guard Commands

Image
Hi,
I found a great code for extracting data guard commands (reverse engineering)
I adjusted it to oracle 12.1 with far sync and it working fine.

Just remember to run on Primary & Far Sync instances the following command:
1. SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_n='' scope=both sid='*';
(where n is 2 or above)
2. DGMGRL> disable configuration;
3. DGMGRL> remove configuration;

and then run the script:
displayconfig.sql
SET SERVEROUTPUT ON
SET LINESIZE 300
SET FEEDBACK OFF

DECLARE
rid INTEGER;
indoc VARCHAR2 ( 4000 );
outdoc VARCHAR2 ( 4000 );
p INTEGER;
z XMLTYPE;
y CLOB;
v_xml XMLTYPE;
tout VARCHAR2 ( 4000 );
db_type VARCHAR2 ( 10 );
db_headers_commands clob;
db_commands clob;
db_commands_RedoRoutes clob;
BEGIN
indoc := '';
y := NULL;
rid := dbms_drs.do_control ( indoc );

outdoc := NULL;
p := 1;

WHILE ( outdoc IS NULL )
LOOP
outdoc := dbms_drs.get_response ( rid, p );
y := y || TO_CLOB ( outdoc …