ITPub博客

首页 > 数据库 > Oracle > DataGuard主备库切换步骤

DataGuard主备库切换步骤

原创 Oracle 作者:db_wjw 时间:2015-07-01 17:02:50 0 删除 编辑
旧主库:
SELECT SWITCHOVER_STATUS FROM V$DATABASE;

SWITCHOVER_STATUS
--------------------
TO STANDBY

alter database commit to switchover to standby with session shutdown;

旧备库,新主库:
select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO PRIMARY

其他备库:
select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO PRIMARY

旧备库,新主库
alter database commit to switchover to primary with session shutdown;

alter database open;


旧主库:
shutdown immediate;
startup;
select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

其他备库:
都不需要做操作,但是需要提前打开state和参数配置正确。


确认切换成功:
select database_role,open_mode from v$database;

检查同步:
select process,sequence#,status from v$managed_standby;
alter system switch logfile;
select max(sequence#) from v$archived_log where applied='YES';

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26194851/viewspace-1719258/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-08-21

  • 博文量
    96
  • 访问量
    452142