RMAN Scenarios

How to recover a system datafile ?
RMAN>run
{
shutdown immediate;
startup mount;
restore datafile 1;
recover datafile 1;
sql ‘alter database open’;
}
How to Recover a Sysaux Datafile ?

RMAN>run
{
sql ‘alter database datafile 2 offline’;
restore datafile 2;
recover datafile 2;
sql ‘alter database datafile 2 online’;
}
How  to recover a datafile  ?
RMAN>run
{
sql ‘alter tablespace slm offline’;
restore tablespace slm;
recover tablespace slm;
sql ‘alter tablespace slm online’;
}

How to recover a redolog files ?
RMAN>run
{
shutdown immediate;
startup mount;
set until scn 1234; or set until time “to_date(‘2011-01-05 11:30:00’,’YYYY-MM-DD hh24:mi:ss’)”;
recover database;
sql ‘alter database open resetlogs’;
}
How to recover a controlfiles ?
RMAN> run
{
shutdown immediate;
startup nomount;
restore controlfile from autobackup;
sql ‘alter database mount’;
recover database;
sql ‘alter database open resetlogs’;
}

No comments:

Post a Comment