Recover Oracle Database's datafile


Here are the Simple steps to recover data file from stand by/  backup server.


 1) On standby/ backup database, copy datafile from ASM to a file system if using ASM:

RMAN> backup as copy datafile 71 format '/tmp/df71.dbf';

2) transfer the datafile copy from the standby to the primary host using scp.

On primary database

3) Place the datafile to recover offline.

SQL> alter database datafile 71 offline;

4) catalog this datafile copy:

RMAN> catalog datafilecopy '/tmp/df71.dbf';

5) Confirm that datafile exists:

RMAN> list copy of datafile 71;

6) Restore the datafile:

RMAN> restore datafile 71;

7) Recover the datafile:

RMAN> recover datafile 71;

8) Place the datafile online:

SQL> alter database datafile 71 online;