Chinaunix首页 | 论坛 | 博客
  • 博客访问: 396434
  • 博文数量: 58
  • 博客积分: 2096
  • 博客等级: 大尉
  • 技术积分: 608
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-29 16:09
个人简介

专注于数据库技术研究和实践,目前就职于互联网金融企业,提供Oracle数据库技术支持和维护。 联系电话:18616803656

文章分类

全部博文(58)

文章存档

2020年(1)

2019年(4)

2018年(1)

2017年(3)

2015年(4)

2014年(7)

2012年(1)

2011年(27)

2010年(8)

2009年(2)

我的朋友

分类: Oracle

2014-03-10 11:14:03

1. 采用Broker测试Switchover
1) 主库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ WRITE           PRIMARY              fxopt

2) 备库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY     fxopt_std

2. 主备切换
1) 查看Broker配置
$ dgmgrl sys/oracle
DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - dgfxoptdb
  Protection Mode: MaxAvailability
  Databases:
    fxopt     - Primary database
    fxopt_std - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

2) 切换到备库
DGMGRL> switchover to fxopt_std;
Performing switchover NOW, please wait...
New primary database "fxopt_std" is opening...
Operation requires shutdown of instance "fxopt" on database "fxopt"
Shutting down instance "fxopt"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "fxopt" on database "fxopt"
Starting instance "fxopt"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "fxopt_std"

DGMGRL> show configuration
Configuration - dgfxoptdb
  Protection Mode: MaxAvailability
  Databases:
    fxopt_std - Primary database
    fxopt     - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

3) 主库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY     fxopt

4) 备库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ WRITE           PRIMARY              fxopt_std

5) 切回主库
DGMGRL> switchover to fxopt
Performing switchover NOW, please wait...
New primary database "fxopt" is opening...
Operation requires shutdown of instance "fxopt" on database "fxopt_std"
Shutting down instance "fxopt"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "fxopt" on database "fxopt_std"
Starting instance "fxopt"...
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "fxopt"

6) 主库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ WRITE           PRIMARY              fxopt

7) 备库情况
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE        DB_UNIQUE_NAME
-------------------- -------------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY     fxopt_std
阅读(1634) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~