首页 > Linux操作系统 > Linux操作系统 > 一次standby异常处理
一次standby异常处理
问题描述:
primary与standby日志不同步,在primary上切换日志不能传输到standby上.
查看v$archive_gap没有数据.
环境:
OS:Linux AS4
DB:ORACLE10GR2
确认是否存在archivelog gap
SQL> select * from v$archive_gap;
no row select
oracle没有侦测到log gap,oracle document上说oracle会自动侦测并修复,原文如下:
An archive gap can occur on the standby system when it is has not received one or
more archived redo log files generated by the primary database. The missing archived
redo log files are the gap. If there is a gap, it is automatically detected and resolved by
Data Guard by copying the missing sequence of log files to the standby destination.
For example, an archive gap can occur when the network becomes unavailable and
automatic archiving from the primary database to the standby database temporarily
stops. When the network is available again, automatic transmission of the redo data
from the primary database to the failed standby database resumes.
Data Guard requires no manual intervention by the DBA to detect and resolve such
gaps. The following sections describe gap detection and resolution.
确认相应进程是否正常启动
SQL> select process ,status from v$managed_standby;
PROCESS STATUS
--------- ------------
ARCH CONNECTED
ARCH CONNECTED
MRP0 WAIT_FOR_LOG
RFS进程不存RFS进程负责从primary database上取得archvielog.
把arhivelog改为异步传输﹐(原来是同步传输)过一段时间后ORACLE侦测到gap
SQL> select * from v$archive_gap;
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
1 15320 15421
再确认相应进程是正常启动
SQL> select process ,status from v$managed_standby;
PROCESS STATUS
--------- ------------
ARCH CONNECTED
ARCH CONNECTED
MRP0 WAIT_FOR_GAP
RFS IDLE
新的log可以传过来,但以前的archivelog不能传到standby上
把gap archvielog copy到standby上
scp 153[2,3,4,5,6,7,8,9]* oracle@10.182.15.27:/u03/archivelog/sfcsb/gap/
scp 154[0,1]* oracle@10.182.15.27:/u03/archivelog/sfcsb/gap/
注册log
alter database register logfile ‘/path/archvielog_name’;
….
….
alter database register logfile ‘/path/archvielog_name’;
启动log应用
alter database recover managed standby database disconnect from session;
过一段时间观察,log还是不能应用,决定手動應用
alter database recover managed standby database cancel;
recover automatic standby database;
The AUTOMATIC option automatically generates the name of the next archived
redo log file needed to continue the recovery operation.
After recovering the available log files, the Oracle database prompts for the name
of a log file that does not exist. For example, you might see:
ORA-00308: cannot open archived log '/oracle/standby/standby_logs/arcr_1_
540.arc'
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3
Specify log: {
Cancel recovery after the Oracle database applies the available log files by typing
CTRL/C:
切换到日志应用模式
alter database recover managed standby database disconnect from session;
检看进程信息
SQL> select process ,status from v$managed_standby;
PROCESS STATUS
--------- ------------
ARCH CONNECTED
ARCH CONNECTED
RFS IDLE
MRP0 APPLYING_LOG(日志正在应用)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7419833/viewspace-478251/ ,如需转载,请注明出处,否则将追究法律责任。