码迷,mamicode.com
首页 > 数据库 > 详细

[ORACLE DATAGUARD] switchover的过程

时间:2016-06-15 11:02:03      阅读:221      评论:0      收藏:0      [点我收藏+]

标签: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   switchover   

原文地址:http://myhwj.blog.51cto.com/9763975/1789388

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!