My scenario is we need to do some changes on database and in case of any issues want our dataguard instance to reinstate primary.
Steps to accomplish this work are:
Steps to accomplish this work are:
- Turn off the Transport
- Do a log switch on primary to make sure that none of the current changes are going to DR
- Connect to standby database using dgmgrl from standby node and Failover to DR
- Shutdown primary database
- Startup primary database in mount mode
- Reinstate primary database
- Switch over to primary database;
DGMGRL> show database 'RAC'Do a log switch on primary to make sure that none of the current changes are going to DR
Database - RAC
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
RAC1
RAC2
Database Status:
SUCCESS
DGMGRL> edit database 'RAC' set state=TRANSPORT-OFF;
Succeeded.
DGMGRL> show database 'RAC'
Database - RAC
Role: PRIMARY
Intended State: TRANSPORT-OFF
Instance(s):
RAC1
RAC2
Database Status:
SUCCESS
DGMGRL>
SQL> alter system switch logfile;Connect to standby database using dgmgrl from standby node and Failover to DR
System altered.
SQL> alter system switch logfile;
System altered.
SQL>
DGMGRL> connect sys/*****@RAC_STBYShutdown primary database
Connected.
DGMGRL> show configuration
Configuration - racdg
Protection Mode: MaxPerformance
Databases:
RAC - Primary database
RAC_STBY - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> failover to 'RAC_STBY'
Performing failover NOW, please wait...
Failover succeeded, new primary is "RAC_STBY"
DGMGRL> show configuration
Configuration - racdg
Protection Mode: MaxPerformance
Databases:
RAC_STBY - Primary database
RAC - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
[oracle@rac1 ~]$ srvctl stop database -d RACStartup primary database in mount mode
[oracle@rac1 ~]$
[oracle@rac1 ~]$ srvctl status database -d RAC
Instance RAC1 is not running on node rac1
Instance RAC2 is not running on node rac2
[oracle@rac1 ~]$
[oracle@rac1 ~]$ srvctl start database -d RAC -o mountReinstate primary database
[oracle@rac1 ~]$
[oracle@rac1 ~]$ srvctl status database -d RAC
Instance RAC1 is running on node rac1
Instance RAC2 is running on node rac2
[oracle@rac1 ~]$
DGMGRL> reinstate database 'RAC';Switch over to primary database;
Reinstating database "RAC", please wait...
Operation requires shutdown of instance "RAC1" on database "RAC"
Shutting down instance "RAC1"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "RAC1" on database "RAC"
Starting instance "RAC1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "RAC" ...
Reinstatement of database "RAC" succeeded
DGMGRL>
DGMGRL> show configuration
Configuration - racdg
Protection Mode: MaxPerformance
Databases:
RAC_STBY - Primary database
RAC - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
DGMGRL> switchover to 'RAC'
Performing switchover NOW, please wait...
New primary database "RAC" is opening...
Operation requires shutdown of instance "RAC_STBY1" on database "RAC_STBY"
Shutting down instance "RAC_STBY1"...
ORACLE instance shut down.
Operation requires startup of instance "RAC_STBY1" on database "RAC_STBY"
Starting instance "RAC_STBY1"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "RAC"
DGMGRL>
DGMGRL> show configuration
Configuration - racdg
Protection Mode: MaxPerformance
Databases:
RAC - Primary database
RAC_STBY - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
DGMGRL> show database 'RAC'
Database - RAC
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
RAC1
RAC2
Database Status:
SUCCESS
DGMGRL>
No comments:
Post a Comment