Sample tutorial for oracle dg switching operation
This article mainly explains the "oracle dg switching operation example tutorial", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "oracle dg switching operation example tutorial"!
Background: disaster preparedness drills in response to disasters, failures and other cutoff situations, including master / standby switching and accidental host downtime.
1. Master / Slave switching (switch over)
#
# primary operation
#
1) confirm how the host is turned on
SQL > select DATABASE_ROLE,PROTECTION_MODE,open_mode from v$database
2) switch to standby mode
SQL > ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY
#
# standby operation
#
1) cancel the application of slave log
SQL > alter database recover managed standby database cancel
2) switch to host mode
SQL > ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY
3) restart the slave library
SQL > SHUTDOWN IMMEDIATE
SQL > STARTUP
#
# primary operation
#
1) restart the main library
SQL > SHUTDOWN IMMEDIATE
SQL > STARTUP MOUNT
2) adjust to "READ ONLY" status
SQL > alter database open
3) Application log
SQL > alter database recover managed standby database using current logfile disconnect
4) confirm that open_mode is "READ ONLY WITH APPLY"
SQL > select open_mode from v$database
#
# test Test
#
Insert data on the original machine to test whether it is received by the original host.
2. Main library downtime (failover)
#
# primary operation
#
$ps-ef | grep pmon
$kill-9 {pid_pmon}
#
# standby operation
#
Cancel standby log application
Standby SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
Standby SQL > alter database recover managed standby database finish
"if standby redolog is not applied, use the following command here:
Standby SQL > alter database recover managed standby database finish skip standby logfile
2) restart db to mount status
Standby SQL > shutdown immediate
Standby SQL > startup mount
3) switch to host mode
Standby SQL > alter database commit to switchover to primary
Standby SQL > alter database open
#
# test Test
#
Test whether the original machine can be connected and count the lost data.
If it is Oracle rac, you need to close a node during the switching operation. The method is the same.
At this point, I believe that everyone on the "oracle dg switching operation sample tutorial" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!