Dataguard 之 移除和拆分
這個需求比較特別,由於使用者空間及儲存效能的問題,希望將物理備庫直接轉變稱主庫,原備庫退出DG環境。
Oracle提供了相對較為簡單的方法,供參考:
1. Confirm Primary Database in Maximum Performance Mode
2. Remove Data Guard Broker Configuration
DGMGRL> REMOVE CONFIGURATION;
3. Unset Data Guard-specific Initialization Parameters //此處前提安裝了配置了DG Broker
Unset/Remove following Initialization Parameters from the (S)PFILE of the Primary Database:
LOG_ARCHIVE_CONFIG
DB_FILE_NAME_CONVERT
LOG_FILE_NAME_CONVERT
LOG_ARCHIVE_DEST_n pointing to the Standby Database and valid for STANDBY_LOGFILES
LOG_ARCHIVE_DEST_STATE_n
DG_BROKER_START
DG_BROKER_CONFIG_FILE1
DG_BROKER_CONFIG_FILE2
STANDBY_ARCHIVE_DEST
STANDBY_FILE_MANAGEMENT
FAL_SERVER
FAL_CLIENT
4. Drop Standby Redologs from the Primary Database
Use following Query to check for Standby Redolog Groups:
SQL> SELECT GROUP# FROM V$STANDBY_LOG;
5. Drop the Data Guard Broker Configuration Files if used.
DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2 Parameters define the Name and Location of the Data Guard Broker Configuration Files.
SQL> show parameter DG_BROKER_CONFIG;
drop following file
/ora/u05/recovery_area/dr1cpoln01.dat
/ora/u05/recovery_area/dr2cpoln01.dat
6. covert standby to standalone database
$ sqlplus / as sysdba
SQL> ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP
7.Modify standby database‘ database id
SQL>select dbid,name from v$database;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
nid target=/ dbname=NEWDB
SQL> alter system set db_name='CPOLN02' scope=spfile;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> alter database open resetlogs;