[Translated from mos] restore a failed primary database to a physical standby database,

Source: Internet
Author: User

[Translated from mos] restore a failed primary database to a physical standby database,

Restore a failed primary database to the physical standby database

Reference:
Step by Step Guide on How To Reinstate Failed Primary Database into Physical Standby (Document ID 738642.1)

Applicable:
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 ***


Solution:

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 shocould 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 

On the Data Guard Overview page, click the Database must be reinstated link.
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:

SQL> startup mount

2. Issue the following command while connected to any database in the broker configuration, doesn't 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.

SQL> SELECT TO_CHAR (STANDBY_BECAME_PRIMARY_SCN) FROM V $ 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> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
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:

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2 = 'service = <strong> VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = <db_unique_name> 'scope = BOTH;

2. Enable the destination

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2 = ENABLE;

3. Perform a log switch to ensure that standby database begins restore ing redo data from the new primary database

SQL> ALTER SYSTEM SWITCH LOGFILE;
SQL> SELECT DEST_ID, STATUS, ERROR FROM V $ ARCHIVE_DEST WHERE DEST_ID = 2;

Step 5 Start Redo Apply.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

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

Related Article

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.