Oracle 11g中通过增量备份来解决standby 和primary之间的 lag
来源:互联网 发布:jquery json对象数组 编辑:程序博客网 时间:2024/06/05 04:44
在Oracle 11g中,对于Dataguard,如果standby和primary之间的lag很大,或者primary的redo log丢失,无法应用到standby,可以通过在拷贝增量备份到standby来解决问题。
步骤如下:以下来自Oracle 官方文档:
11.10.1 Steps for Using RMAN Incremental Backups
Except where stated otherwise, the following steps apply to all three situations just listed.
Stop Redo Apply on the standby database:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
On the standby database, compute the
FROM SCN
for the incremental backup. This is done differently depending on the situation:On a standby that lags far behind the primary database, query the
V$DATABASE
view and record the current SCN of the standby database:SQL> SELECT CURRENT_SCN FROM V$DATABASE;CURRENT_SCN----------- 233995
On a standby that has widespread nologging changes, query the
V$DATAFILE
view to record the lowestFIRST_NONLOGGED_SCN
:SQL> SELECT MIN(FIRST_NONLOGGED_SCN) FROM V$DATAFILE -> WHERE FIRST_NONLOGGED_SCN>0;MIN(FIRST_NONLOGGED_SCN)------------------------ 223948
On a standby that has nologging changes on a subset of datafiles, query the
V$DATAFILE
view, as follows:SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE -> WHERE FIRST_NONLOGGED_SCN > 0;FILE# FIRST_NONLOGGED_SCN---------- ------------------- 4 225979 5 230184
Connect to the primary database as the RMAN target and create an incremental backup from the current SCN (for a standby lagging far behind the primary) or from the lowest
FIRST_NONLOGGED_SCN
(for a standby with widespread nologging changes) of the standby database that was recorded in step2:RMAN> BACKUP INCREMENTAL FROM SCN 233995 DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FORSTANDBY';
If the standby has nologging changes on a subset of datafiles, then create an incremental backup for each datafile listed in the
FIRST_NONLOGGED_SCN
column (recorded in step 2), as follows:RMAN> BACKUP INCREMENTAL FROM SCN 225979 DATAFILE 4 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';RMAN> BACKUP INCREMENTAL FROM SCN 230184 DATAFILE 5 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
The
BACKUP
commands shown generate datafile backups, as well as a control file backup that will be used in step 7.If the backup pieces are not on shared storage, then transfer all the backup pieces created on the primary to the standby:
scp /tmp/ForStandby_* standby:/tmp
If you had to copy the backup pieces in the previous step, or if you are not connected to the recovery catalog for the entire process, then you must catalog the new backup pieces on the standby (otherwise, go on to the next step):
RMAN> CATALOG START WITH '/tmp/ForStandby';
Connect to the standby database as the RMAN target and execute the
REPORT SCHEMA
statement to ensure that the standby database site is automatically registered and that the files names at the standby site are displayed:RMAN> REPORT SCHEMA;
Connect to the standby database as the RMAN target and apply incremental backups by executing the following commands. Note that the
RESTORE STANDBY CONTROLFILE FROM TAG
command only works if you are connected to the recovery catalog for the entire process. Otherwise, you must use theRESTORE STANDBY CONTROLFILE FROM '<control file backup filename>'
command.RMAN> STARTUP FORCE NOMOUNT;RMAN> RESTORE STANDBY CONTROLFILE FROM TAG 'FORSTANDBY';RMAN> ALTER DATABASE MOUNT;RMAN> RECOVER DATABASE NOREDO;
Note:
If a recovery catalog is used, then the RMANRECOVER
command will fix the path names for datafiles in the standby control file. If no recovery catalog is used, then you must manually edit the file names in your standby control file or use the RMANSET NEWNAME
command to assign the datafile names. See Oracle Database Backup and Recovery Reference for more information about the RMANRECOVER
andSET NEWNAME
commands.On standbys that have widespread nologging changes or that have nologging changes on a subset of datafiles, query the
V$DATAFILE
view to verify there are no datafiles with nologged changes. The following query should return zero rows:SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE -> WHERE FIRST_NONLOGGED_SCN > 0;
Note:
The incremental backup will become obsolete in 7 days, or you can remove it now using the RMANDELETE
command.Start Redo Apply on the physical standby database:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE -> USING CURRENT LOGFILE DISCONNECT FROM SESSION;
- Oracle 11g中通过增量备份来解决standby 和primary之间的 lag
- ORACLE 11G通过SCN做增量备份修复standby库详细过程
- oracle:rman恢复----通过增量备份来恢复
- oracle:rman恢复----通过增量备份来恢复
- Oracle的差异增量备份和累积增量备份
- Oracle的差异增量备份和累积增量备份
- Oracle的差异增量备份和累积增量备份
- Oracle的差异增量备份和累积增量备份
- ORACLE 11G 利用泠备份恢复standby库
- Oracle 中lag() 和 lead() 的应用
- Oracle的差异增量备份和累积增量备份,RMAN增量备份脚本
- 如何提高ORACLE 10G增量备份的速度
- Oracle的差异增量备份和累积增量备…
- Oracle 11g active standby不能实时同步解决
- rman备份中差异增量和累积增量的区别
- 利用增量备份恢复standby
- ORACLE全备份和0级增量备份的区别
- oracle中lag()函数和lead()函数的用法
- Android SDK Platform 4.4.2【离线环境搭建】
- (未完成)校内赛得失谈
- ubuntu12.10安装ns2.35 提示make:***[linkstate/ls.o] 错误1
- ORACLE 数据库database link使用
- NAT 网络地址转换的实现方法以及应用,测试
- Oracle 11g中通过增量备份来解决standby 和primary之间的 lag
- freeswitch软件架构
- 逗B 百度管理
- 三星S4相机声音去除办法,需要ROOT权限
- 程序员生存定律--交换是职场里一切的根本
- java swing实现动态心形图案的代码下载
- 百度真心傻逼
- Distribute Cached 使用
- Java数据结构与算法之排序