设为首页 加入收藏

TOP

最简单的11gActiveDataGuard(ADG)搭建配置过程(项目步(三)
2015-11-21 01:57:03 来源: 作者: 【 】 浏览:1
Tags:简单 11gActiveDataGuard ADG 搭建 配置 过程 项目
chover)切换测试
--primary 做如下操作

SQL> alter database commit to switchover to physical standby;

Database altered.

SQL> shutdown immediate
ORA-01012: not logged on
SQL> conn / as sysdba
Connected to an idle instance.

SQL> startup  
ORACLE instance started.

Total System Global Area 1188511744 bytes
Fixed Size                  1364228 bytes
Variable Size             754978556 bytes
Database Buffers          419430400 bytes
Redo Buffers               12738560 bytes
Database mounted.
Database opened.

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL>  select database_role,switchover_status from v$database;

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

SQL> 

--standby 端做如下操作

SQL> alter database commit to switchover to primary;

Database altered.

SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1188511744 bytes
Fixed Size                  1364228 bytes
Variable Size             754978556 bytes
Database Buffers          419430400 bytes
Redo Buffers               12738560 bytes
Database mounted.
Database opened.

SQL> alter system switch logfile;

System altered.

SQL>  select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          SESSIONS ACTIVE

SQL> 

16、ADG做(fail over)切换测试
--standby 端检查状态
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY WITH APPLY

--我们通过shutdown abort方式人工模拟primary奔溃,直接关闭:

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> shutdown abort
ORACLE instance shut down.
SQL> 

--在standby端执行如下操作

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1188511744 bytes
Fixed Size                  1364228 bytes
Variable Size             754978556 bytes
Database Buffers          419430400 bytes
Redo Buffers               12738560 bytes
Database mounted.

SQL> alter system flush redo to 'pri';

System altered.

SQL> select thread#, low_sequence#, high_sequence# from v$archive_gap;

no rows selected

--如果没有发现明显的gap现象,说明此次的failover不会有数据损失情况。在standby端,要进行关闭apply和结束应用动作。

SQL> alter database recover managed standby database cancel;
Database altered.
 
 
SQL> alter database recover managed standby database finish;
Database altered
 
 
SQL> select open_mode, switchover_status from v$database;
OPEN_MODE            SWITCHOVER_STATUS
-------------------- --------------------
READ ONLY            TO PRIMARY

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 3/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MySQL使用mysqld_multi部署单机多.. 下一篇一次Windows注册表中注册表项目丢..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: