Oracle Dataguard Normal switchover and emergency switching
Oracle Dataguard offers offsite disaster recovery solutions that can effectively prevent single points of failure and provide highly available technology, which describes dataguard normal primary and standby switching and emergency switching (emergency switching analog main library problems can not be restored, The repository is detached from the Dataguard takeover of the main library for external service)
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 and standby switching (switchover)
Main Library PRIDB:
Select Switchover_status from v$database; (Query current state)
Switchover_status
--------------------
SESSIONS ACTIVE
ALTER DATABASE commit to switchover-physical standby with session shutdown; (Switch to standby mode)
Restart the database to mount State;Shutdown ImmediateStartup Mount
Select Switchover_status from V$database; (Re-check status)
Switchover_status
--------------------
To PRIMARY
ALTER DATABASE recover managed standby databasedisconnect; (Turn on standby apply recovery mode)
Check Status
Select Open_mode,database_role from V$database;
Open_mode Database_role
---------- ----------------
Mounted physical STANDBY
Standby Library Stydb:
Select Switchover_status from V$database;
Switchover_status
--------------------
SESSIONS ACTIVE
ALTER DATABASE commit to switchover to primary;
Restart the 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 & nbsp PRIMARY
The original repository switches to the repository and the repository switches to the main library.
Synchronization 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, just to ensure that the 2-side sequence serial number consistent and the latest app returns Yes, it means the repository received the application and resumed.
3) Emergency switch
(Note: Simulation of the main library due to failure is not normal switchover, need to perform failover, force the library->pridb and take over the business)
1. Prepare the library:
Since it is a failover, understanding the main library is not working properly at this time, only the standby library switches 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 resume normal business
Shutdown immediate
Startup
Select Open_mode,database_role from V$database;
Open_mode Database_role
---------- ----------------
OPEN PRIMARY
Ps:failover will destroy the Dataguard mode, need to reconfigure Dataguard, heard can not reconfigure, but I did not experiment successfully, there are ways to communicate with you.http://blog.csdn.net/w63667329/article/details/7900270
Oracle Dataguard normal switchover and emergency switching