RE: Off -Topic - Netbackup Command Help -Solved

From: freek D'Hooge <freek.dhooge_at_uptime.be>
Date: Wed, 25 Jun 2008 09:11:46 +0200
Message-ID: <000001c8d692$bcda94f0$0b02a8c0@iconos.be>


Frank,

In a netbackup policy you must have at least 2 different schedules for an oracle backup: 1 schedule that will determine when to take a backup and 1 default application backup (which will be used by rman when opening a channel).
In your backup script (called by the policy) you can then use the rman send command to inform netbackup which client, policy and application schedule should be used for this backup (you can use the variables passed from netbackup to the script to determine the values to be used).

If you want to have different schedules in your policy (eg daily, weekly, monthly) each with different retention policies, you must have separate application schedules as well.
In your backup script you then have to trap the passed $NB_ORA_PC_SCHED variable and use its value to set the NB_ORA_SCHED, which is passed back to netbackup via the rman send command
(I so agree with Jarid that linking a script with a schedule would be easier then linking it with the policy).

For example:

if [ "$NB_ORA_PC_SCHED " = "daily_backup" ] then

        NB_ORA_SCHED ="app_daily_backpu" elif [ "$NB_ORA_PC_SCHED " = "weekly_backup" ] then

        NB_ORA_SCHED ="app_weekly_backup" fi

….

CMD_STR="
$RMAN target $TARGET_CONNECT_STR nocatalog msglog $RMAN_LOG_FILE append << EOF RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';

send 'NB_ORA_CLIENT=oraserv1';
send 'NB_ORA_POLICY=$NB_ORA_POLICY';
send 'NB_ORA_SCHED=$NB_ORA_SCHED';

# backup the database + the archivelog
BACKUP
    $BACKUP_TYPE
    TAG hot_$TAG_SUFFIX
    FORMAT '%U'
    DATABASE plus archivelog delete all input; RELEASE CHANNEL ch00;
}
EOF
"

if [ "$CUSER" = "root" ]
then

    su - $ORACLE_USER -c "$CMD_STR" >> $RMAN_LOG_FILE     RSTAT=$?
else

    /usr/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE     RSTAT=$?
fi
 

regards,

Freek D'Hooge
Uptime
Oracle Database Administrator
email: freek.dhooge_at_uptime.be
tel +32(0)3 451 23 82
http://www.uptime.be
disclaimer

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 25 2008 - 02:11:46 CDT

Original text of this message