High Level Switchover Steps From Primary to Standby in 12c
High Level Switchover Steps From Primary to Standby in 12c
PRIMARY=QPROD
STANDBY=QPRODN
Check the current status:
DGMGRL> SHOW CONFIGURATION;
Check the Primary Database
Use the SHOW DATABASE VERBOSE command to check the state, health, and properties of the primary database
DGMGRL> SHOW DATABASE VERBOSE QPROD
TRANSPORT-ON
Check the Standby Database That is the Target of the Switchover
Use the SHOW DATABASE command to check the status of the standby database that is the target of the switchover
DGMGRL> SHOW DATABASE VERBOSE QPRODN
APPLY-ON
Confirm That the Database Is Ready for a Role Change
12c New Feature
Prior to performing a role change, you can use the VALIDATE DATABASE command to perform an exhaustive set of checks on the database to confirm that it is ready for a role change.
DGMGRL> VALIDATE DATABASE QPROD
Ready for Switchover: Yes
DGMGRL> VALIDATE DATABASE QPRODN
Ready for Switchover: Yes
Issue the Switchover Command
DGMGRL> switchover to QPRODN
Check the Configuration
DGMGRL> SHOW CONFIGURATION
DGMGRL> SHOW CONFIGURATION
Configuration - testrac_dg
Protection Mode: MaxPerformance
Members:
QPROD - Primary database
QPRODN - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 24 seconds ago)
DGMGRL> SHOW DATABASE VERBOSE QPROD;
Database - QPROD
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
QPROD1
QPROD2
Properties:
DGConnectIdentifier = 'QPROD'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
RedoRoutes = ''
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '5'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> SHOW DATABASE VERBOSE QPRODN
Database - QPRODN
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Average Apply Rate: 721.00 KByte/s
Active Apply Rate: 806.00 KByte/s
Maximum Apply Rate: 79.97 MByte/s
Real Time Query: ON
Instance(s):
QPRODN1 (apply instance)
QPRODN2
Properties:
DGConnectIdentifier = 'QPRODN'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
RedoRoutes = ''
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '5'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '+DATA/QPROD/DATAFILE/, +DATA/QPRODN/DATAFILE'
LogFileNameConvert = '+DATA/QPROD/ONLINELOG/, +REDO/QPROD/ONLINELOG/, +DATA/QPRODN/ONLINELOG, +REDO/QPRODN/ONLINELOG'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> VALIDATE DATABASE QPROD
Database Role: Primary database
Ready for Switchover: Yes
DGMGRL> VALIDATE DATABASE QPRODN
Database Role: Physical standby database
Primary Database: QPROD
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
DGMGRL> switchover to QPRODN
Performing switchover NOW, please wait...
New primary database "QPRODN" is opening...
Oracle Clusterware is restarting database "QPROD" ...
Switchover succeeded, new primary is "QPRODN"
DGMGRL> SHOW CONFIGURATION
Configuration - testrac_dg
Protection Mode: MaxPerformance
Members:
QPRODN - Primary database
QPROD - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 49 seconds ago)
For switchback perform the same commands and change primary and standby role.
Points:
Switchover:
After successful validation and confirmation athe database readiness for the role transition, execute the actual switchover command on the primary database. (advised to view the alert.log files of PRIMARY and STANDBY instances).
Switchback:
To revert (switch back) to the previous situation, perform the same action. Remember, now, your primary is your previous STANDBY and standby is previous PRIMARY
No comments:
Post a Comment