Translate into your own language

Wednesday, June 8, 2016

Recovering a datafile without backup

If a datafile is damaged and no backup of that file is available, then you can still recover the datafile given the following condition:

1.  All archived log files written after the creation of the original datafile are available

2.The control file contains the name of the damaged file (that is, the control file is current, or is a      backup taken after the damaged datafile was added to the database).

Steps to recover a datafile without backup

1. Very first step we have to do is to re-create a datafile for recovery:

Create a new, empty datafile to replace a damaged datafile that has no corresponding backup. For example, assume that the datafile ?/oradata/trgt/users01.dbf has been damaged, and no backup is available. The following statement re-creates the original datafile (same size) on disk2:

ALTER DATABASE CREATE DATAFILE '?/oradata/trgt/users01.dbf' AS   '/disk2/users01.dbf';

This statement creates an empty file that is the same size as the lost file. The database looks at information in the control file and the data dictionary to obtain size information. The old datafile is renamed as the new datafile.

2. Perform media recovery on the empty datafile.

For example, enter:

RECOVER DATAFILE '/disk2/users01.dbf'

All archived logs written after the original datafile was created must be applied to the new, empty version of the lost datafile during recovery.


No comments:

Post a Comment