ORA-01152: file 1 was not restored from a sufficiently old backup
Cause: An incomplete recovery session was started, but an insufficient number of logs were applied to make the database consistent. This file is still in the future of the last log applied. The most likely cause of this error is forgetting to restore the file from a backup before doing incomplete recovery.
Action: Either apply more logs until the database is consistent or restore the database file from an older backup and repeat recovery.
What exactly commands did you use in RMAN to restore/recover the database?
RMAN> restore database;
Starting restore at 25-DEC-13
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-03002: failure of restore command at 12/25/2013 20:24:11
RMAN-06085: must use SET NEWNAME command to restore datafile /u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005
this file is not exists in this location
You are hiding a lot of details. Apparently, a RECOVER DATABASE has been attempted prior to this. Apparently, at least one datafile is mssing. Possibly a CREATE CONTROLFILE has been executed with a missing datafile. All of these *before* the messages you have shown us. We can't help you if you don't reveal everything -- starting with the first error and continuing through everything you have attempted.
Hemant K Chitale
SQL> select * from v$recover_file where error like '%FILE%';
FILE# ONLINE ONLINE_ERROR CHANGE# TIME
5 ONLINE ONLINE FILE MISSING
SQL> select file#,name from v$datafile where file#=5;
The datafile with fileid 5 was part of the database earlier. It's name was not "UNANMED00005" -- that is the name assigned to it now because you ran a CREATE CONTROLFILE without specifying the correct filename for datafile 5 which belongs to the database. I do not know if it was included in the backup.
If you really really do not have a backup of the datafile (please check again !!!!!!!!!!!), you could remove it with an ALTER DATABASE DATAFILE 5 DROP;
BUT CHECK TO SEE IF THE DATAFILE OR A BACKUP OF IT STILL EXISTS -- it's real name is something *other* than "/u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005"
Hemant K Chitale
Seems like oracle has detected inconsistencies between the data dictionary and the control file being used.
alter database rename file ' /u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005' to 'correct location of the data file';
You can review your "alert.log" to see the name of the file that you need to input in the above statement.
To find the objects which reside on datafile 5 please perform :
SQL> select owner,segment_name,segment_type from dba_exents where file_id = 5 and tablespace name = (select name from v$tablespace where file#=5);
Check the alert log for any relevance to datafile 5.
-OR- as Hemant has suggested, you can drop this datafile/tablespace if its not being used.
The question is: Do you re-created the control file? In your case, I would try to restore the CONTROL FILE that was consistent with your data files. By the way, you are using RMAN!!
I've found the number 5 datafile .in a location .how can i restore and recovery this file
I would try these steps:
SQL> alter database create datafile '/u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005' as 'location/name of your datafile';
SQL> recover database until cancel using backup controlfile;
SQL> alter database open resetlogs;