dg主备库切换步骤

dg主备库切换步骤


先将主库切换成备库,然后将原主库启动到物理库的状态

SQL> select switchover_status from v$database;



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


SQL> Alter database commit to switchover to physical standby with session shutdown;


Database altered.


SQL> shut immediate
ORA-01507: database not mounted




ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.


Total System Global Area  304807936 bytes
Fixed Size                  2212856 bytes
Variable Size             176163848 bytes
Database Buffers          121634816 bytes
Redo Buffers                4796416 bytes
SQL> alter database mount standby database;


Database altered.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; 


Database altered.


然后将备库切换成主库
SQL> select switchover_status from v$database;


SWITCHOVER_STATUS
--------------------
NOT ALLOWED


SQL> select * from v$version where rownum<2;


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY; 


Database altered.


SQL> shut immediate
ORA-01109: database not open




Database dismounted.
ORACLE instance shut down.
SQL> starutp
SP2-0042: unknown command "starutp" - rest of line ignored.
SQL> startup
ORACLE instance started.


Total System Global Area  304807936 bytes
Fixed Size                  2212856 bytes
Variable Size             138415112 bytes
Database Buffers          159383552 bytes
Redo Buffers                4796416 bytes
Database mounted.
Database opened.
切换日志进行检查
SQL> select max(sequence#) from v$log;


MAX(SEQUENCE#)
--------------
           108


SQL> alter system switch logfile;


System altered.

参考:
http://blog.csdn.net/leishifei/article/details/6240464

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值