0% found this document useful (0 votes)
337 views8 pages

Remove Data Guard Broker Configuration Safely: Primary Database

The document provides steps to safely remove a Data Guard broker configuration. This involves removing the broker configuration, setting the dg_broker_start parameter to false on primary and standby databases, disabling archive log destinations to the standby, and removing broker configuration files on both databases.

Uploaded by

Ashraf Anik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
337 views8 pages

Remove Data Guard Broker Configuration Safely: Primary Database

The document provides steps to safely remove a Data Guard broker configuration. This involves removing the broker configuration, setting the dg_broker_start parameter to false on primary and standby databases, disabling archive log destinations to the standby, and removing broker configuration files on both databases.

Uploaded by

Ashraf Anik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Remove Data Guard Broker Configuration Safely

Before removing the configuration here is the broker configuration and the archive log destination in primary dat

Primary database:

DGMGRL> show configuration

Configuration - db.ipx.com

  Protection Mode: MaxPerformance

  Databases:

    db1_dg - Primary database

    db2_dg - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

SQL> select dest_id,destination,status

             from v$archive_dest

              where target='STANDBY'

DESTINATION ST
DE AT
ST US
_I
D
2 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=stagedb1.xyz.com) VA
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=db2_dg.ipx.com) LI
(SERVER=DEDICATED))) D
 

1. Remove broker configuration from DGMGRL command line using sys user from primary database

Primary Database:
[oracle@stagedb1 dbs]$ dgmgrl

DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/password

Connected.

DGMGRL> remove configuration;

Removed configuration

DGMGRL> show configuration;

Error:

ORA-16532: Data Guard broker configuration does not exist

Configuration details cannot be determined by DGMGRL

2. In primary database set the db_broker_start parameter false.

Primary Database:

SQL> show parameter dg_broker

NAME                                 TYPE                              VALUE

------------------------------------ --------------------------------- ------------------------------

dg_broker_config_file1               string                            /holding/db1/standbylog/dr1ts m1_dg.dat

dg_broker_config_file2               string                            /holding/db1/standbylog/dr2db1_dg.dat

dg_broker_start                      boolean                           TRUE

 
SQL> alter system set dg_broker_start=false scope=both;

System altered.

SQL> show parameter dg_broker

NAME                                 TYPE                              VALUE

------------------------------------ --------------------------------- ------------------------------

dg_broker_config_file1               string                            /holding/db1/standbylog/dr1ts m1_dg.dat

dg_broker_config_file2               string                            /holding/db1/standbylog/dr2db1_dg.dat

dg_broker_start                      boolean                           FALSE

3. Check the archive log destination in primary database. After removing the configuration it will clear automatica

Primary Database:

SQL> select dest_id,destination,status

            from v$archive_dest

 where target='STANDBY'

DESTINATION STATUS
DEST_ID
2   INACTIVE
If it is not clear then make the destination defer

SQL> alter system set log_archive_dest_state_2=defer scope=both;

System altered.

4. In standby database set the db_broker_start parameter false.

Secondary Database:
SQL> alter system set dg_broker_start=false scope=both;

System altered.

5. In both primary and standby database remove broker configuration file.

Primary Database:

SQL>  select name , value from v$parameter where name like '%dg_broker%';

VALUE
Name
dg_broker_start FALSE
dg_broker_config_file1 /holding/db1/standbylog/dr1db1_dg.dat
dg_broker_config_file2 /holding/db1/standbylog/dr2db1_dg.dat

[oracle@stagedb1]$ mv /holding/db1/standbylog/dr1db1_dg.dat /holding/db1/standbylog/dr1db1_dg_back.dat

[oracle@stagedb1]$

[oracle@stagedb1]$ mv /holding/db1/standbylog/dr2db1_dg.dat /holding/db1/standbylog/dr2db1_dg_back.dat

Secondary Database:

SQL>  select name , value from v$parameter where name like '%dg_broker%';

VALUE
Name
dg_broker_start FALSE
dg_broker_config_file1 /holding/db2/standbylog/dr1db2_dg.dat
dg_broker_config_file2 /holding/db2/standbylog/dr2db2_dg.dat
 

[oracle@stagedb1]$ mv /holding/db2/standbylog/dr1db2_dg.dat /holding/db2/standbylog/dr1db2_dg_back_201404

[oracle@stagedb1]$

[oracle@stagedb1]$ mv /holding/db2/standbylog/dr2db2_dg.dat /holding/db2/standbylog/dr2db2_dg_back.dat


