Oracle Dataguard normal switching and emergency switching
Oracle Dataguard provides disaster-tolerant solutions that can effectively prevent single points of failure and provide highly available technology, here is a description of the Dataguard normal main-standby switch and emergency switching (emergency switching simulation Master library problems cannot be restored, Prepare library out of Dataguard take over the main library to provide services externally)
1 Oracle dataguard Environment Setup
Portal: Linux Installation oracle10g Configuration Dataguard Introduction and steps http://blog.csdn.net/w63667329/article/details/7890417
continuation of the last section of the environment:
pridb 172.25.56.149
Stydb 172.25.56.150
2 Normal primary standby switching (switchover)
Main Library PRIDB:
Select Switchover_status from v$database (query current state)
Switchover_status
--------------------
SESSIONS ACTIVE
ALTER DATABASE commit to switchover to physical standby with session shutdown; (Switch to Standby mode)
Reboot the database to mount State; Shutdown immediate Startup Mount
Select Switchover_status from V$database (re-check status)
Switchover_status
--------------------
To PRIMARY
ALTER DATABASE recover managed standby databasedisconnect; (Open standby Application recovery mode)
Check Status
select Open_mode,database_role from V$database;
Open_mode Database_role
---------- ----------------
Mounted physical STANDBY
Standby Stydb:
Select Switchover_status from V$database;
Switchover_status
--------------------
SESSIONS ACTIVE
ALTER DATABASE commit to switchover to primary;
Restart database Open
Shutdown immediate
Startup
Select Switchover_status from V$database;
Switchover_status
--------------------
SESSIONS ACTIVE
Select Open_mode,database_role from V$database;
Open_mode Database_role
---------- ----------------
OPEN PRIMARY
To switch to the repository, the original repository is switched to the main library
Sync Test: Pridb (new): select sequence#,applied from V$archived_log;
Stydb (new): select sequence#,applied from V$archived_log;
PS: Picture lazy, but the test principle is the same, only need to ensure that the 2-side sequence serial number consistent and the latest app return Yes, on the note that the library received the application and restored.
3) Emergency switching
(Note: Simulation of the main library due to failure can not be normal switchover, need to perform failover, mandatory standby->pridb and take over the business)
1. Reserve Library:
because it is failover, so understand the main library is no longer normal to use, just keep the library switch to PRIDB
Stop applying recovery mode
ALTER DATABASE recover managed standby database finish;
convert standbydb to Primary db
ALTER DATABASE commit to switchover to primary;
Restart the database to restore normal business
Shutdown immediate
Startup
Select Open_mode,database_role from V$database;
Open_mode Database_role
---------- ----------------
OPEN PRIMARY
Ps:failover will destroy Dataguard mode, need to reconfigure Dataguard, heard can not be reconfigured, but I did not experiment successfully, there are methods can communicate with everyone.