Flashing back a failed primary database into a physical standby Database

Source: Internet
Author: User
Tags failover

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:

  1. 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.

 

  1. 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:

  1. 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;

 

  1. If necessary, enable the destination:

SQL> alter systemset log_archive_dest_state_n = Enable;

 

  1. 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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.