Recovering from loss of Datafile using RMAN

If some datafiles are lost or become damaged then when we try start the database then database will not start and it will throw error while opening the database. If we were taking backups using RMAN then we recover the database using RMAN.

Case Study

Recover from the loss of a datafile assuming the following

  • We lost a particular datafile say '/u02/oracle/testdb/test/users01.dbf' (we can know this while opening the DB)
  • All other datafiles are OK
  • Log files are OK
  • Control Files are OK
  • Database is running in archive log mode
  • We were taking backups of this database using RMAN

Solution

To recover from the damaged or lost datafile using RMAN do the following

Step 1

Try to start the database using SQL Plus

$ export ORACLE_SID=test
$ sqlplus
SQL> startup

When we try to open, Oracle will show an error that a datafile is missing as shown below

startup database

From the above the above output we can clearly see that '/u02/oracle/testdb/test/users01.dbf' datafile is not found or damaged.

Now we need to recover it.

To perform a Complete Recovery of this datafile follow the next step

Step 2

Exit from SQL Plus and start RMAN by typing the following command

$ rman target / nocatalog

start rman for recovery

 

Continue Next Page

New: Modern Oracle

Concepts here also apply to Oracle 19c/21c/23ai unless a version note says otherwise. See the homepage for what's changed.