---------------------------------------------
Experimental platform: Windows Oracle
10.1.0.2.0
Author: ningoo
2005-03-26
--------------------------------------------
After backing up the control file, a data file has been added in the database, and then the current control file is corrupted, you need to use the previous backup control file to make recovery.
Backup control file
SQL> ALTER DATABASE BACKUP ControlFile To 'E: / Contl.ctl';
The database has been changed.
2. Add a data file to the database using Create TableSpace or ALTER TABLESPACE Add DataFile.
SQL> CREATE TABLESPACE TEST
2 DataFile 'E: /oracle/oradata/ning/test01.dbf' size
10m,
3 'E: /oracle/oradata/ning/test02.dbf' size
10m;
The table space has been created.
3. Swingn the current control file after SHUTDOWN
C: /> DEL E: / ORACLE/ORADATA/NINGCONTROL01.CTLC: /> DEL E: /Oracle/oradata/ning/control02.ctlc: /> DEL E: /Oracle/oradata/Ning/Control03.ctl
4.startup database
Report: ORA-00205: Error In Identifying ControlFile, Check Alert log for more info
5. Resting the backup of the control file RESTORE
C: /> COPY E: /CONTROL.CTL E: / ORACLE/Ordata/NINGCONTROL01.CTLC: /> COPY E: /CONTROL.CTL E: / ORACLE/Ordata/NINGCONTROL02.CTLC: /> COPY E : /Control.ctta/Ning/Control03.ctl
6. Use backup control files to recover
SQL> Recover Database Using Backup ControlFile;
ORA-00283: Recovery session cancels due to errors
ORA-01244: Unnamed data files are added to the control file by media recovery
ORA-01110: Data file 5: 'E: /oracle/oradata/ning/test01.dbf'
ORA-01110: Data file 6: 'E: /oracle/oradata/ning/test02.dbf'
At this point, you can see two unname files when you view v $ datafile.
SQL> SELECT NAME FROM V $ datafile;
Name
-------------------------------------------
E: /oracle/oradata/ning/system01.dbf
E: /oracle/oradata/ning/undotbs01.dbf
E: /oracle/oradata/ning/sysaux01.dbf
E: /oracle/oradata/ning/Users01.dbf
C: / windows / system32 / unnamed00005
C: / windows / system32 / unnamed00006
View alert_sid.log, you can see the following
File # 5 Added to Control File as 'unnamed00005'. Originally CREATED AS: 'E: / ORACLE/Ordata/NING/TEST01.DBF'
File # 6 added to control file as 'unnamed00006'. Originally CREATED AS:
'E: /oracle/oradata/ning/test02.dbf'
It can be known that UNNAMED00005 corresponds to 'E: /oracle/oradata/ning/test01.dbf'
Unnamed00006 corresponds to 'E: /oacle/oradata/ning/test02.dbf'
7. Rename data file
SQL> ALTABASE RENAME FILE 'C: / Windows / System32 / Unnamed00005' To
2 'E: /oacle/oradata/ning/test01.dbf';
The database has been changed.
SQL> ALTER DATABASE RENAME FILE 'C: / Windows / System32 / Unnamed00006' To
2 'E: /oacle/oradata/ning/test02.dbf';
The database has been changed.
8. Use backup control file recovery
SQL> Recover Database Using Backup ControlFile;
Complete media recovery.
9. Open the database using the ResetLogs option
SQL> ALTABASE OPEN;
ALTER DATABASE OPEN
*
Errors in Chain 1:
ORA-01589: To open the database, you must use the ResetLogs or NoreSetLogs option.
SQL> ALTER DATABASE OPEN NORESETLOGS;
Alter Database Open NoreSetlogs
*
Errors in Chain 1:
ORA-01588: To turn on the database, you must use the ResetLogs option.
SQL> ALTER DATABASE OPEN RESETLOGS;
The database has been changed.
10. Add a TEMP file
At this point, you can see the following warnings.
*********************************************************** ************
Warning: The Following Temporary TableSpaces Contain No Files.
This CONDition Can Occur When A Backup ControlFile HAS
Been Restored. It May Be Necessary To Add Files To There
TableSpaces. That Can Be Done Using The SQL Statement:
Alter TableSpace
Alternatively, if these Temporary TableSpaces Are No Longer
Needed, Then they can be dropped.
EMPTY TEMPORY TABLESPACE: TEMP
*********************************************************** ************
After recovering the backup control file, the TEMP table space is blank
SQL> SELECT NAME from V $ TEMPFILE;
Unselected SQL> ALTER TABLESPACE TEMP Add Tempfile
2 'E: /oacle/oradata/ning/temp01.dbf';
The table space has been changed.