Oracle dataguard 正常切换和应急切换
Posted seasonzone
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle dataguard 正常切换和应急切换相关的知识,希望对你有一定的参考价值。
--------------------
SESSIONS ACTIVE
--------------------
TO PRIMARY
---------- ----------------
MOUNTED PHYSICAL STANDBY
select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
alter database commit to switchover to primary;
重新启动数据库open
shutdown immediate
startup
select switchover_status
from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
select
open_mode,database_role from v$database;
OPEN_MODE
DATABASE_ROLE
---------- ----------------
OPEN PRIMARY
至此原主库切换至备库,原备库切换至主库了
3)应急切换
(注:模拟主库由于故障无法正常switchover,需要执行failover,强制备库->pridb并接管业务)
1.备库:
由于是failover,所以理解主库这时候已经无法正常使用,只需备库切换至pridb
停止应用恢复模式
alter database recover managed standby database finish;
转换standbydb为primary db
alter database commit to switchover to primary;
重启数据库,恢复正常业务
shutdown immediate
startup
select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
---------- ----------------
OPEN PRIMARY
以上是关于Oracle dataguard 正常切换和应急切换的主要内容,如果未能解决你的问题,请参考以下文章
Oracle Dataguard HA (主备,灾备)方案部署调试
Oracle 11G Active DataGuard角色切换
Oracle11g搭建DataGuard及主备切换方法总结亲测可用