邏輯 rac standby和物理 rac standby的switchover 和 failover

wenaini發表於2009-01-22
2種dataguard都很簡單,但是物理的更加簡單。。基本沒啥問題,比較可靠。 除了在切換時需要關閉叢集剩下一臺以外和單機的沒有任何區別。[@more@]

物理的switchover:

雙方都要關閉之剩下一個節點:

pr:
ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY WITH SESSION SHUTDOWN;
st:
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
pr:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
st:
ALTER DATABASE OPEN;
pr:
alter database recover managed standby database disconnect from session;

簡單吧- -

邏輯的standby switchover:

還是一樣雙方叢集都要關閉剩一個節點:

prdb:
alter database prepare to switchover to logical standby;
select switchover_status from v$database;

PREPARING SWITCHOVER
lstdb:
alter database prepare to switchover to primary;
select switchover_status from v$database;

PREPARING SWITCHOVER
prdb:
select switchover_status from v$database;

TO LOGICAL STANDBY

alter database commit to switchover to logical standby;
lstdb:

select switchover_status from v$database;

TO PRIMARY
alter database commit to switchover to primary;
alter database start logical standby apply immediate;

每一步都要確認 switchover_status,不能急,如果出錯,可以

在2邊執行:

alter database prepare to switchover cancel;

取消切換。

物理的failover:

保證只開啟一個節點

pstdb:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;

ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

ALTER DATABASE OPEN;

邏輯的standby failover:

保證只開啟一個節點

lstdb:

ALTER DATABASE ACTIVATE LOGICAL STANDBY DATABASE FINISH APPLY;

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

相關文章