Friday 18 July 2014

Reinstating a Failed Primary Database (After Failover to swith the PRIMARY TO STANDBY) in DGMGRL

If your primary database had been configured with Flashback Database, you can easily reinstate the failed primary database as a standby database of the new primary database.
The failed primary database will be reinstated as a standby type that matches the old standby database. For example, if you failed over to a physical standby database,
 the old primary will be reinstated as a physical standby database.

To reinstate the failed primary database, start it to the mounted state. Then run DGMGRL, connect to the new primary database and reinstate the old primary database.


Step 1   Restart the Old Primary Database.

% sqlplus sys as sysdba
Enter password: password

SQL> STARTUP MOUNT;
ORACLE instance started.
Total System Global Area  234364928 bytes
Fixed Size                  1296352 bytes
Variable Size             209717280 bytes
Database Buffers           16777216 bytes
Redo Buffers                6574080 bytes
Database mounted.


Step 2   Reinstate the old primary database.

% dgmgrl connect sys
Password: password
Connected.

DGMGRL> REINSTATE DATABASE 'North_Sales';
Reinstating database "North_Sales", please wait...
Operation requires shutdown of instance "sales1" on database "North_Sales"
Shutting down instance "sales1"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "sales1" on database "North_Sales"
Starting instance "sales1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "North_Sales" ...
Reinstatement of database "North_Sales" succeeded


After the primary has been reinstated, issue the SHOW CONFIGURATION and SHOW DATABASE commands to confirm that the old primary has been successfully reinstated.


Step 3   Show the Configuration and Databases.

DGMGRL> SHOW CONFIGURATION; 
Configuration
 Name:                DRSolution
 Enabled:             YES
 Protection Mode:     MaxAvailability
 Databases:
 DR_Sales     - Primary database
 North_Sales  - Physical standby database

Fast-Start Failover: DISABLED

Current status for "DRSolution":
SUCCESS

DGMGRL> SHOW DATABASE 'DR_Sales';
 Database
 Name:            DR_Sales
 Role:            PRIMARY
 Enabled:         YES
 Intended State:  TRANSPORT-ON
 Instance(s):
 dr_sales1
 Current status for "DR_Sales":
SUCCESS

DGMGRL> SHOW DATABASE 'North_Sales'; 
Database
 Name:            North_Sales
 Role:            PHYSICAL STANDBY
 Enabled:         YES
 Intended State:  APPLY-ON
 Instance(s):
 sales1
 Current status for "North_Sales":
SUCCESS

No comments: