alter database commit to switchover to physical standby with session shutdown; //切换至standby模式
shutdown immediate
startup mount
select switchover_status from v$database; //检查状态
alter database recover managed standby database disconnect; //开启standby应用恢复模式
select switchover_status from v$database; //再检查状态
alter database commit to switchover to primary;
shutdown immediate
startup
select switchover_status from v$database;
select open_mode,database_role from v$database;
select sequence#,applied from v$archived_log; //检查DG归档日志是否完成恢复
select open_mode,database_role,switchover_status from v$database; //备库状态
select protection_mode,protection_level from v$database; //检查DG的保护模式
alter database recover managed standby database finish; //停止应用恢复模式
alter database commit to switchover to primary; //转换standbydb为primary db
shutdown immediate
startup
select open_mode,database_role from v$database;
PS:failover将破坏dataguard模式,需要重新配置dataguard,听说可以不用重新配置,。
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞4
添加新评论1 条评论
2017-08-01 12:37