物理的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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/79686/viewspace-1016399/