Assumptions
1. Non-system datafile is corrupted.
2. Required archivelogs (‘sysdate – x’) are present in the archive log dest file system.
Datafile Corrupted (Confirmation
SQL> shutdown immediate;
ORA-01122: database file 11 failed verification check
ORA-01110: data file 11: ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’
ORA-01251: Unknown File Header Version read for file number 11
SQL>
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
Total System Global Area 654311424 bytes
Fixed Size 2075088 bytes
Variable Size 377488944 bytes
Database Buffers 268435456 bytes
Redo Buffers 6311936 bytes
Database mounted.
ORA-01110: data file 11: ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’
ORA-01115: IO error reading block from file 11 (block # 1)
ORA-27069: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
Error:
Accessing application will get errors while accessing this datafile.
SQL> select NAME,STATUS from v$datafile where name=’/restore1/oracle/SID/SID._becubic_index_04.dbf’;
NAME STATUS
——————————————————————————– ——-
/restore1/oracle/SID/SID._becubic_index_04.dbf ONLINE
Restore Datafile
run{
allocate channel ch1 type ‘SBT_TAPE’;
set newname for datafile 11 to ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’;
RESTORE datafile ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’;
switch datafile 11;
release channel ch1;
}
RMAN> run{
allocate channel ch1 type ‘SBT_TAPE’;
set newname for datafile 11 to ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’;
RESTORE datafile ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’;
switch datafile 11;
release channel ch1;
}2> 3> 4> 5> 6> 7>
using target database control file instead of recovery catalog
allocated channel: ch1
channel ch1: sid=156 devtype=SBT_TAPE
channel ch1: NMO v4.5.0.0
executing command: SET NEWNAME
Starting restore at 26-OCT-09
channel ch1: starting datafile backupset restore
channel ch1: specifying datafile(s) to restore from backup set
restoring datafile 00011 to /restore1/oracle/SID/SID._becubic_index_04.dbf
channel ch1: reading from backup piece SID_20091026_701232445_1570_1.dbf
channel ch1: restored backup piece 1
piece handle=SID_20091026_701232445_1570_1.dbf tag=TAG20091026T024724
channel ch1: restore complete, elapsed time: 00:00:15
Finished restore at 26-OCT-09
released channel: ch1
RMAN>
Recover Datafile
SQL> recover datafile ‘/restore1/oracle/SID/SID._becubic_index_04.dbf’;
ORA-00279: change 15695090 generated at 10/26/2009 02:47:25 needed for thread 1
ORA-00289: suggestion : /restore1/oracle/SID/SID_1_638_644850793.dbf
ORA-00280: change 15695090 for thread 1 is in sequence #638
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00279: change 15695857 generated at 10/26/2009 03:16:39 needed for thread 1
ORA-00289: suggestion : /restore1/oracle/SID/SID_1_639_644850793.dbf
ORA-00280: change 15695857 for thread 1 is in sequence #639
ORA-00278: log file ‘/restore1/oracle/SID/SID_1_638_644850793.dbf’ no
longer needed for this recovery
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
Log applied.
Media recovery complete.
Restart the database
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 654311424 bytes
Fixed Size 2075088 bytes
Variable Size 377488944 bytes
Database Buffers 268435456 bytes
Redo Buffers 6311936 bytes
Database mounted.
Database opened.