Search This Blog

Thursday, March 15, 2012

Restore datafile with RMAN

Process to restore datafile with rman

Situation
Typical ORACLE error
ORA-00376: file 4 cannot be read at this time
ORA-01110: data file 4: '/BDDPROD/PROD/users01.dbf'

Check what happened to the datafile
Example:
ls -l /BDDPROD/PROD/users01.dbf
HOW TO
Switch the online logfiles to archive logs
rman target / catalog rman/rman@rman_cat
sql 'alter system switch logfile';

Restore the missing datafile

If you get an error at the end of the recovery process :
restore datafile 4;

You need to put all the others datafiles of the tablespace offline This command will show which datafiles need to become offline :
recover tablespace users;

After that, proceed to set offline datafiles :
sql 'alter datafile 7 offline';

Next you can recover your missing datafile and set your tablespace online :
recover datafile 4;
sql 'alter tablespace users online';

No comments:

Post a Comment