How to Safely Remove a Data Guard Broker Configuration under RAC/NON-RAC setup
Posted By Sagar Patil

1) Remove the Data Guard Broker Configuration

Using the Commandline DGMGRL


SQL> show parameter dg_broker;
NAME                                 TYPE        VALUE
———————————— ———– ——————————
dg_broker_config_file1               string      /mnt/data/oradata/PROD/dr1PROD.dat
dg_broker_config_file2               string      /mnt/data/oradata/PROD/dr2PROD.dat
dg_broker_start                      boolean     TRUE

DGMGRL> connect sys/sysgsadm


Connected.
DGMGRL> show configuration;
Configuration – dataguard
Protection Mode: MaxPerformance
Databases:
PROD  – Primary database
PROD – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

DGMGRL> remove configuration;


Removed configuration
DGMGRL> show configuration;
ORA-16532: Data Guard broker configuration does not exist
Configuration details cannot be determined by DGMGRL

2) On the primary database set dg_broker_start=false:

SQL> show parameter dg_broker


NAME                                 TYPE        VALUE
———————————— ———– ——————————
dg_broker_config_file1               string      ?/dbs/[email protected]
dg_broker_config_file2               string      ?/dbs/[email protected]
dg_broker_start                      boolean     TRUE

SQL> alter system set dg_broker_start=false scope=both;

System altered.

SQL> show parameter dg_broker;


NAME                                 TYPE        VALUE
———————————— ———– ——————————
dg_broker_config_file1               string      /mnt/data/oradata/PROD/dr1PROD.dat
dg_broker_config_file2               string      /mnt/data/oradata/PROD/dr2PROD.dat
dg_broker_start                      boolean     TRUE

3) On the primary disable any archive destinations that are archiving to the standby:

SQL> column A format 999;


column B format a40;
column C format a10;
column C word_wrapped;
column D word_wrapped;
select dest_id A,destination B,status C
from v$archive_dest
where target=’STANDBY’;
A B                                        C
—- —————————————- ———-
2 dg_PROD                                VALID

Primary> show parameter log_archive_dest_state_2;


NAME                                 TYPE        VALUE
———————————— ———– ——————————
log_archive_dest_state_2             string      ENABLE

Primary> alter system set log_archive_dest_state_2=defer scope=both;


System altered.

Primary> show parameter log_archive_dest_state_2;


NAME                                 TYPE        VALUE
———————————— ———– ——————————
log_archive_dest_state_2             string      DEFER

4) on the standby set the dg_broker_start parameter to false:


SQL> show parameter dg_broker;
NAME                                 TYPE        VALUE
———————————— ———– ——————————
dg_broker_config_file1               string      /mnt/data/oradata/PROD/dr1PROD.dat
dg_broker_config_file2               string      /mnt/data/oradata/PROD/dr2PROD.dat
dg_broker_start                      boolean     TRUE

SQL> alter system set dg_broker_start=false scope=both;


System altered.

5) On both system remove metadata files

oracle@hasunclu1:/u03/oracle/9.2.0/dbs> rm /mnt/data/oradata/PROD/dr1PROD.dat
oracle@hasunclu1:/u03/oracle/9.2.0/dbs> rm /mnt/data/oradata/PROD/dr2PROD.dat

If required you can activate standby database as below :

Standby> Shutdown abort;

Standby> startup;
ORACLE instance started.
Total System Global Area 9152860160 bytes
Fixed Size                  2234056 bytes
Variable Size            6610225464 bytes
Database Buffers         2516582400 bytes
Redo Buffers               23818240 bytes
Database mounted.
ORA-10456: cannot open standby database; media recovery session may be in progress

SQL> alter database activate standby database;


Database altered.

SQL> startup force;


ORACLE instance started.
Total System Global Area 9152860160 bytes
Fixed Size                  2234056 bytes
Variable Size            6610225464 bytes
Database Buffers         2516582400 bytes
Redo Buffers               23818240 bytes
Database mounted.
Database opened.

[oracle@Node2 PROD]$ srvctl stop database -d PROD


[oracle@Node2 PROD]$ srvctl start database -d PROD

[oracle@Node2 PROD]$ srvctl status instance -d PROD -n Node1


Instance PROD1 is running on node Node1
[oracle@Node2 PROD]$ srvctl status instance -d PROD -n Node2
Instance PROD2 is running on node Node2
The database won’t be opened by srvctl commands as it’s configured for STANDBY mode under Datauard
setup.
Please change service mode using srvctl from MOUNT TO OPEN.

You might also like