查看原文
其他

Oracle Dataguard 管理命令

penguin23 twt企业IT社区 2022-07-03

备份库切换

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的保护模式

应急切换Failover

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,听说可以不用重新配置,。


点击阅读原文可以进入社区Oracle主题,还有更多文章、资料及相关问答。


长按二维码关注公众号AIX专家俱乐部

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存