In today’s article, I will talk about how we can perform failover using DGMGRL.
If we cannot reach the primary database, we connect to the standby database and perform the failover process as follows.
1 2 3 4 5 | $dgmgrl sys/<password>@teststby DGMGRL> FAILOVER TO teststby; Performing failover NOW, please wait... Failover succeeded, new primary is "teststby" |
If the flashback feature is turned on in the old Primary database, we configure the old Primary database as standby as follows. If the Flashback feature is not turned on, we re-install Data Guard.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | DGMGRL> REINSTATE DATABASE testdb; Reinstating database "testdb", please wait... Operation requires shutdown of instance "testdb" on database "testdb" Shutting down instance "testdb"... Database closed. Database dismounted. ORACLE instance shut down. Operation requires startup of instance "testdb" on database "testdb" Starting instance "testdb"... ORACLE instance started. Database mounted. Continuing to reinstate database "testdb" ... Operation requires shutdown of instance "testdb" on database "testdb" Shutting down instance "testdb"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "testdb" on database "testdb" Starting instance "testdb"... ORACLE instance started. Database mounted. Continuing to reinstate database "testdb" ... Reinstatement of database "testdb" succeeded |