Thanks everyone.
I've now got NetBackup scheduling (with proper retentions) working for
Oracle by adding this in the middle of the RMAN script:
****<begin code>*******
# NB_ORA_PC_SCHED is the name of the AUTO schedule.
# NB_ORA_SCHED is the name of the APP schedule.
echo "NB_ORA_PC_SCHED: $NB_ORA_PC_SCHED" >> $RMAN_LOG_FILE
# Based on the name of the Policy and "Auto" schedule,
# choose the "App" schedule.
if [ "$NB_ORA_POLICY" = "Oracle" ] ; then
if [ $NB_ORA_PC_SCHED = "Auto_diff_daily" ] ; then
NB_ORA_SCHED="App_diff_daily"
elif [ $NB_ORA_PC_SCHED = "Auto_full_weekly" ] ; then
NB_ORA_SCHED="App_full_weekly"
elif [ $NB_ORA_PC_SCHED = "Auto_full_monthly" ] ; then
NB_ORA_SCHED="App_full_monthly"
elif [ $NB_ORA_PC_SCHED = "Auto_full_yearly" ] ; then
NB_ORA_SCHED="App_full_yearly"
else
NB_ORA_SCHED="App_full_default"
fi
fi
echo "NB_ORA_SCHED: $NB_ORA_SCHED" >> $RMAN_LOG_FILE
******<end code>******
... and this line inbetween "ALLOCATE ..." and "BACKUP" in the actual
command that gets sent to RMAN:
SEND 'NB_ORA_SCHED=$NB_ORA_SCHED';
I've tested it and the correct "App" schedule is chosen every time and
I don't have to mess around with start windows, multiple policies
and/or exclude dates.
Any Idea about how to do the same thing for MS-SQL backups?
Thanks,
Austin Murphy
> -----Original Message-----
> From: Donaldson, Mark - Broomfield, CO
> Sent: Thursday, January 19, 2006 1:39 PM
> To: 'Austin Murphy'; veritas-bu AT mailman.eng.auburn DOT edu
> Subject: RE: [Veritas-bu] Database backup scheduling with different
> retent ions
>
>
> Our DBA's determine in their RMAN script which type of backup they want,
> incr, full, etc. This do this themselves based on day of week (fulls on
> weekends, etc.). They have a case statement & just set the NB_ORA_SCHED
> variable appropriately.
>
> If you want to do this via Netbackup's scheduling, then I think you could do
> this with a single policy with three "trigger" (Automatic Full Backup)
> schedules (these call the rman backup script). Each trigger schedule gets a
> unique schedule, frequency, etc., or course.
>
> The trigger schedule name is passed into the RMAN script as the
> NB_ORA_PC_SCHED variable, no need to mine logfiles to find it.
>
> So, your RMAN code would contain:
>
> case $NB_ORA_PC_SCHED in
> schedname1 ) NB_ORA_SCHED="Monthly" ;;
> schedname2 ) NB_ORA_SCHED="Yearly" ;;
> schedname3 ) NB_ORA_SCHED="Daily" ;;
> esac
>
> Of course, change the above to fit your environment but the logic is
> probably useful. The policy name is sent into the script using the
> NB_ORA_POLICY variable, by the way, so there's no need to set this.
>
> The variable list from my test is:
> NB_ORA_CINC=0
> NB_ORA_CLASS=<policy name>
> NB_ORA_CLIENT=<client name>
> NB_ORA_FULL=1
> NB_ORA_INCR=0
> NB_ORA_MODE=B
> NB_ORA_PC_SCHED=<trigger schedule name>
> NB_ORA_POLICY=<policy name>
> NB_ORA_SCHEDULED=1
> NB_ORA_SERV=<master server name>
>
> The NB_ORA_CINC & NB_ORA_INCR seems strange - there's no current
> full/diff/cumu setting in the trigger schedule's setup. Perhaps this is for
> future use?
>
> Just build a policy with three "Automatic Full Backup" schedules to call
> your script and three different "Application Backup" schedules to receive
> the data and you're set.
>
> HTH - M
|