当oracle data guard中如主库出现当机时,需要将从库切换为主库,以下从实验环境模拟主从库切换操作:
alter database commit to switchover to physical standby with sessionB shutdown;
shutdown immediate;
startup nomount;
alter database mount standby database;
recover managed standby database disconnect;
alter database open或shutdown以后startup
alter database commit to switchover to primary;
alter database recover managed standby database disconnect from session;
7..验证切换是否成功(角色切换过来后需要查看日志是否能正确从新的主库同步到备用库)
SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
通过主从库新的归档应用和确认状态可查看到两个库的角色已经成功切换!
本文转自ttzztt 51CTO博客,原文链接:http://blog.51cto.com/tianzt/263522 ,如需转载请自行联系原作者