Sunday, April 27, 2008

Restore and Recovery of Individual Tablespaces or Datafiles

In this mode some of the datafiles are damaged or lost. Now you can take the corresponding tablespace offline and perform restore and recover of the specified tablespaces.

Procedures:
--------------

Here I have deleted users01.dbf datafile from OS. Now to restore and recover the datafile you can keep your database mount or in open mode do the following.

1)Make offline of the affected tablespace.


RMAN> sql 'alter tablespace users offline immediate';
sql statement: alter tablespace users offline immediate

2)Restore Tablespace.

RMAN> restore tablespace users;
Starting restore at 27-APR-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /oradata2/data1/data1/users01.dbf
channel ORA_DISK_1: reading from backup piece /oradata2/flash_recovery_area/DATA1/backupset/2008_04_27/o1_mf_nnndf_TAG20080427T130713_419dp1z4_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata2/flash_recovery_area/DATA1/backupset/2008_04_27/o1_mf_nnndf_TAG20080427T130713_419dp1z4_.bkp tag=TAG20080427T130713
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 27-APR-08

3)Recover Tablespace.

RMAN> recover tablespace users;
Starting recover at 27-APR-08
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 27-APR-08

4)Make the tablespace online.

RMAN> sql'alter tablespace users online';
sql statement: alter tablespace users online

No comments:

Post a Comment