Usually when the current control file is lost, or if the current control file is inconsistent with the control file that needs to be recovered, we need to recreate a control file or use the Unsingbackup Controlfile method to recover the control file. Simply put, as long as the backup control file is inconsistent with the current control file to restore the database, you need to use the Unsingbackup Controlfile method, and once you use the method, you need to use the Resetlgos option to open the database.
I. Recovery considerations based on backup control files (whether or not to use the Recovery directory catalog)
1, even if no data files need to be restored, when using Unsing backup Controlfile method must be combined with recover command
2, regardless of using the backup control file for Point-in-time or full recovery, you must open the database using the open Resetlogs method
3. If the online log is inaccessible, you must use an incomplete recovery to the earliest one of the SCN in the online log file. This is because Rman does not back up the online log files
4. During recovery, Rman automatically searches for online logs and archived logs that are not recorded in the Rman storage warehouse to complete recovery
5. Rman automatically looks for valid archived and online logs based on the archive location in the initialization parameter file and the control file online log information. When using the Unsing backup Controlfile method, a RMAN-06054 error message is received during recovery, once the archive destination and the archive format have changed, or if a new online log member is added.
This article mainly uses the hot standby method to complete the demonstration
Second, demonstrate the use of unsing backup Controlfile
1, control the total loss of the file situation (control file after the backup changed)
--> first Use hot-standby scripts for backup
Sys@sybo2sz> Get Db_hot_bak.sql
1 set feedback off heading out verify off
2 Set pagesize 0 linesize 200
3 define dir= '/u02/database/sybo2sz/backup/hotbak '
4 define script= '/tmp/tmphotbak.sql '
5 Spool &script
6 Select ' Ho cp ' | | name| | ' &dir ' from V$datafile;
7 Spool Off
8 ALTER DATABASE begin backup;
9 Start &script
ALTER DATABASE end backup;
ALTER DATABASE backup Controlfile to ' &dir/contlbak.ctl ' reuse;
Create pfile= ' &dir/initsybo2sz.ora ' from SPFile;
13* set feedback on heading in verify on PageSize 100
Sys@sybo2sz> @db_hot_bak
Sys@sybo2sz> Show Parameter Control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Control_files String/u02/database/sybo2sz/controlf
/cntl1sybo2sz.ctl,/u02/databa
Se/sybo2sz/controlf/cntl2sybo2
Sz.ctl,/u02/database/sybo2sz/
Controlf/cntl3sybo2sz.ctl
--> adds a new tablespace to the database at which time the control file will be different from the previously backed up control file
sys@sybo2sz> Create tablespace TBS datafile '/u02/database/sybo2sz/oradata/tbs_tmp.dbf ' size 10m autoextend on;
Tablespace created.
--> add objects to a database
Sys@sybo2sz> CREATE TABLE Tb_emp tablespace TBS as select * from Scott.emp;
Table created.
Sys@sybo2sz> Select COUNT (*) from tb_emp;
COUNT (*)
----------
14
Sys@sybo2sz> select * from V$log;
group# thread# sequence# BYTES members ARC STATUS first_change# First_tim
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
3 1 116 20971520 2 NO current 1078066 08-sep-12
4 1 20971520 2 YES INACTIVE 1063428 08-sep-12
Sys@sybo2sz> Select To_char (sysdate, ' yyyymmdd hh24:mi:ss ') from dual;