Rman> Backup current controlfile tag= ' bak_ctlfile ' format= '/home/oracle/backup/bak_ctl_%u_%t ';
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
Switch multiple times, cut out several archivelog files, delete one of them
RM O1_mf_1_3_cpk5wloy_.arc
Then delete the control file
Rm/u01/app/oracle/oradata/orcl/control01.ctl
Rm/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Shutdown abort;
Rman startup Nomount mode start
rman> restore Controlfile from '/home/oracle/backup/bak_ctl_12r8mgn0_1_1_20160621 ';
Starting restore at 21-jun-16
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=19 Device Type=disk
Channel ora_disk_1:restoring Control File
Channel Ora_disk_1:restore complete, elapsed time:00:00:01
Output File Name=/u01/app/oracle/oradata/orcl/control01.ctl
Output File Name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 21-jun-16
rman> Mount Database;
Database mounted
Released Channel:ora_disk_1
The Recover database report cannot find the 3rd archive log file.
rman> Recover database;
Starting recover at 21-jun-16
Starting implicit crosscheck backup at 21-jun-16
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=19 Device Type=disk
crosschecked objects
Finished implicit crosscheck backup at 21-jun-16
Starting implicit crosscheck copy at 21-jun-16
Using channel Ora_disk_1
Finished implicit crosscheck copy at 21-jun-16
Searching for all files in the recovery area
Cataloging files ...
Cataloging done
List of cataloged Files
=======================
File Name:/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_5_cpk5wplw_.arc
Using channel Ora_disk_1
Starting Media recovery
Archived log for thread 1 with sequence 4 was already on disk as File/u01/app/oracle/oradata/orcl/redo01.log
Archived log for thread 1 with sequence 5 was already on disk as FILE/U01/APP/ORACLE/FLASH_RECOVERY_AREA/ORCL/ARCHIVELOG/2 016_06_21/o1_mf_1_5_cpk5wplw_.arc
Archived log for thread 1 with sequence 6 was already on disk as File/u01/app/oracle/oradata/orcl/redo03.log
Unable to find archived log
Archived Log thread=1 sequence=3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE, STACK follows ===============
RMAN-00571: ===========================================================
Rman-03002:failure of recover command at 06/21/2016 09:31:51
Rman-06054:media recovery requesting unknown archived log for thread 1 with sequence 3 and starting SCN of 1112349
Need to rebuild control file sequence 3
sql> ALTER DATABASE backup Controlfile to trace;
Database altered.
sql> SELECT D.value | | '/' | | LOWER (RTRIM (i.instance, CHR (0))) | | ' _ora_ ' | | P.spid | | '. TRC ' Trace_file_name from (SELECT p.spid from V$mystat m, v$session S, v$process p WHERE m.statistic# = 1 and s.sid = M. SID and p.addr = s.paddr) p, (SELECT t.instance from V$thread T, V$parameter v WHERE v.name = ' thread ' and (v.value = 0 OR t.thread# = To_number (v.value))) I, (SELECT VALUE from v$parameter WHERE NAME = ' user_dump_dest ') D;
Trace_file_name
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_4016.trc
Open the trace file, and then follow the Reset log method to restore
sql> startup Force Nomount;
ORACLE instance started.
Total System Global area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 520095776 bytes
Database buffers 310378496 bytes
Redo buffers 2412544 bytes
Sql> CREATE controlfile Reuse DATABASE "ORCL" Resetlogs ARCHIVELOG
2 Maxlogfiles 16
3 Maxlogmembers 3
4 Maxdatafiles 100
5 Maxinstances 8
6 Maxloghistory 292
7 LOGFILE
8 GROUP 1 '/u01/app/oracle/oradata/orcl/redo01.log ' SIZE 50M BLOCKSIZE 512,
9 GROUP 2 '/u01/app/oracle/oradata/orcl/redo02.log ' SIZE 50M BLOCKSIZE 512,
Ten GROUP 3 '/u01/app/oracle/oradata/orcl/redo03.log ' SIZE 50M BLOCKSIZE 512
One--STANDBY LOGFILE
DataFile
'/u01/app/oracle/oradata/orcl/system01.dbf ',
'/u01/app/oracle/oradata/orcl/sysaux01.dbf ',
'/u01/app/oracle/oradata/orcl/undotbs01.dbf ',
'/u01/app/oracle/oradata/orcl/users01.dbf ',
'/u01/app/oracle/oradata/orcl/example01.dbf ',
'/U01/APP/ORACLE/ORADATA/ORCL/TEST01.DBF '
CHARACTER SET Al32utf8
20;
Control file created.
sql> Recover database;
Ora-00283:recovery session canceled due to errors
Ora-01610:recovery using the BACKUP controlfile option must is done
sql> Recover database using Backup Controlfile
Ora-00279:change 1132418 generated at 06/21/2016 09:46:44 needed for thread 1
Ora-00289:suggestion:
/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_7_%u_.arc
Ora-00280:change 1132418 for thread 1 are in sequence #7
Specify log: {<ret>=suggested | AUTO | CANCEL}
/u01/app/oracle/oradata/orcl/redo01.log
Log applied.
Media recovery complete.
Continue with subsequent statements, but do not recover
Sql> VARIABLE RECNO number;
sql> execute:recno: = SYS. Dbms_backup_restore. Setconfig (' RETENTION POLICY ', ' to redundancy 1 ');
--Commands to re-create incarnation table
PL/SQL procedure successfully completed.
Sql> sql>--Below log names must be changed to existing filenames on
Sql>--disk. Any one log file from each branch can is used to
Sql>--Re-create incarnation records.
Sql>--ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_1 _%u_.arc ';
Sql>--ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_1 _%u_.arc ';
Sql>--ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_1 _%u_.arc ';
Sql>--ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_1 _%u_.arc ';
Sql>--ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/orcl/archivelog/2016_06_21/o1_mf_1_1 _%u_.arc ';
sql> ALTER DATABASE OPEN resetlogs;
Database altered.
sql> ALTER tablespace TEMP ADD tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf ' reuse;
Tablespace altered.
Rman Backup Recovery control files and archive log loss scenarios