In my system i lost these datafiles.they no longer exist and database is in now unusable state. note that there are redo logs and temp files as well in this list
/data04/TROY/TROY_INDEX10M01.dbf
/data04/TROY/TROY_INDEX10M04.dbf
/data04/TROY/TROY_INDEX10M07.dbf
/data04/TROY/TROY_INDEX64K01.dbf
/data06/TROY/oradata/TROY_PERFSTA02.dbf
/data06/TROY/TROY_sysaux02.dbf
/data04/TROY/TROY_system02.dbf
/data04/TROY/TROY_temp01.dbf
/data04/TROY/TROY_temp02.dbf
/data04/TROY/TROY_undotbs04.dbf
/data04/TROY/TROY_USERDATA10M01.dbf
/data04/TROY/redo02b.log
/data04/TROY/redo03a.log
To resolve this issue first i took these files offline as they no loger exist on my FS. If database still up and running then make them offline other wise start the databaase in mount state.
note that here system and sysaux datafiles are lost so anyways database is unusable. So in this case better shutdown the db (use shut abort if it hangs at shutdown immediate) and start it in mount state to perform restore and recover. If non system files are lost no need to shutdown db as it will be functional and you just take those files offline and perform restore and recovery
SQL > startup mount
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M01.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M04.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M07.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX64K01.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data06/TROY/TROY_sysaux02.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data06/TROY/oradata/TROY_PERFSTA02.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_temp01.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_temp02.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_undotbs04.dbf' OFFLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_system02.dbf' OFFLINE;
now go to rman and connect to catalog db and restore them. I have their backup avaialable on tape. exclude temp files as it can be added later
rman target / catalog CATUSR/rman@CAT_APP
run {
SET AUTOLOCATE ON;
allocate channel C1 type 'SBT_TAPE';
allocate channel C2 type 'SBT_TAPE';
allocate channel C3 type 'SBT_TAPE';
allocate channel C4 type 'SBT_TAPE';
restore datafile '/data04/TROY/TROY_INDEX10M01.dbf';
restore datafile '/data04/TROY/TROY_INDEX10M04.dbf';
restore datafile '/data04/TROY/TROY_INDEX10M07.dbf';
restore datafile '/data04/TROY/TROY_INDEX64K01.dbf';
restore datafile '/data06/TROY/TROY_sysaux02.dbf';
restore datafile '/data06/TROY/oradata/TROY_PERFSTA02.dbf';
restore datafile '/data04/TROY/TROY_undotbs04.dbf';
restore datafile '/data04/TROY/TROY_system02.dbf';
}
redo02b.log and redo03a.log are multiplxed so copy redo02b.log from redo02a.log and redo03a.log from redo03b.log
now recover those restored datafiles
run {
SET AUTOLOCATE ON;
allocate channel C1 type 'SBT_TAPE';
allocate channel C2 type 'SBT_TAPE';
allocate channel C3 type 'SBT_TAPE';
allocate channel C4 type 'SBT_TAPE';
recover datafile '/data06/TROY/TROY_sysaux02.dbf';
recover datafile '/data04/TROY/TROY_INDEX10M01.dbf';
recover datafile '/data04/TROY/TROY_INDEX10M04.dbf';
recover datafile '/data04/TROY/TROY_INDEX10M07.dbf';
recover datafile '/data04/TROY/TROY_INDEX64K01.dbf';
recover datafile '/data06/TROY/oradata/TROY_PERFSTA02.dbf';
recover datafile '/data02/TROY/TROY/TROY_USERDATA10M01.dbf';
recover datafile '/data04/TROY/TROY_undotbs04.dbf';
recover datafile '/data04/TROY/TROY_system02.dbf';
}
use this command to check how many files still pending for recover. once alll files are recovered this command should retun no rows.here is the output when recover datafile was in progress.
note the recover column is YES for all files which needs recovery
select file#,checkpoint_change#, status, recover from v$datafile_header;
FILE# NAME CHECKPOINT_CHANGE# STATUS REC
---------- -------------------------------------------------------------------------------- ------------------ ------- ---
12 /data04/TROY/TROY_INDEX10M01.dbf 1.6024E+13 OFFLINE YES
15 /data04/TROY/TROY_INDEX10M04.dbf 1.6024E+13 ONLINE YES
18 /data04/TROY/TROY_INDEX64K01.dbf 1.6024E+13 OFFLINE YES
22 /data02/TROY/TROY/TROY_USERDATA10M01.dbf 1.6024E+13 OFFLINE YES
27 /data04/TROY/TROY_undotbs04.dbf 1.6024E+13 ONLINE YES
29 /data06/TROY/oradata/TROY_PERFSTA02.dbf 1.6024E+13 OFFLINE YES
31 /data06/TROY/TROY_sysaux02.dbf 1.6024E+13 OFFLINE YES
38 /data04/TROY/TROY_INDEX10M07.dbf 1.6024E+13 OFFLINE YES
once all files are recovered check fuzzyness
select file#,name,checkpoint_change#,CHECKPOINT_TIME,fuzzy from v$datafile_header where fuzzy='YES';
go to sql prompt and to recover database to remove fuzzyness
SQL > recover database;
now fuzzy query should return no rows.
run again to verify
select file#,name,checkpoint_change#,CHECKPOINT_TIME,fuzzy from v$datafile_header where fuzzy='YES';
now open the database
SQL > alter database open;
make datafiles online
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M01.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M04.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX10M07.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_INDEX64K01.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data06/TROY/TROY_sysaux02.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data06/TROY/oradata/TROY_PERFSTA02.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_temp01.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_temp02.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_undotbs04.dbf' ONLINE;
ALTER DATABASE DATAFILE '/data04/TROY/TROY_system02.dbf' ONLINE;
use below query to verify that only ONLINE and SYSTEM status of all files.
SQL> select status,count(*) from v$datafile group by status;