How to remove a Data Guard Configuration from Primary Database (Doc ID 733794.1)

How to Remove a Single Standby Database from a Data Guard Configuration

In this Example, We have 3 standby databases in the Data Guard configuration.  We want to remove 1 standby database from the Data Guard configuration.
 
 

SOLUTION

 
 
 Find the LAD(log_archive_dest_n) and the db_unique_name for the Standby that is being removed. 

  The below steps are Assuming you are in Maximum Performance mode.  If you are Maximum Availability mode then the other standby will need to be using SYNC Redo transport/LogXptMode to satisfy the Primary configuration before you can remove the other Standby.

 

Steps to Remove a Single Standby from the Multi-Standby Data Guard Configuration:


  1. If you are using the Data Guard Broker, you need to remove it from the Broker using steps:
 
 A)To remove from Broker:

  On the Primary database:
  dgmgrl> connect sys
  dgmgrl> disable database <db_unique_name>; << The Standby db_unique_name you are removing
  dgmgrl> remove database <db_unique_name>;
  dgmgrl> show configuration verbose;
  -- the Standby you are removing will no longer show in the configuration


  B) On the Primary database:
 

Go into sqlplus and make sure it removed the standby from the Data Guard configuration from the DG Broker parameters:
  sql> show parameter log_archive_dest_n                        << replace the 'n' with the # for the Standby Redo transport destination to make sure it's removed
  -- if it's not removed then you'll have to remove it manually using:; 
  sql> alter system set log_archive_dest_n='' scope=both; << use sid='*'; at the end if you are RAC
  sql> show parameter log_archive_config
  -- make sure it removed the Standby's db_unique_name from the list
  -- It's a dynamic parameter so you can alter system and remove it from the list for example:
     i.e. alter system set log_archive_config='dg_config=(PRIMARY,STANDBY1,STANDBY2)' scope=both; << use sid='*'; at the end if you are RAC
  C) Remove the broker dr.dat configuration files(i.e. show parameter dg_broker_config) from the Standby database machine that you are removing only and if it's the only standby in the Data Guard configuration on the that machine.


  2. If you are not using the Data Guard Broker, then to remove it manually do:

 
  A) On the Primary database:

  

   a) Go into sqlplus and remove it's configuration from the LAD parameter:
     sql> show parameter log_archive_dest_n << replace the 'n' with the # for the Standby Redo tranport destination 
     sql> alter system set log_archive_dest_n='' scope=both; << use sid='*'; at the end if you are RAC
      sql> show parameter log_archive_config
     -- Remove the Standby's db_unique_name from the list
     -- It's a dynamic parameter so you can alter system and remove it from the list for example:
     sql> alter system set log_archive_config='dg_config=(PRIMARY,STANDBY1,STANDBY2)' scope=both; << use sid='*'; at the end if you are RAC


   b) If the fal_server is pointing to the Standby you are removing,then you need to remove it from the fal_server parameter:
  alter system set fal_server='STANDBY1,STANDBY2' scope=both; << use sid='*'; at the end if you are RAC


 B) On the Standby database:
  Note: If you are going to remove the standby from it's machine, then you don't need to do the following.

 

  a) Reset any log_archive_dest_n parameters that may be pointing back to the primary or the other standby
     sql> show parameter log_archive_dest_
     sql> alter system set log_archive_dest_n='' scope=both; << use sid='*'; at the end if you are RAC


  b) remove the log_archive_config parameter
    sql> alter system set log_archive_config='' scope=both; << use sid='*'; at the end if you are RAC
    or you can set like: SQL> alter system set log_archive_config=NODG_CONFIG scope=both sid='*';

Reference:
How to remove a Data Guard Configuration from Primary Database (Doc ID 733794.1)

猜你喜欢

转载自blog.csdn.net/wll_1017/article/details/80660601