首页 > 数据库技术 > 详细

Data Guard Physical Standby Setup in Oracle11.2 & 后加 Data Guard Broker 之02 (switchover) 切换测试

时间:2020-07-25 20:21:12      阅读:152      评论:0      收藏:0      [点我收藏+]

1.将主数据库转换为备用数据库(主库上)

[oracle@xag1124a ~]$  sqlplus / as sysdba

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

SQL> shutdown immediate
ORA-01012: not logged on

SQL> startup

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

SQL> select database_role,switchover_status from v$database;

PHYSICAL STANDBY        TO PRIMARY

SQL> archive log list;

SQL> select log_mode,open_mode,flashback_on from v$database;

LOG_MODE     OPEN_MODE		  FLASHBACK_ON
------------ -------------------- ------------------
ARCHIVELOG   READ ONLY WITH APPLY NO

2.将备用数据库转换为主数据库(老备库)

[oracle@xag1124b ~]$  sqlplus / as sysdba

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

SQL> shutdown immediate
ORA-01109: database not open

SQL> startup

SQL> alter system switch logfile;

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE	 SWITCHOVER_STATUS
---------------- --------------------
PRIMARY 	 TO STANDBY

SQL> archive log list;

SQL> select log_mode,open_mode,flashback_on from v$database;

LOG_MODE     OPEN_MODE		  FLASHBACK_ON
------------ -------------------- ------------------
ARCHIVELOG   READ WRITE 	  NO


第二轮切换开始(再次切换)

3.将新主数据库转换为备用数据库(新主库上)

[oracle@xag1124b ~]$  sqlplus / as sysdba

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

SQL> shutdown immediate
ORA-01012: not logged on

SQL> startup

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

SQL> select database_role,switchover_status from v$database;

PHYSICAL STANDBY        TO PRIMARY

SQL> archive log list;

SQL> select log_mode,open_mode,flashback_on from v$database;

LOG_MODE     OPEN_MODE		  FLASHBACK_ON
------------ -------------------- ------------------
ARCHIVELOG   READ ONLY WITH APPLY NO

4.将新备用数据库转换为主数据库(备库)

[oracle@xag1124a ~]$  sqlplus / as sysdba

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

SQL> shutdown immediate
ORA-01109: database not open

SQL> startup

SQL> alter system switch logfile;

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE	 SWITCHOVER_STATUS
---------------- --------------------
PRIMARY 	 TO STANDBY

SQL> archive log list;

SQL> select log_mode,open_mode,flashback_on from v$database;

LOG_MODE     OPEN_MODE		  FLASHBACK_ON
------------ -------------------- ------------------
ARCHIVELOG   READ WRITE 	  NO

Data Guard Physical Standby Setup in Oracle11.2 & 后加 Data Guard Broker 之02 (switchover) 切换测试

原文:https://www.cnblogs.com/mydb/p/13376000.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!