The following steps assume that a Failover has been stored med to aphysical standby database and that flashback database was enabled on the oldprimary Database
At the time of the Failover. This procedure brings the oldprimary database back into the data guard configuration as a physical standbydatabase.
Step 1 determine thescn at which the old standby database became the primary database.
On the new primary database, issue the following query to determinethe SCN at which the old standby database became the new primary database:
SQL> select to_char (standby_became_primary_scn) from V $ database;
To_char (standby_became_primary_scn)
----------------------------------------
1095159
Step 2 flash backthe failed primary database.
Shut down the old primary database (if necessary), mountit, and Flash it back to the value for standby_became_primary_scn that wasdetermined in
Step1.
SQL> shutdownimmediate;
SQL> startupmount;
SQL> flashbackdatabase to SCN 1095159;
Step 3 convert thedatabase to a physical standby database.
Perform the following steps on the old primary database:
- Issue the following statement on the old primary database:
SQL> alterdatabase convert to physical standby;
Database altered.
This statement will dismount the database after successfullyconverting the control file to a standby control file.
- Shut down and restart the database:
SQL> shutdown immediate;
SQL> startup Mount;
Step 4 starttransporting redo to the new physical standby database.
Perform the following steps on the new primary database:
- Issue the following query to see the current state of the archive destinations:
SQL> Col errorfor A20
SQL> coldestination for A20
SQL> coldest_name for A20
SQL> selectdest_id, dest_name, status, protection_mode, destination, error, SRL fromv $ archive_dest_status;
- If necessary, enable the destination:
SQL> alter systemset log_archive_dest_state_n = Enable;
- Perform a log switch to ensure the standby database begins refreshing redo data from the new primary database, and verify it was sent successfully. issue the following SQL statements on the new primary database:
SQL> alter system switch logfile;
SQL> selectdest_id, dest_name, status, protection_mode, destination, error, SRL fromv $ archive_dest_status;
Step 5 start redoapply on the new physical standby database.
Issue the following SQL statement on the new physical standbydatabase:
SQL> alterdatabase recover managed standby database using current logfile disconnect fromsession;
Redo apply automatically stops each time it encounters a redo recordthat is generated as the result of a role transition, so redo apply will needto be restarted
One or more times until it has applied beyond the SCN at whichthe new primary database became the primary database. once the failed primarydatabase is restored and is running in the standby role, you can optionallyperform a switchover to transition the Databases
To their original (pre-failure) roles.
For reprinting, please indicate the author's source and original article links; otherwise, you will be held legally responsible:
Author: xiangsir
Link: http://blog.csdn.net/xiangsir/article/details/9206877
QQ: 444367417
MSN: xiangsir@hotmail.com