We have configured DG Broker in the Previous article. In this article, we will see scenarios that we can handle with DGMGRL command prompt.
To see how to configure DG broker.
1. Change LogXptmode
We can set LogXptMode to SYNC or ASYNC as per protection mode.
Syntax :
DGMGRL> EDIT DATABASE TESTDB SET PROPERTY LogXptMode=SYNC;
2. Enable/disable APPLY at DR
DGMGRL> edit database testdb set state=apply-off; Succeeded.
Set apply on:
DGMGRL> edit database testdb set state=apply-on; Succeeded.
3. Enable/disable TRANSPORT
DGMGRL> edit database std_testdb set state=transport-off; Succeeded.
DGMGRL> edit database std_testdb set state=transport-on; Succeeded.
4. Switchover
We can perform switchover operation using just one command with DGMGRL.
DGMGRL> SWITCHOVER TO STD_TESTDB; Performing switchover NOW, please wait... Operation requires a connection to instance "testdb" on database "std_testdb" Connecting to instance "testdb"... Connected. New primary database "std_testdb" is opening... Operation requires startup of instance "testdb" on database "testdb" Starting instance "testdb"... ORACLE instance started. Database mounted. Database opened. Switchover succeeded, new primary is "std_testdb"
5. Failover
Use fail over command :
[oracle@test1 ~]$ dgmgrl sys/oracle@testdb DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production Copyright (c) 2000, 2009, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected. DGMGRL> show configuration; Configuration - drdb Protection Mode: MaxPerformance Databases: std_testdb - Primary database testdb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS DGMGRL> failover to testdb; Performing failover NOW, please wait... Failover succeeded, new primary is "testdb" DGMGRL>
6. Re-instate after the fail over
After failover operation your Primary Database becomes unusable. We can reinstate Primary Database so that will get Physical Standby Role then.
DGMGRL> show configuration; Configuration - drdb Protection Mode: MaxPerformance Databases: testdb - Primary database std_testdb - Physical standby database (disabled) ORA-16661: the standby database needs to be reinstated Fast-Start Failover: DISABLED Configuration Status: SUCCESS DGMGRL>
Step 2: open old primary in mount mode
SQL> startup mount ORACLE instance started. Total System Global Area 663908352 bytes Fixed Size 2256192 bytes Variable Size 578814656 bytes Database Buffers 79691776 bytes Redo Buffers 3145728 bytes Database mounted.
Step 3: REINSTATE database with DGMGRL
DGMGRL> reinstate database std_testdb; Reinstating database "std_testdb", please wait... Operation requires shutdown of instance "testdb" on database "std_testdb" Shutting down instance "testdb"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "testdb" on database "std_testdb" Starting instance "testdb"... ORACLE instance started. Database mounted. Continuing to reinstate database "std_testdb" ... Reinstatement of database "std_testdb" succeeded DGMGRL>
Check configuration :
DGMGRL> show configuration; Configuration - drdb Protection Mode: MaxPerformance Databases: testdb - Primary database std_testdb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS DGMGRL>
Stay tuned for More articles on Oracle DataGuard
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp