Newsgroups: comp.databases.oracle
Subject: backups
From: tumidity@netlink.cts.com (Joel Garry)
Date: Tue, 17 Nov 92 16:53:53 PST
Organization: NetLink Online Communications, San Diego CA

Somebody (sorry, can't find the posting) recently asked for backup 
procedures.  We recently aquired a tape drive that can actually hold
all of our current disk contents.  I have implemented the following
as a cron program (on a Sun Sparc 2, Solaris/SunOS 4.1.3).  We have
no users on at night.  Ignore Unify and DBPATH references.  Does anybody
think this is a bad thing (not bringing the system down, I mean)?  
Should I include shutdown/startup commands for oracle?  Or does someone
know a procedure to bring the system to single user and then back up
controlled by cron (like, is it safe to have shutdown -r in a cron file?)  
Send comments to:
tumidity@netlink.cts.com
Thanks!
------------------------------------ cut here ------------------------------
:
# @(#) dumpall - Dump all the filesystems onto a single 8 mm tape.
# by J. Garry 11/13/92.
#
# To restore a particular filesystem (files): 
#
# mt -f /dev/nrst0 asf x 
# where x is how many systems you want to skip.  Then do a normal restore.
#
# cd (proper partition)
# restore if /dev/nrst0
#
# for example, to restore the entire /home (/dev/sd1h) filesystem:
#
# mt -f /dev/nrst0 asf 2
# cd /home
# restore rvf /dev/nrst0
#
/usr/bin/df
dump 0dsbfu 54000 6000 126 /dev/nrst0 /dev/sd1a
dump 0dsbfu 54000 6000 126 /dev/nrst0 /dev/sd1g
dump 0dsbfu 54000 6000 126 /dev/nrst0 /dev/sd1h
dump 0dsbfu 54000 6000 126 /dev/nrst0 /dev/sd2g
dump 0dsbfu 54000 6000 126 /dev/nrst0 /dev/sd3g
mt -f /dev/rst0 rew
------------------------------------- cut here -----------------------------
:
# @(#) backup_progs - cron control file for dumping entire system to 8mm tape.
#
# Leave Top Line Null; so csh knows to pass this script to sh.
#
PATH=:/etc:/usr/bin:/usr/hosts:/usr/local/bin
TAPE=/dev/rst0
DBPATH=/usr2/cpen/bin
export TAPE PATH DBPATH
#
#
ADM=/usr/adm
ERR_FILE=$ADM/backup_err
#
set `date | tr '[a-z]' '[A-Z]'`
CURRDA=$1
CURRMO=$2
CURRDD=$3
CURRYR=$6
CURRYY=`echo $6 | cut -c3-4`
#
#
   echo 'running backup program - Sun4'
   date
   if [ $CURRDA = THU ]
   then
      mv $ADM/backup_out $ADM/backup_out_archive
   fi
   if [ $CURRDA = FRI ] 
   then
      mv $ERR_FILE $ADM/backup_err_archive
   fi
   echo 'running backup program - Sun4'             >> $ERR_FILE
   date                                             >> $ERR_FILE
   cd /
   lock.unify
   pwd
#
# Daily dump of all files.
   if [ $CURRDA = SAT -o $CURRDA = MON -o $CURRDA = TUE -o $CURRDA = WED \
                      -o $CURRDA = THU -o $CURRDA = FRI ]
   then
      date
      echo  'Perform daily backup'
      echo  'Perform daily backup'                >> $ERR_FILE
      /usr/local/bin/dumpall                     2>> $ERR_FILE
      echo 'dump completed of all files'
      echo 'dump completed of all files'          >> $ERR_FILE
   fi
date
date                                              >> $ERR_FILE
#
   unlock.unify
#
#
#
 echo ''
 echo 'Started on ' $CURRDA $CURRMO $CURRDD
 date
 echo 'all done for tonight'
 echo ''
 echo ''


--                    
INTERNET:  tumidity@netlink.cts.com (Joel Garry)
UUCP:   ...!ryptyde!netlink!tumidity
NetLink Online Communications * Public Access in San Diego, CA (619) 453-1115
Newsgroups: comp.databases.oracle