lunes, 21 de septiembre de 2009

RMAN Examples Recover

$ mv /ora01/BRDSTN/users01.dbf /ora01/BRDSTN/users.bk
Once the datafile has been renamed, attempt to start your database as follows:

RMAN> connect target /
RMAN> startup

You should see a message similar to the following:
RMAN-03002: failure of startup command at 10/19/2006 16:13:07
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'C:\ORA01\BRDSTN\USERS01.DBF'

RMAN> connect target /
RMAN> startup mount;
RMAN> restore database;

You’ll see several lines of output as RMAN tells you what it is restoring. It should look
something like the following:
Starting restore at 19-OCT-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to C:\ORA01\BRDSTN\SYSTEM01.DBF
restoring datafile 00002 to C:\ORA01\BRDSTN\UNDOTBS01.DBF
restoring datafile 00003 to C:\ORA01\BRDSTN\SYSAUX01.DBF
restoring datafile 00004 to C:\ORA01\BRDSTN\USERS01.DBF
Next recover your database as follows:
RMAN> recover database;
You should see a message similar to this:
Starting recover at 19-OCT-06
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:07
Finished recover at 19-OCT-06
You can now open your database for use with the alter database open command:

RMAN> alter database open;

Reinstating a Damaged Datafile from an Image Copy

RMAN> report schema;

RMAN> list copy of datafile 5;

Take the damaged datafile offline, if not offline already:

RMAN> sql 'alter database datafile 5 offline';

Now, instruct the database to make the copy of the file in the flash recovery area, the
production datafile:

RMAN> switch datafile 5 to copy;

RMAN> recover datafile 5;

Bring the recovered datafile online:

RMAN> sql 'alter database datafile 5 online';

Backing Up the FRA to Tape

RMAN> run {
2> allocate channel c1 type sbt_tape;
3> backup recovery area;
4> };

SQL> select sum(bytes)/1024/1024
2 from dba_data_files;

No hay comentarios: