Data Guard维护管理三之处理archivelog gap

1.When Is an Archive Gap Discovered?
An archive gap can occur whenever the primary database archives a log locally, but the log is not received at the standby site. Every minute, the primary database polls its standby databases to see if there are gaps in the sequence of archived redo log files.

每分钟,prmary database都会检测standby database看archived redo logfile是否发生开gap.

2.How Is a Gap Resolved?

Gap recovery is handled through the polling mechanism. For physical and logical standby databases, Oracle Change Data Capture, and Oracle Streams, Data Guard performs gap detection and resolution by automatically retrieving missing archived redo log files from the primary database. No extra configuration settings are required to poll the standby databases, to detect any gaps, or to resolve the gaps.

The important consideration here is that automatic gap recovery is contingent on the availability of the primary database. If the primary database is not available and you have a configuration with multiple physical standby databases, you can set up additional initialization parameters so that the Redo Apply can resolve archive gaps from another standby database


oracle会自动检测和处理出现gap的archivelog,不需要dba手动处理,当然,前提是primary和standby状态是avaliable,网络恢复正常。


3. Using the Fetch Archive Log (FAL) to Resolve Archive Gap

The fetch archive log (FAL) client and server resolve gaps detected in the range of archived redo log files generated at the primary database and received at the physical standby database.

  • The FAL client requests the transfer of archived redo log files automatically.-------FAL client端请求自动传输archived log

  • The FAL server services the FAL requests coming from the FAL client.--------------FAL server端响应来自FAL client端的请

The FAL mechanism handles the following types of archive gaps and problems:

  • When creating a physical or logical standby database, the FAL mechanism can automatically retrieve any archived redo log files generated during a hot backup of the primary database.
    FAL会自动检索primary 热备份产生的作何arcived redo logfile

  • When there are problems with archived redo log files that have already been received on the standby database, the FAL mechanism can automatically retrieve archived redo log files to resolve any of the following situations:

    • When the archived redo log file is deleted from disk before it is applied to the standby database.

    • When the archived redo log file cannot be applied because of a disk corruption.

    • When the archived redo log file is accidentally replaced by another file (for example, a text file) that is not an archived redo log file before the redo data has been applied to the standby database.

  • When you have multiple physical standby databases, the FAL mechanism can automatically retrieve missing archived redo log files from another physical standby database.

         如果有多个物理standby,FAL会自动从其他的standby上检索丢失的archived log file.
4.Manually Determining and Resolving Archive Gaps
In some situations, automatic gap recovery may not take place and you will need to perform gap recovery manually. For example, you will need to perform gap recovery manually if you are using logical standby databases and the primary database is not available.
手动解决archive gap

首先确认一下发生gap的redo logfile sequence号
standby上执行:
SYS@jzh>select * from v$archive_gap;

  THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
         1            27             28
这里显示sequence#,27-28在standby 上丢失。
在primary上执行以下语句,查看sequence# 27,28
SYS@jyp>select name from v$archived_log where thread#=1 and dest_id=1 and sequence# between 27 and 28;

NAME
--------------------------------------------------------------------------------
/u01/oracle/arch/1_27_867602649.arc
/u01/oracle/arch/1_28_867602649.arc

将以上两个archivelog scp至standby并register.
SYS@jzh>alter database register logfile '/u01/oracle/arch/1_27_867602649.arc';
Database altered.
SYS@jzh>alter database register logfile '/u01/oracle/arch/1_28_867602649.arc';
Database altered.
register之后standby会自动recovery.查看alert日志:
alter database register logfile '/u01/oracle/arch/1_27_867602649.arc'
There are 1 logfiles specified.
ALTER DATABASE REGISTER [PHYSICAL] LOGFILE
Completed: alter database register logfile '/u01/oracle/arch/1_27_867602649.arc'
Thu Jan 01 10:04:33 2015
Media Recovery Log /u01/oracle/arch/1_27_867602649.arc
Media Recovery Waiting for thread 1 sequence 28
Fetching gap sequence in thread 1, gap sequence 28-28
Thu Jan 01 10:04:42 2015
alter database register logfile '/u01/oracle/arch/1_28_867602649.arc'
There are 1 logfiles specified.
ALTER DATABASE REGISTER [PHYSICAL] LOGFILE
Completed: alter database register logfile '/u01/oracle/arch/1_28_867602649.arc'
Thu Jan 01 10:04:43 2015
Media Recovery Log /u01/oracle/arch/1_27_867602649.arc
Media Recovery Log /u01/oracle/arch/1_28_867602649.arc
Media Recovery Waiting for thread 1 sequence 29 (in transit)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10271187/viewspace-1386989/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10271187/viewspace-1386989/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值