ORACLE 11G DATA GUARD主从切换

当oracle data guard中如主库出现当机时,需要将从库切换为主库,以下从实验环境模拟主从库切换操作:
1.查看主从库角色
192.168.88.120:
image
192.168.88.119:
image
2.将主库(88.120)切换为从库
alter database commit to switchover to physical standby with session�UB shutdown;
image
shutdown immediate; 
startup nomount;
alter database mount standby database;
recover managed standby database disconnect;
image
3.主库切换完成,开启数据库
alter database open或shutdown以后startup
image
4..将从库切换为主库
alter database commit to switchover to primary;
shutdown immediate
startup
image
5.在从库上应用重做日志
alter database recover managed standby database disconnect from session;
6..查看切换后状态
192.168.88.119:
image
192.168.88.120:
image
7..验证切换是否成功(角色切换过来后需要查看日志是否能正确从新的主库同步到备用库)
在主从库上分别执行
SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
新主库88.119:
image
新从库88.120:
image
通过主从库新的归档应用和确认状态可查看到两个库的角色已经成功切换!

你可能感兴趣的:(oracle,Data,主从,11g,guard)