12c Dataguard Switchover Best Practices using DGMGRL(Dataguard Broker Command Prompt) (Doc ID 1582837.1) | To Bottom |
In this Document
APPLIES TO:Oracle Database - Enterprise Edition - Version 12.1.0.1 to 12.1.0.1 [Release 12.1]Information in this document applies to any platform. GOALThis Document offers Step by Step method to perform Switchover using Dataguard Broker command prompt DGMGRL. SOLUTIONSWITCHOVER Considerations:
Broker switchover command verifies the availability of SRL on current Primary Database and suitable Redo transport method on current Standby. DB Restart Considerations:
I. Pre-Switchover ChecksVerify Dataguard Broker ConfigurationUse following command s to verify broker status before switchover. DGMGRL>show configuration;
DGMGRL>show database
DGMGRL>show database
DGMGRL>show database verbose
DGMGRL>show database verbose For example, Dg Configuration name =12c Primary db_unique_name = boston Standby db_unique_name =chicago DGMGRL> show configuration; Configuration - 12c Protection Mode: MaxPerformance Databases: boston - Primary database chicago - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS DGMGRL> show database boston; Database - boston Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): boston Database Status: SUCCESS DGMGRL> show database chicago Database - chicago Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Apply Rate: 0 Byte/s Real Time Query: ON Instance(s): chicago Database Status: SUCCESS NOTE : Further troubleshoot use, DGMRL>show database ‘<>’ logxptstatus; DGMGRL>show database ‘<> ‘inconsistentlogxptprops’; Validate DatabaseValidate database verify following, no need to explicitly check whether ORLs/SRLS cleared.
DGMGRL> validate database boston Database Role: Primary database
Ready for Switchover: Yes <-----------Redy for Switchover Flashback Database Status: boston: Off DGMGRL> validate database chicago Database Role: Physical standby database Primary Database: boston
Ready for Switchover: Yes <--------This confirms Switchover readiness Ready for Failover: Yes (Primary Running) Flashback Database Status: boston: Off chicago: Off Future Log File Groups Configuration: Thread # Online Redo Log Groups Standby Redo Log Groups (chicago) (boston) 1 4 4
NOTE : For further troubleshoot use validate database verbose. DGMGRL>validate database verbose boston DGMGRL>validate database verbose chicago Preset Redo Transport related parameter Verify below parameters are set based on PROTECTION MODE. LogXptMode, NetTimeout, StandbyArchiveLocation, AlternateLocation, and RedoRoutes.
II SWITCHOVERDisable Apply DelayTo increase the speed of switchover disable delaymins property. DGMGRL>edit database chicago set property delaymins=0; Turn on Data Guard tracing on primary and standbyDGMGRL> edit configuration set property tracelevel=support; DGMGRL> edit database boston set property LogArchiveTrace=8191; DGMGRL> edit database chicago set property LogArchiveTrace=8191; Tail Alert Logs and DRC (optional) on all instances
Tail alert log and DRC
tail –f
tail –f
tail –f
tail –f
Perform SwitchoverConnect to sysdg DGMGRL> connect sysdg Password: Connected as SYSDG. DGMGRL> switchover to chicago Performing switchover NOW, please wait... Operation requires a connection to instance "chicago" on database "chicago" Connecting to instance "chicago"... Connected as SYSDBA. New primary database "chicago" is opening... Operation requires startup of instance "boston" on database "boston" Starting instance "boston"... ORACLE instance started. Database mounted. Database opened. Switchover succeeded, new primary is "chicago"
--------------Primary Alert log- alert_boston.log-------------- ALTER DATABASE SWITCHOVER TO 'chicago' Starting switchover [Process ID: 10402] ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY [Process Id: 10402] (boston) . Switchover End-Of-Redo Log thread 1 sequence 131 has been fixed Switchover: Primary highest seen SCN set to 0x0.0x310a3a ARCH: Noswitch archival of thread 1, sequence 131 ARCH: End-Of-Redo Branch archival of thread 1 sequence 131 ARCH: Evaluating archive log 1 thread 1 sequence 131 . Switchover complete. Database shutdown required Completed: ALTER DATABASE SWITCHOVER TO 'chicago' --------------Standby Alert log - alert_chicago.log------------ SWITCHOVER: received request 'ALTER DTABASE COMMIT TO SWITCHOVER TO PRIMARY' from primary database. ALTER DATABASE SWITCHOVER TO PRIMARY (chicago) . Standby became primary SCN: 3213880 <----------Record this SCN . Switchover: Complete - Database mounted as primary SWITCHOVER: completed request from primary database. ----------------Primary Drc log -"/u01/app/oracle/diag/rdbms/boston/boston/trace/drcboston.log"----------- SWITCHOVER TO chicago . Broker Configuration: "12c" Protection Mode: Maximum Performance Fast-Start Failover (FSFO): Disabled, flags=0x0, version=0 Primary Database: chicago (0x02010000) <-------Chicago as Primary ---------------Standby DRC log - "/u01/app/oracle/diag/rdbms/chicago/chicago/trace/drcchicago.log"-------------- Notifying Oracle Clusterware to prepare target standby database for switchover Notifying DMON of db close Notifying RSM0 of db close . Deferring associated archivelog destinations of sites permanently disabled due to Switchover Notifying Oracle Clusterware to buildup primary database after switchover
III. Post-Switchover StepsReset Delaymins propertyChange the delaymins property to prior on new standby after switchover based on business requirement.
DGMGRL> edit database
Set Trace to Prior ValueDGMGRL> edit configuration reset property tracelevel ; DGMGRL> edit database boston reset property logarchivetrace; DGMGRL> edit database chicago reset property logarchivetrace; Verify Broker ConfigurationDGMGRL> show configuration; Configuration - 12c Protection Mode: MaxPerformance Databases: chicago - Primary database
boston - Physical standby database <-----Boston is Physical Standby Fast-Start Failover: DISABLED Configuration Status: SUCCESS |