【翻譯自mos文章】將一個失敗的primary database 復原為physical standby 庫的步驟
將一個失敗的primary database 復原為physical standby 庫的步驟
參考自:
Step by Step Guide on How To Reinstate Failed Primary Database into Physical Standby (文件 ID 738642.1)
適用於:
Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 24-Jul-2013***
解決方案:
There are two ways to Reinstate Failed Primary Database:
1. Using Flashback
2. Without using Flashback
1. Reinstate Failed Primary Database using Flashback
Prerequisites for Reinstate Failed Primary Database:
1. Flashback Database must have been enabled on the database prior to the failover
2. There must be sufficient flashback logs on that database to flashback up to the scn when standby becomes the primary
3. The database to be reinstated and the new primary database must have network connectivity
4. Failed primary database should be part of broker configuration (in case of using EM or DGMGRL).
Methods to Reinstate database using Flashback:
A. Using Enterprise Manager
B. Using DGMGRL
C. Using SQL*PLUS
A. Using Enterprise Manager
This brings up the General Properties page that provides a Reinstate button. After you click the Reinstate button, Enterprise Manager begins reinstating the database.When the process is complete, the database will be enabled as a standby database to the new primary database, and Enterprise Manager displays the Data Guard Overview page.
B. Using DGMGRL
1. Startup the Failed Primary Database in the Mount stage:
2. Issue the following command while connected to any database in the broker configuration, except the database that is to be reinstated:
DGMGRL> REINSTATE DATABASE <db_unique_name of failed primary>;If the REINSTATE DATABASE fails to start the Failed Primary Database, then manually start the database in mount stage and reissue the reinstate command.
C. Using SQL*PLUS
Step 1 Determine the Standby Became Primary SCN.
Step 2 Flashback the Failed Primary Database.
Step 3 Convert to physical standby database.
Step 4 Restart Redo Transport.
Step 5 Start Redo Apply.
Step 1 Determine the SCN at which the old standby database became the primary database.
Step 2 Flashback the Failed Primary Database to SCN standby_became_primary_scn.
SQL> SHUTDOWN IMMEDIATE;SQL> startup mount
SQL> FLASHBACK DATABASE TO SCN <standby_became_primary_scn of step 1>;
Step 3 Convert the database to a physical standby database and Restart database in mount stage.
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
Step 4 Restart Redo Transport to the New Physical Standby Database.
1. If you have not set the remote archive destination on current primary then set remote archive destination:
2. Enable the destination
3. Perform a log switch to ensure that standby database begins receiving redo data from the new primary database
SQL> SELECT DEST_ID, STATUS, ERROR FROM V$ARCHIVE_DEST WHERE DEST_ID=2;
Step 5 Start Redo Apply.
Please see also fallowing docu:
Oracle® Data Guard Concepts and Administration
11g Release 2 (11.2)
13.2 Converting a Failed Primary Into a Standby Database Using Flashback Database
2. Without Using Flashback
Use
Note 416310.1 : Reinstating a Physical Standby Using Backups Instead of Flashback