Full Database Backup Using NetBackup

BACKGROUND

This page provides an editable script that can be used to take a HOT backup to tape of the database using NetBackup.

ASSUMPTIONS & PRE-REQUISITES

  • The script assumes and expects the following:
    • The database has been configured to run in ARCHIVELOG mode;
    • The tape backup suite being used is NetBackup;
    • The $ORACLE_HOME/bin/libobk.so file has been configured to point to the NetBackup library;
    • The NetBackup policy has been configured to accept backup calls from the server hosting the database;
    • The control files are used to maintain the RMAN catalogue.

EXAMPLE SCRIPT


#!/bin/ksh
#
# Title :       database_backup_nbu.ksh
# Description : Backs up the database to tape via the NetBackup API.
#
# Copyright :   ABCdba.com 2010
#

export ORACLE_SID=<sid name>
export ORACLE_HOME=<full pathname to ORACLE_HOME>
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_DATE_FORMAT="DD-MON-YYYY:HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export DATE=`date '+%d%m%y_%H%M%S'`
export LOG=<full pathname to backup log directory>
export LOGFILE=${LOG}/rman_${ORACLE_SID}_tape_backup_db_${DATE}.log
$ORACLE_HOME/bin/rman log=$LOGFILE <<eof

connect target /;

run {
allocate channel ch1 type  'sbt_tape'  parms="ENV=(NB_ORA_CLASS=<NetBackup policy name>)" ;
allocate channel ch2 type  'sbt_tape'  parms="ENV=(NB_ORA_CLASS=<NetBackup policy name>)" ;
allocate channel ch3 type  'sbt_tape'  parms="ENV=(NB_ORA_CLASS=<NetBackup policy name>)" ;
allocate channel ch4 type  'sbt_tape'  parms="ENV=(NB_ORA_CLASS=<NetBackup policy name>)" ;
backup incremental level 0 filesperset 5 database format 'rman_${ORACLE_SID}_${DATE}_%U_%t' plus archivelog;
backup current controlfile format 'rman_${ORACLE_SID}_cntlfile_${DATE}.cf' ;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}

eof
exit

© copyright 2001-2014 ABCdba.com | all rights reserved