[ORACLE DATAGUARD] switchover的过程

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[ORACLE DATAGUARD] switchover的过程相关的知识,希望对你有一定的参考价值。

1.检查主库的状态:

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;


SWITCHOVER_STATUS

--------------------

TO STANDBY


2.将主库设置为standby role

 alter database commit to switchover to physical standby; 

 shutdown immediate;

 startup mount;

 

3.将standby转为primary

SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database; 


NAME  DB_UNIQUE_NAME OPEN_MODE      DATABASE_ROLE

--------- ------------------------------ -------------------- ----------------

ORCL  sty MOUNTED      PHYSICAL STANDBY


SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE; 


SWITCHOVER_STATUS

--------------------

TO PRIMARY



alter database commit to switchover to primary; 

alter database open; 

SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database; 


NAME  DB_UNIQUE_NAME OPEN_MODE      DATABASE_ROLE

--------- ------------------------------ -------------------- ----------------

ORCL  sty READ WRITE      PRIMARY

 

4.原来的primary库上执行:

alter database recover managed standby database disconnect from session; 

SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database; 


NAME  DB_UNIQUE_NAME OPEN_MODE      DATABASE_ROLE

--------- ------------------------------ -------------------- ----------------

ORCL  pri MOUNTED      PHYSICAL STANDBY


本文出自 “三国冷笑话” 博客,请务必保留此出处http://myhwj.blog.51cto.com/9763975/1789388

以上是关于[ORACLE DATAGUARD] switchover的过程的主要内容,如果未能解决你的问题,请参考以下文章

[dataguard同步数据库]oracle11g dataguard 备库数据同步的检查方法

Oracle Dataguard(主库为 Oracle rac 集群)配置教程(03)—— 创建 dataguard 数据库之前的准备工作

oracle dataguard中怎么设置STANDBY

oracle-11g-配置dataguard

Oracle dataguard 正常切换和应急切换

如何重建Oracle DataGuard