Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Question about BACKUP-script

Re: Question about BACKUP-script

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/04/07
Message-ID: <38EDC09D.47A2@yahoo.com>#1/1

Victor Oosterbaan wrote:
>
> Hi there !!
>
> I got a little question;
>
> My pruduction-server has been installed by another company, and i only
> started working with it since 3 months ago.. They also wrote a backup-script
> for oracle and unix. I have NO idea if it's a good backup it's doing, so
> could you smart guys look into this to see if it's O.K. ???
> Thanx !!!
>
> ViC
> The backup-script;
>
> #!/bin/sh
> #
> # /etc/do_backup - Make a backup
> #
> TMPLOG=/tmp/backup1.tmp
> TMP2LOG=/tmp/backup2.tmp
> BACKUPLOG=/usr/adm/backup.log
>
> cd /
> echo
> "===========================================================================
> " > $TMPLOG
> echo "==============[ STARTING BACKUP RUN ON: `date +'%a %d-%b-%y
> %H:%M'` ]==============" >> $TMPLOG
> echo
> "===========================================================================
> " >> $TMPLOG
>
> echo "------------------------------------------------------" >> $TMPLOG
> echo " ==> NOW STARTING ORACLE EXPORT" >> $TMPLOG
> su - oracle8 -c "exp system/manager FILE=/oracle/daily_export.dmp OWNER=edge
> > $TMP2LOG 2>&1"
> cat $TMP2LOG >> $TMPLOG
> echo " ==> FINISHED ORACLE EXPORT `date +'%a %d-%b-%y %H:%M'`" >>
> $TMPLOG
> echo "------------------------------------------------------" >> $TMPLOG
> echo " ==> NOW STARTING UNIX BACKUP" >> $TMPLOG
> tar cvf /dev/rmt0 . > /dev/null 2>> $TMPLOG
> echo " ==> FINISHED UNIX BACKUP `date +'%a %d-%b-%y %H:%M'`" >>
> $TMPLOG
>
> # Yep, device-files aren't backupped !
> #
> grep -v "0511-180" $TMPLOG >> $BACKUPLOG
> rm $TMPLOG
> rm $TMP2LOG
>
> # Eject the tape
> mt offline
> # Change backuplog owner
> chown edge:edge $BACKUPLOG
>
> # EOF
(I'll generalise a lot here to keep thing simple). There are pretty much three types of backup

1 - cold - shut the db, copy everything to tape
2 - hot, don't shut the db, copy everything to tape
3 - export - run 'exp' and copy the dmp file to tape

You have got (3) which I would say is probably the least effective (generally speaking). I'd recommend either (1) or (2) dependent on your recovery requirements.

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Fri Apr 07 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US