Archive Log Backup Using NetBackup

BACKGROUND

This page provides an editable script that can be used to backup to tape all achive logs and then remove the logs from the LOG_ARCHIVE_DEST 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 :       archive_log_backup.ksh
# Description : Backs up archive logs 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 format 'rman_${ORACLE_SID}_${DATE}_%U_%t' archivelog all delete input;

release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}

eof
exit

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