Kiran Dalvi
- 03 Dec, 2023
- 0 Comments
- 2 Mins Read
Dataguard Switchover Using DGMGRL Utility
Step1 :- Check the Primary Database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | DGMGRL> SHOW DATABASE VERBOSE 'prim' ; Database - prim Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): prim Properties: DGConnectIdentifier = 'prim' ObserverConnectIdentifier = '' FastStartFailoverTarget = '' PreferredObserverHosts = '' LogShipping = 'ON' RedoRoutes = '' LogXptMode = 'ASYNC' DelayMins = '0' Binding = 'optional' MaxFailure = '0' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyLagThreshold = '30' TransportLagThreshold = '30' TransportDisconnectedThreshold = '30' ApplyParallel = 'AUTO' ApplyInstances = '0' StandbyFileManagement = '' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '0' LogArchiveMinSucceedDest = '0' DataGuardSyncLatency = '0' LogArchiveTrace = '0' LogArchiveFormat = '' DbFileNameConvert = '' LogFileNameConvert = '' ArchiveLocation = '' AlternateLocation = '' StandbyArchiveLocation = '' StandbyAlternateLocation = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' LogXptStatus = '(monitor)' SendQEntries = '(monitor)' RecvQEntries = '(monitor)' HostName = 'test.learnomate.org' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test.learnomate.org)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=prim_DGMGRL)(INSTANCE_NAME=prim)(SERVER=DEDICATED)))' TopWaitEvents = '(monitor)' SidName = '(monitor)' Log file locations: Alert log : /data/app/oracle/diag/rdbms/prim/prim/trace/alert_prim.log Data Guard Broker log : /data/app/oracle/diag/rdbms/prim/prim/trace/drcprim.log Database Status: SUCCESS |
Step2 :- Check the Standby Database That is the Target of the Switchover
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | DGMGRL> SHOW DATABASE 'stand' ; Database - stand Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 0 seconds ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 0 Byte/s Real Time Query: OFF Instance(s): stand Database Status: SUCCESS |
Step3 :- Confirm That the Database Is Ready for a Role Change
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | DGMGRL> VALIDATE DATABASE 'prim' ; Database Role: Primary database Ready for Switchover: Yes Flashback Database Status: prim: Off Managed by Clusterware: prim: NO Validating static connect identifier for the primary database prim... The static connect identifier allows for a connection to database "prim" . DGMGRL> VALIDATE DATABASE 'stand' ; Database Role: Physical standby database Primary Database: prim Ready for Switchover: Yes Ready for Failover: Yes (Primary Running) Flashback Database Status: prim : Off stand: Off |
Step4 :- Issue the Switchover Command
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | DGMGRL> switchover to 'stand' ; Performing switchover NOW, please wait... Operation requires a connection to database "stand" Connecting ... Connected to "stand" Connected as SYSDBA. New primary database "stand" is opening... Operation requires start up of instance "prim" on database "prim" Starting instance "prim" ... Connected to an idle instance. ORACLE instance started. Connected to "prim" Database mounted. Connected to "prim" Switchover succeeded, new primary is "stand" |
Step5 :- Show the Configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 | DGMGRL> show configuration Configuration - prim Protection Mode: MaxPerformance Members: stand - Primary database prim - Physical standby database Fast-Start Failover: Disabled Configuration Status: SUCCESS (status updated 12 seconds ago) |