某叶问地区RMAN增量备份方式恢复Dataguard物理备库

RMAN增量备份方式恢复Dataguard物理备库

某叶问地区,主库是2节点RAC,在dg备库上因为磁盘空间不足,导致备库无法应用主库redo,备库宕机并且产生很多gap

ORACLE Instance std - Archival Error
ORA-16014: log 9 sequence# 370271 not archived, no available destinations
ORA-00312: online log 9 thread 2: '/u01/app/oracle/oradata/racdb/onlineloggroup_9.292.982957611'
Tue Sep 03 19:09:46 2019
RFS[25]: Assigned to RFS process 29448
RFS[25]: Opened log for thread 1 sequence 357077 dbid 962158742 branch 964541977
Archived Log entry 598146 added for thread 1 sequence 357077 rlc 964541977 ID 0x3958d296 dest 2:
Tue Sep 03 19:09:46 2019
Non critical error ORA-48181 caught while writing to trace file "/u01/app/oracle/diag/rdbms/std/std/trace/std_ora_29454.trc"
Error message: Linux-x86_64 Error: 28: No space left on device
Additional information: 1
Writing to the above trace file is disabled for now on...
Creating archive destination file : /u01/arch_std/1_357078_964541977.arc (13184 blocks)
Tue Sep 03 19:09:46 2019
Non critical error ORA-48181 caught while writing to trace file "/u01/app/oracle/diag/rdbms/std/std/trace/std_ora_29460.trc"
Error message: Linux-x86_64 Error: 28: No space left on device
Additional information: 1
Writing to the above trace file is disabled for now on...
Tue Sep 03 19:09:46 2019
Fetching gap sequence in thread 1, gap sequence 357075-357076
Tue Sep 03 19:09:59 2019
Non critical error ORA-481Wed Sep 04 10:22:32 2019
Archived Log entry 598147 added for thread 2 sequence 370271 ID 0x3958d296 dest 1:
Archiver process freed from errors. No longer stopped
Wed Sep 04 10:22:32 2019
Archived Log entry 598148 added for thread 1 sequence 357072 ID 0x3958d296 dest 1:
Wed Sep 04 10:22:32 2019
Archived Log entry 598149 added for thread 1 sequence 357073 ID 0x3958d296 dest 1:
Archived Log entry 598150 added for thread 2 sequence 370272 ID 0x3958d296 dest 1:
Archived Log entry 598151 added for thread 1 sequence 357074 ID 0x3958d296 dest 1:
Archived Log entry 598152 added for thread 2 sequence 370273 ID 0x3958d296 dest 1:
Wed Sep 04 10:22:36 2019
Fetching gap sequence in thread 1, gap sequence 357075-357076
Wed Sep 04 10:24:29 2019
FAL[client]: Failed to request gap sequence
 GAP - thread 1 sequence 357075-357076
 DBID 962158742 branch 964541977
FAL[client]: All defined FAL servers have been attempted.
------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that's sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
------------------------------------------------------------

在这里插入图片描述

因为产生了很多gap,虽然可以把主库的归档日志应用到备库,但是数量有很多,直接使用RMAN增量备份去恢复备库

查看备库最小的scn

