0% found this document useful (0 votes)
48 views2 pages

DB Restore Preview - Tape - Identification

The document provides examples of RMAN scripts for previewing restores in Oracle databases including restoring datafiles and archived logs. It shows how to preview restore requirements, restore to a point in time, restore a specific datafile, and backup, list, and restore archived logs.

Uploaded by

Kranthi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

DB Restore Preview - Tape - Identification

The document provides examples of RMAN scripts for previewing restores in Oracle databases including restoring datafiles and archived logs. It shows how to preview restore requirements, restore to a point in time, restore a specific datafile, and backup, list, and restore archived logs.

Uploaded by

Kranthi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

For 10g or 11g, the easiest way is to run a �restore database preview;� from rman.

It lists exactly what would be needed for a restore.


A script would look something like this�

run {
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=amrgros035.pfizer.com)�;
restore database preview;
release channel t1;}

..for point in time

run {
set until time "to_date('2011 Jun 19 09:00','yyyy mon dd hh24:mi')";
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=amrndhs256.pfizer.com)�;
restore database preview;
release channel t1;
}

The output from the above commands is pretty verbose. Best to pipe it to a log file
and grep out �Media� to get the tapes you want.

... to restore particular datafile

run
{
set until time "to_date('05-JUN-2011 23:59:59','DD-MON-YYYY HH24:MI:SS')";
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=amrndhs256.pfizer.com)';
restore datafile 1 preview;
release channel t1;
}

(time will be the timestamp timm where u need the rscovery)

Now, to restore/recover the datafile,

run {
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=amrndhs009.pfizer.com)';
restore datafile 51;
recover datafile 51;
sql " alter database datafile 51 online";
}

@@@@@@@@@@@@@@@@@@@@@@@@@@@

backup :
=======

rman> run {
2> allocate channel c1 type disk;
3> backup
4> format '<>'
5> (archivelog all delete input);
6> release channel c1;
7> }

list :
======

rman > list backup of archivelog from time 'sysdate -1';

restore:
=======

rman> run {
2> allocate channel c1 type disk;
3> restore (archivelog low logseq <> high logseq <> thread 1 all);
4> release channel c1;
5> }

You might also like