Veritas-bu

[Veritas-bu] Manual DB backup script via cron

2004-12-07 08:37:21
Subject: [Veritas-bu] Manual DB backup script via cron
From: ckstehman AT pepco DOT com (ckstehman AT pepco DOT com)
Date: Tue, 7 Dec 2004 08:37:21 -0500
I believe you can create a policy with a "User backup" schedule, and create
a script that calls such as:

=========================================================================
#!/usr/bin/sh
# This script alters all the tablespaces in the EBP database
# to backup mode then calls the utility "bpbackup" to backup the oracle
# database files, when this is complete it resets all the tablespaces
# to end backup mode and exits.
#

datepar=`date +%m%d%y`
OUTF=/oracle/EBP/817_64/scripts/db_backuplogs/${datepar}db_backup.out

{ # output block
echo "`date` +++++++ Begin script ++++++++++"
echo "`date` ------- Put tablespaces in backup mode"
rm -f /oracle/EBP/sapbackup/backupcontrolfile
su - oraebp -c /oracle/EBP/817_64/scripts/ebp_beginbackup
echo " Tablespaces are in backup mode."
echo "`date` ======= Starting Backup"
BPPATH=/usr/openv/netbackup/bin
export BPPATH
${BPPATH}/bpbackup -c EP-WPP-BS01_SAP_EBP_HOT -s EBP_hot_DB \
 -S bsmaster -L
/oracle/EBP/817_64/scripts/db_backuplogs/db_hotbackup.$datepar -w \
-f /oracle/EBP/817_64/scripts/database_files

echo "`date` ======= Backup Complete - ending backup mode"
su - oraebp -c /oracle/EBP/817_64/scripts/ebp_endbackup
echo "`date` ---  Backing up the Archive logs."
echo "  "
${BPPATH}/bpbackup -c EP-WPP-BS02_SAP_EBP_ARCHIVELOG -s EBP_ARCHIVE-Backup
\
 -S bsmaster -L
/oracle/EBP/817_64/scripts/db_backuplogs/db_archivelogbackup.$datepar -w \
-f /oracle/EBP/817_64/scripts/archivelog_files
echo "`date` -------- Archive log backup complete."
echo "  "
echo "`date` ++++++++ End of script-++++"
} >> $OUTF
# end of procedure
~

========================================================================
This script does a hot backup.  It puts the tables in backup mode, rund
bpbackup and takes the tables
out backup mode.  This same process can be used for a cold backup.  Just
have the script do a shutdown
of the database, run the backup and restart the database.  Note that the
call to bpbackup references
a file that contains the list of files to be backed up. See the manual for
the call to bpbackup.

This script is called from cron.  When veritas detects the backup it is
queued and run when resources are
abailablle.  Be sure your schedule times are 7/24
Hope this helps

Carl
=============================
Carl Stehman
PHI Services Company
202-331-6619
Pager 301-765-2703
ckstehman AT pepco DOT com


                                                                           
             "Lewick, Taylor"                                              
             <tlewick@hrblock.                                             
             com>                                                       To 
             Sent by:                  <veritas-bu AT mailman.eng.auburn DOT 
edu> 
             veritas-bu-admin@                                          cc 
             mailman.eng.aubur                                             
             n.edu                                                 Subject 
                                       [Veritas-bu] Manual DB backup       
                                       script via cron                     
             12/06/2004 11:37                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           




Here is a problem we are having with NetBackup 4.5

We have a DB backup run after our vault sessions, and then we have
operators manually run another one later in the day after all of the
backups have finished.  This is on weekdays...

On weekends, we are currently not vaulting, and if you try and manually
kick off a DB backup when there are backup jobs going, it never runs.
And on weekends there may not be an open window to run one until mid
Sunday afternoon.

I was wondering if I could kick off a DB backup manually using command
line syntax in a script called via cron.  If there are backup jobs
running, would the command line version force it to kick off?

Anyone know?

Thanks,
Taylor

_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu




This Email message and any attachment may contain information that is
proprietary, legally privileged, confidential and/or subject to copyright
belonging to Pepco Holdings, Inc. or its affiliates ("PHI").  This Email is
intended solely for the use of the person(s) to which it is addressed.  If
you are not an intended recipient, or the employee or agent responsible for
delivery of this Email to the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying of this Email is
strictly prohibited.  If you have received this message in error, please
immediately notify the sender and permanently delete this Email and any
copies.  PHI policies expressly prohibit employees from making defamatory
or offensive statements and infringing any copyright or any other legal
right by Email communication.  PHI will not accept any liability in respect
of such communications.


<Prev in Thread] Current Thread [Next in Thread>