Oracle RMAN recovery script for EMC NetWorker

June 27, 2016 by Leave a comment 

In this article I’ll share an Oracle RMAN script to do restore and recovery an Oracle database from tape library using EMC NetWorker. Apply this RMAN template to different recovery situations you might have. Before looking into the RMAN script see my notes below:

– Read about Oracle Recovery Manager (RMAN) concepts
– Look at the corresponding RMAN backup script for NetWorker
– The recovery script should work for Oracle database 11g, 12c (maybe 10g)
Oracle database name = ORCL
– I use 2 RMAN channels to speed up the recovery of database
– Recovery of spfile and/or control file is optional and depends on your recovery situation
– PARMS section includes instructions for EMC NetWorker server (depends on Networker server configuration)
– Choose appropriate database recovery scenario (by default -> compete DB recovery; I commented 3 options for incomplete DB recovery scenario)
– This script is independent from RMAN configuration parameters

# Last update: 18-Mar-2015

# Restore database spfile (ONLY if required!)
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt_tape parms ‘ENV=(NSR_SERVER=nsrserver1,NSR_DATA_VOLUME_POOL=OracleProd,NSR_CLIENT=MyOracleHost,NSR_FXBUSY_RETRIES=10)’;
restore spfile to ‘/opt/oracle/oradata/ORCL/spfileORCL.ora’ from ‘c-3336676360-20160526-01’;
release channel c1;
}

# Restore all control files (ONLY if required!)
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt_tape parms ‘ENV=(NSR_SERVER=nsrserver1,NSR_DATA_VOLUME_POOL=OracleProd,NSR_CLIENT=MyOracleHost,NSR_FXBUSY_RETRIES=10)’;
restore controlfile;
release channel c1;
}

# Restore and recover database (3 options commented for incomplete recovery scenario -> ‘alter database open resetlogs’ required before opening the DB)
RUN
{
#SET UNTIL logseq 2652;
#SET UNTIL time “to_date(‘30.10.2013 22:00′,’dd.mm.yyyy hh24:mi’)”;
#SET UNTIL SCN 46352283
allocate channel c1 type ‘sbt_tape’ parms ‘ENV=(NSR_SERVER=nsrserver1,NSR_DATA_VOLUME_POOL=OracleDZDD01,NSR_CLIENT=MyOracleHost,NSR_FXBUSY_RETRIES=10)’;
allocate channel c2 type ‘sbt_tape’ parms ‘ENV=(NSR_SERVER=nsrserver1,NSR_DATA_VOLUME_POOL=OracleDZDD01,NSR_CLIENT=MyOracleHost,NSR_FXBUSY_RETRIES=10)’;
set autolocate off;
restore database;
recover database;
release channel c1;
release channel c2;
}

Enjoyed this article? Please share it with others using the social site of your choice:

Add a Comment

We welcome thoughtful and constructive comments from readers.
If you want your own picture to show with your comment?
Go get a Globally Recognized Avatar!

DBMS Blog Updates : Subscribe RSS RSS: Subscribe to Articles · Subscribe to Comments Subscribe RSS Receive site updates via email