DataGuard SwitchOver

壹頁書發表於2014-11-07
http://blog.itpub.net/29254281/viewspace-1315088/

在物理StandBy的基礎上進行SwitchOver

主庫:192.168.1.1
備庫:192.168.1.2

SwitchOver之後
主庫:192.168.1.2
備庫:192.168.1.1

首先,
修改主庫的引數
alter system set log_archive_dest_2='service=standby valid_for=(all_logfiles,all_roles) db_unique_name=orcl' scope=both;

修改備庫的引數
alter system set log_archive_dest_2='service=primary valid_for=(all_logfiles,all_roles) db_unique_name=orcl' scope=both;

查詢主庫SwitchOver狀態
SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO STANDBY

將192.168.1.1轉換為StandBy,然後重啟
alter database commit to switchover to physical standby with session shutdown;

shutdown immediate;
startup nomount;
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

將192.168.1.2備庫提升為主庫
alter database commit to switchover to primary with session shutdown;
shutdown immediate;
startup open;

先啟動備庫,再啟動主庫,否則主庫識別不了備庫。

參考:
http://blog.csdn.net/tianlesoftware/article/details/5514082
http://blog.csdn.net/tianlesoftware/article/details/5768602

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1324213/,如需轉載,請註明出處,否則將追究法律責任。

相關文章