Loss of Datafiles
Note : Database running in ARCHIVELOG mode
1) Mount the Database.
2) Restore Datafiles to the new locations, If Original disk is corrupted.
3) Make Datafile Offline.
4) Rename Datafile.
5) Recover Datafile.
6) Bring Datafile ONLINE.
SVRMGR> ALTER DATABASE RENAME FILE '/dsk01/ORACLE/reco/users01.dbf'
to 'dsk02/ORACLE/reco/users01.dbf';
(If Database is MOUNTED).OR
SVRMGR> ALTER TABLESPACE RENAME DATAFILE 'dsk01/ORACLE/reco/users01.dbf'
to '/dsk02/ORACLE/reco/users01.dbf';
(If Database is OPEN)
In this scenario two datafiles were lost due to media failure, but one of the disks containing the files crashed and was damaged. Hence the datafile on that disk had to be restored to an alternate location.
SVRMGR> startup mount
SVRMGR> alter database rename file
2> '/u1/ORACLE/reco/users02.dbf'
3> to '/u4/ORACLE/reco/users02.dbf';
Statement processed.
SVRMGR> select * from v$recover_file;
FILE# ONLINE ERROR CHANGE# TIME
---------- ------- ------------------ ---------- ---------
5 ONLINE 3.2241E+12 17-MAR-01
6 ONLINE 3.2241E+12 17-MAR-01
SVRMGR> alter database datafile '/u1/ORACLE/reco/users01.dbf' offline;
Statement processed.
SVRMGR> alter database datafile '/u4/ORACLE/reco/users02.dbf' offline;
Statement processed.
SVRMGR> recover datafile '/u1/ORACLE/reco/users01.dbf'
Media recovery complete.
SVRMGR> recover datafile '/u4/ORACLE/reco/users02.dbf'
Media recovery complete.
SVRMGR> alter database open;
Statement processed.
]
SVRMGR> alter database datafile '/u1/ORACLE/reco/users01.dbf' online;
Statement processed.
SVRMGR> alter database datafile '/u4/ORACLE/reco/users02.dbf' online;
Statement processed.