关于recover managed standby database finish force

来源:互联网 发布:linux vi 删除多行 编辑:程序博客网 时间:2024/06/08 16:12


主库是rac,备库是单实例,根据o的官档上说到在failover切换时,

会使用alter database recover managed standby database finish force;

然后alter database commit to switchover to primary将会强制切换备库为主库,

这里小鱼只是执行了第一句,并还没有将备库切换为主库。


备库强制停掉redo apply
SQL> alter database recover managed standby database finish force;

Database altered.

此时如果我们尝试开启redo apply了
SQL> alter database recover managed standby database disconnect from session;

Database altered.

发现备库的rfs、mrp进程并没有起来。

SQL> select process,client_process,status,sequence# from v$managed_standby; 

PROCESS            CLIENT_PROCESS   STATUS                    SEQUENCE#
------------------ ---------------- ------------------------ ----------
ARCH               ARCH             CONNECTED                         0
ARCH               ARCH             CONNECTED                         0

备库的日志:
MRP0: Background Managed Standby Recovery process started (xiaoyu)
Managed Standby Recovery not using Real Time Apply
MRP0: Background Media Recovery terminated with error 16157
Sun Feb 24 20:43:52 2013
Errors in file /db/oracle/product/10.2.0/db_1/admin/xiaoyu/bdump/xiaoyu_mrp0_2783.trc:
ORA-16157: media recovery not allowed following successful FINISH recovery
Sun Feb 24 20:43:52 2013
Errors in file /db/oracle/product/10.2.0/db_1/admin/xiaoyu/bdump/xiaoyu_mrp0_2783.trc:
ORA-16157: media recovery not allowed following successful FINISH recovery
Sun Feb 24 20:43:52 2013
MRP0: Background Media Recovery process shutdown (xiaoyu)
Sun Feb 24 20:43:53 2013
Completed: alter database recover managed standby database disconnect from session
。。。。。。
Errors in file /db/oracle/product/10.2.0/db_1/admin/xiaoyu/udump/xiaoyu_rfs_512.trc:
ORA-16143: RFS connections not allowed during or after terminal recovery
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[33]: Assigned to RFS process 522
RFS[33]: Identified database type as 'physical standby'
RFS[33]: No connections allowed during/after terminal recovery.
Mon Feb 25 00:12:04 2013
Errors in file /db/oracle/product/10.2.0/db_1/admin/xiaoyu/udump/xiaoyu_rfs_522.trc:
ORA-16143: RFS connections not allowed during or after terminal recovery

通过备库的alert日志发现mrp进程启动后马上就意外关闭了,而引起关闭的是因为ora-16157错误,rfs进程也意外终止了。

主库的日志:
ORA-16143: RFS connections not allowed during or after terminal recovery
Sun Feb 24 22:51:54 2013
PING[ARC0]: Heartbeat failed to connect to standby 'xiaoyu_single'. Error is 16143.
Sun Feb 24 22:56:54 2013
Errors in file /db/oracle/product/10.2.0/db_1/admin/xiaoyu/bdump/xiaoyu1_arc0_5656.trc:
ORA-16143: RFS connections not allowed during or after terminal recovery
Sun Feb 24 22:56:54 2013
PING[ARC0]: Heartbeat failed to connect to standby 'xiaoyu_single'. Error is 16143.

而我们来看看oracle官档的解释:
RECOVER MANAGED STANDBY DATABASE FINISH [FORCE][NOWAIT|WAIT] ]:

The FINISH clause initiates failover on the target physical standby database and 

recovers the current standby redo log files. 

Use the FINISH clause only in the event of the failure of the primary database. 

This clause overrides any delay intervals specified.
Include FORCE to terminate the RFS processes and allow the failover to occur immediately, 

without waiting for the RFS process to exit. 

Specify NOWAIT to have control returned immediately, rather than after the recovery process is complete.
See Step 4 in Section 7.2.2 for examples.

oracle提到如果recover managed standby database finish后会强制停掉rfs和mrp进程,

那么上面的ora-16157的错误就很容易说通了,此时这个dg环境已经发生了改变,

主库rac是一个dg的主库,而备库单实例也是一个即将转化为switch primary的备库,

而这个主库和备库已经不是不能组成一个dg体系了。换句俗话说:“他们已经不是一个世界的人了!”


原文地址:http://www.dbaxiaoyu.com/archives/851



0 0
原创粉丝点击