How to perform complete database recovery when the backup was taken before adding the datafiles, and you are rolling forward through the recovery process where yours recovery stops at a point where you added datafiles?
In this scenario you are performing a recovery by restoring the control file from backup. All data files are current and online redo logs are available. You had added few data files recently after the control file backup was taken, so control file backup has no awareness of the newly added data files. Thus during the recovery of controlfile, oracle database stops recovery when it encounters a CREATE TABLESPACE or ALTER TABLESPACE ADD DATAFILE operation indicating that controlfile has no awareness of the newly added datafiles with the following error:
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 15: ‘D:\oracle\oradata\sadhan \TMIS01.DBF’
ORA-01110: data file 16: ‘D:\oracle\oradata\sadhan \TMIS01.DBF’
At this stage you need to find the temporary and actual name of newly added datafile and rename the temporary name (usually indicating with error message) with actual name (check in alert.log).
SQL>SELECT FILE#,NAME FROM V$DATAFILE;
1 D:\ORACLE\ORADATA\SADHAN\ SYSTEM01.DBF
2 D:\ORACLE\ORADATA\SADHAN\ UNDOTBS01.DBF
3 D:\ORACLE\ORADATA\SADHAN\ EXAMPLE01.DBF
4 D:\ORACLE\ORADATA\SADHAN\ INDX01.DBF
5 D:\ORACLE\ORADATA\SADHAN\ TOOLS01.DBF
6 D:\ORACLE\ORADATA\SADHAN\ USERS01.DBF
7 D:\ORACLE\ORADATA\SADHAN\ SDH_TIMS01.DBF
8 D:\ORACLE\ORADATA\SADHAN\ SDH_TIMS02.DBF
9 G:\ORA_DBF_EXTENDED\SDH_H RMS01.DBF
10 F:\ORACLE\SADHAN\SDH_EDSS 01.DBF
11 G:\ORA_DBF_EXTENDED\SDH_S HTR01.DBF
12 G:\ORA_DBF_EXTENDED\SDH_F IN01.DBF
13 F:\ORACLE\SADHAN\SDH_EDSS 02.DBF
14 D:\ORACLE\ORADATA\SADHAN\ INDX02.DBF
15 D:\ORACLE\ORADATA\SADHAN\ UNNAMED00001
16 D:\ORACLE\ORADATA\SADHAN\ UNNAMED00001
To identify the exact name of the data file check the error message in the alert log for the corresponding data File#. Once you identify the exact name of the data file, rename the file using alter database rename file command.
SQL>Alter database rename file ‘D:\ORACLE\ORADATA\SADHAN \UNNAMED00001’ TO ‘D:\ORACLE\ORADATA\SADHAN \TIMES01.DBF’;
SQL>Alter database rename file ‘D:\ORACLE\ORADATA\SADHAN \UNNAMED00002’ TO ‘D:\ORACLE\ORADATA\SADHAN \TIMES02.DBF’;
Then continue recovery by issuing the recovery statement:
RMAN>RECOVER AUTOMATIC DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
You can choose to roll forward the database to any point in time or to complete recovery. Then open the database in resetlogs option.
RMAN>Alter database open resetlogs;
In this scenario you are performing a recovery by restoring the control file from backup. All data files are current and online redo logs are available. You had added few data files recently after the control file backup was taken, so control file backup has no awareness of the newly added data files. Thus during the recovery of controlfile, oracle database stops recovery when it encounters a CREATE TABLESPACE or ALTER TABLESPACE ADD DATAFILE operation indicating that controlfile has no awareness of the newly added datafiles with the following error:
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 15: ‘D:\oracle\oradata\sadhan
ORA-01110: data file 16: ‘D:\oracle\oradata\sadhan
At this stage you need to find the temporary and actual name of newly added datafile and rename the temporary name (usually indicating with error message) with actual name (check in alert.log).
SQL>SELECT FILE#,NAME FROM V$DATAFILE;
1 D:\ORACLE\ORADATA\SADHAN\
2 D:\ORACLE\ORADATA\SADHAN\
3 D:\ORACLE\ORADATA\SADHAN\
4 D:\ORACLE\ORADATA\SADHAN\
5 D:\ORACLE\ORADATA\SADHAN\
6 D:\ORACLE\ORADATA\SADHAN\
7 D:\ORACLE\ORADATA\SADHAN\
8 D:\ORACLE\ORADATA\SADHAN\
9 G:\ORA_DBF_EXTENDED\SDH_H
10 F:\ORACLE\SADHAN\SDH_EDSS
11 G:\ORA_DBF_EXTENDED\SDH_S
12 G:\ORA_DBF_EXTENDED\SDH_F
13 F:\ORACLE\SADHAN\SDH_EDSS
14 D:\ORACLE\ORADATA\SADHAN\
15 D:\ORACLE\ORADATA\SADHAN\
16 D:\ORACLE\ORADATA\SADHAN\
To identify the exact name of the data file check the error message in the alert log for the corresponding data File#. Once you identify the exact name of the data file, rename the file using alter database rename file command.
SQL>Alter database rename file ‘D:\ORACLE\ORADATA\SADHAN
SQL>Alter database rename file ‘D:\ORACLE\ORADATA\SADHAN
Then continue recovery by issuing the recovery statement:
RMAN>RECOVER AUTOMATIC DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
You can choose to roll forward the database to any point in time or to complete recovery. Then open the database in resetlogs option.
RMAN>Alter database open resetlogs;
No comments:
Post a Comment