oracle11g ADG主备切换 | oracle11g 配置

oracle11g ADG主备切换 | oracle11g 配置

oracle11g ADG主备切换

1、主库

SQL> select name,open_mode,switchover_status from v$database;

NAME OPEN_MODE SWITCHOVER_STATUS
--------- -------------------- --------------------
PROD1 READ WRITE TO STANDBY

SQL> alter system switch logfile;

System altered.

SQL> alter system archive log current;

System altered.

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

Database altered.

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 849530880 bytes
Fixed Size 1348244 bytes
Variable Size 511708524 bytes
Database Buffers 331350016 bytes
Redo Buffers 5124096 bytes
Database mounted.
SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
RECOVERY NEEDED

SQL> alter database open;

Database altered.

SQL> select switchover_status from v$database;

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

2、备库

SQL> alter database commit to switchover to primary with session shutdown;

Database altered.

SQL> alter database open;

Database altered.

SQL> select name,open_mode,switchover_status from v$database;

NAME OPEN_MODE SWITCHOVER_STATUS
--------- -------------------- --------------------
PROD1 READ WRITE TO STANDBY

3、新备库(原主库)启用实时日志应用

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

SQL> select name,open_mode,switchover_status from v$database;

NAME OPEN_MODE SWITCHOVER_STATUS
--------- -------------------- --------------------
PROD1 READ ONLY WITH APPLY NOT ALLOWED

参考链接:

https://blog.csdn.net/kadwf123/article/details/83092607

http://blog.chinaunix.net/uid-26313110-id-5748048.html

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部