col MIN(CHECKPOINT_CHANGE#) for 999999999999999999
col CURRENT_SCN for 99999999999999999

(1)

SQL> select min(checkpoint_change#) from v$datafile_header;

MIN(CHECKPOINT_CHANGE#)
-----------------------
                1160385

(2)

SQL>  select min(fhscn) from x$kcvfh;

MIN(FHSCN)
------------------------------------------------
1160385

(3)

SQL>  SELECT CURRENT_SCN FROM V$DATABASE;

       CURRENT_SCN
------------------
           1160384

确定主库是否添加数据文件

select FILE#,name from v$datafile where CREATION_CHANGE#> =1160384;
FILE# NAME
----- -----

没有产生新的数据文件

主库做RMAN增量备份

#!/bin/bash
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
backtime=`date +"20%y%m%d%H%M%S"`
$ORACLE_HOME/bin/rman target / log=/home/rman/db_$backtime.log <<EOF
run{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
backup as compressed backupset INCREMENTAL from scn 1160384 database format '/u01/rman/zengliang_%u.bak' tag 'zengliang';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
exit
EOF

拷贝主库RMAN备份到备库

备库恢复

RMAN> alter database mount;
RMAN> recover database;

在这里插入图片描述

备库告警日志:

ARC3 started with pid=25, OS id=26848 
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
Successful mount of redo thread 1, with mount id 1015661777
Physical Standby Database mounted.
Lost write protection disabled
ARC2: Becoming the active heartbeat ARCH
Completed: alter database mount
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Wed Sep 04 13:08:50 2019
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/arch_std
Wed Sep 04 13:10:05 2019
Incremental restore complete of datafile 9 /u01/app/oracle/oradata/racdb/datafile/cnsbzb2_2.dbf
  checkpoint is 8377652816
Incremental restore complete of datafile 14 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_4.dbf
  checkpoint is 8377652816
Incremental restore complete of datafile 18 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_8.dbf
  checkpoint is 8377652816
Incremental restore complete of datafile 22 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_12.dbf
  checkpoint is 8377652816
Incremental restore complete of datafile 27 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_16
  checkpoint is 8377652816
Incremental restore complete of datafile 31 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.299.1011202079
  checkpoint is 8377652816
Wed Sep 04 13:10:38 2019
Incremental restore complete of datafile 1 /u01/app/oracle/oradata/racdb/datafile/system.256.964541843
  checkpoint is 8377652816
  last deallocation scn is 923796
Incremental restore complete of datafile 5 /u01/app/oracle/oradata/racdb/datafile/undotbs2.264.964542065
  checkpoint is 8377652816
Incremental restore complete of datafile 2 /u01/app/oracle/oradata/racdb/datafile/sysaux.257.964541843
  checkpoint is 8377652816
  last deallocation scn is 925426
Wed Sep 04 13:12:23 2019
Incremental restore complete of datafile 3 /u01/app/oracle/oradata/racdb/datafile/undotbs1.258.964541843
  checkpoint is 8377652609
  last deallocation scn is 3
Wed Sep 04 13:12:49 2019
Incremental restore complete of datafile 8 /u01/app/oracle/oradata/racdb/datafile/cnsbzb2_1.dbf
  checkpoint is 8377652609
Incremental restore complete of datafile 13 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_3.dbf
  checkpoint is 8377652609
Incremental restore complete of datafile 17 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_7.dbf
  checkpoint is 8377652609
Incremental restore complete of datafile 21 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_11.dbf
  checkpoint is 8377652609
Incremental restore complete of datafile 25 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_15.dbf
  checkpoint is 8377652609
Incremental restore complete of datafile 30 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.298.1011202051
  checkpoint is 8377652609
Incremental restore complete of datafile 10 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.272.976493565
  checkpoint is 8377652609
Wed Sep 04 13:14:26 2019
Incremental restore complete of datafile 12 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_2.dbf
  checkpoint is 8377652534
Incremental restore complete of datafile 16 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_6.dbf
  checkpoint is 8377652534
Incremental restore complete of datafile 20 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_10.dbf
  checkpoint is 8377652534
Incremental restore complete of datafile 24 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_14.dbf
  checkpoint is 8377652534
Incremental restore complete of datafile 29 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_18.dbf
  checkpoint is 8377652534
Incremental restore complete of datafile 33 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.301.1011202127
  checkpoint is 8377652534
Incremental restore complete of datafile 34 /data/cnsbzb.302.1011202225
  checkpoint is 8377652534
Incremental restore complete of datafile 4 /u01/app/oracle/oradata/racdb/datafile/users.259.964541843
  checkpoint is 8377652534
  last deallocation scn is 3
Wed Sep 04 13:15:29 2019
Incremental restore complete of datafile 6 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.dbf
  checkpoint is 8377652534
Wed Sep 04 13:15:57 2019
Incremental restore complete of datafile 26 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_bak.dbf
  checkpoint is 8377653203
Wed Sep 04 13:16:49 2019
Incremental restore complete of datafile 11 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_1.dbf
  checkpoint is 8377653203
Incremental restore complete of datafile 15 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_5.dbf
  checkpoint is 8377653203
Incremental restore complete of datafile 19 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_9.dbf
  checkpoint is 8377653203
Incremental restore complete of datafile 23 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_13.dbf
  checkpoint is 8377653203
Incremental restore complete of datafile 28 /u01/app/oracle/oradata/racdb/datafile/cnsbzb_17.dbf
  checkpoint is 8377653203
Incremental restore complete of datafile 32 /u01/app/oracle/oradata/racdb/datafile/cnsbzb.300.1011202101
  checkpoint is 8377653203
Incremental restore complete of datafile 7 /u01/app/oracle/oradata/racdb/datafile/cnsbzb2.dbf
  checkpoint is 8377653203
Wed Sep 04 13:16:51 2019
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20
alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34
Completed: alter database recover datafile list
 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34
alter database recover if needed
 standby start
Media Recovery Start
 started logmerger process
Wed Sep 04 13:16:51 2019
Managed Standby Recovery not using Real Time Apply
Parallel Media Recovery started with 32 slaves
ORA-279 signalled during: alter database recover if needed
 standby start
...
alter database recover logfile '/u01/arch_std/1_357077_964541977.arc'
Media Recovery Log /u01/arch_std/1_357077_964541977.arc
Incomplete read from log member '/u01/arch_std/1_357077_964541977.arc'. Trying next member.
ORA-279 signalled during: alter database recover logfile '/u01/arch_std/1_357077_964541977.arc'...
alter database recover logfile '/u01/arch_std/2_370274_964541977.arc'
Media Recovery Log /u01/arch_std/2_370274_964541977.arc
Incomplete read from log member '/u01/arch_std/1_357077_964541977.arc'. Trying next member.
Errors in file /u01/app/oracle/diag/rdbms/std/std/trace/std_pr00_27766.trc  (incident=48249):
ORA-00353: log corruption near block 1360 change 8362876164 time 09/03/2019 19:07:14
ORA-00334: archived log: '/u01/arch_std/1_357077_964541977.arc'
Incident details in: /u01/app/oracle/diag/rdbms/std/std/incident/incdir_48249/std_pr00_27766_i48249.trc
Wed Sep 04 13:16:57 2019
Sweep [inc][48249]: completed
Errors with log /u01/arch_std/2_370274_964541977.arc
Recovery interrupted!
Media Recovery failed with error 354
Errors in file /u01/app/oracle/diag/rdbms/std/std/trace/std_pr00_27766.trc:
ORA-00283: recovery session canceled due to errors
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 1360 change 8362876164 time 09/03/2019 19:07:14
ORA-00334: archived log: '/u01/arch_std/1_357077_964541977.arc'
Wed Sep 04 13:16:57 2019
Dumping diagnostic data in directory=[cdmp_20190904131657], requested by (instance=1, osid=27766 (PR00)), summary=[incident=48249].
ORA-10877 signalled during: alter database recover logfile '/u01/arch_std/2_370274_964541977.arc'...
Wed Sep 04 13:16:59 2019
Sweep [inc2][48249]: completed

.
.
.
Wed Sep 04 13:25:13 2019
RFS[21]: Selected log 6 for thread 1 sequence 358171 dbid 962158742 branch 964541977
Wed Sep 04 13:25:13 2019
Archived Log entry 600119 added for thread 1 sequence 358170 ID 0x3958d296 dest 1:
Media Recovery Log /u01/arch_std/2_371142_964541977.arc
Media Recovery Log /u01/arch_std/2_371143_964541977.arc
Media Recovery Log /u01/arch_std/1_358166_964541977.arc
Media Recovery Log /u01/arch_std/1_358167_964541977.arc
Wed Sep 04 13:25:17 2019
RFS[25]: Selected log 8 for thread 2 sequence 371146 dbid 962158742 branch 964541977
Wed Sep 04 13:25:17 2019
Archived Log entry 600120 added for thread 2 sequence 371145 ID 0x3958d296 dest 1:
Media Recovery Log /u01/arch_std/1_358168_964541977.arc
Wed Sep 04 13:25:19 2019
Media Recovery Log /u01/arch_std/2_371144_964541977.arc
Media Recovery Log /u01/arch_std/2_371145_964541977.arc
Media Recovery Log /u01/arch_std/1_358169_964541977.arc
Media Recovery Log /u01/arch_std/1_358170_964541977.arc

恢复完毕

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值