Cause: Source-side database application logic error, resulting in heavy retry rollback, the daily production archive 300GB, offsite backup at 10Mbps speed, resulting in archive gap;
Solution process:
1 Isolate the current SCN number of the repository
select current_scn from v$database;1612480746
2 Generating an incremental backup based on the repository SCN in the main library
--primaryshow all;run{ALLOCATE CHANNEL d1 TYPE disk;set limit channel d1 kbytes=104857600;BACKUP INCREMENTAL FROM SCN 1612480746 DATABASE FORMAT ‘J:\%U_for_stb.bk‘ include current controlfile for standby;}
3 transferring logs to the standby library
--standbycatalog start with ‘e:\inc‘;
4 Apply control file, incremental backup set
restore standby controlfile to ‘e:\control01.ctl‘ ;shutdown immediate;copy e:\control01.ctl E:\ORADATA\TCIS\CONTROL01.CTLcopy e:\control01.ctl E:\ORADATA\TCIS\CONTROL02.CTLcopy e:\control01.ctl E:\ORADATA\TCIS\CONTROL03.CTL
recover database noredo;
Error:
RMAN-03002: recover 命令 (在 07/08/2018 10:49:09 上) 失败RMAN-06094: 数据文件5必须重新存储
Start the original repository, select name from V$datafile
To find a file that is rename; a bit of a stalk;
5 Modifying the data file location
alter system set standby_file_management=manual; alter database rename file ‘E:\ORADATA\TCIS\UBSS_INDX01.DBF‘ to ‘d:\oradata\tcis\ubss_indx01.dbf‘;alter database rename file ‘E:\ORADATA\TCIS\UBSS_INDX02.DBF‘ to ‘d:\oradata\tcis\ubss_indx02.dbf‘;
6 Recover Database Noredo again
又报错,第16号文件不存在RMAN-03002: recover 命令 (在 07/08/2018 10:49:09 上) 失败RMAN-06094: 数据文件16必须重新存储
Start with the old control file and find that number 16th is added later
7 Backing up 16th files on the main library
backup datafile 16 format ‘j:\16.bak‘;
8 Recover 16 files on standby
--primarycatalog start with ‘e:\inc‘;restore datafile 16 ;recover database noredo;
RMAN-03002: recover 命令 (在 07/07/2018 10:44:11 上) 失败ORA-19693: 已包括备份片段 E:\INC\CDT7BHIL_1_1_FOR_STB.BKrecover失败,很名显,这个16号文件是之后恢复的,其scn大于之前做的备份片集
9 Clean the invalid backup slice, repeat after 2 steps again, backup, restore Controlfile,rename datafile,recover database;
10 Check after recovery complete
Resiliency parameters
alter system set standby_file_management=auto;
Start recover
alter database recover managed standby database disconnect;
Check the application of logs
SQL> select status,blocks,process,sequence# from v$managed_standby;STATUS BLOCKS PROCESS SEQUENCE#------------ ---------- --------- ----------CONNECTED 0 ARCH 0CONNECTED 0 ARCH 0CONNECTED 0 ARCH 0CONNECTED 0 ARCH 0IDLE 20480 RFS 45261IDLE 20480 RFS 45262IDLE 0 RFS 0APPLYING_LOG 81560 MRP0 45248
Check archive, delete applied archive
select a.thread#, a.sequence#, a.applied,a.namefrom v$archived_log a, v$database dwhere a.activation# = d.activation#and a.applied=‘YES‘ order by 2;
Oracle Dataguard archive Gap Post Recovery