RE: IDS 7.31: Backing up logical logs to disk
Posted in 2000
I use the ALARMPROGRAM to trigger backup of a log, via script "log_full.sh",
every time a log fills up. The 'ontape -a' is actually executed within a
script that is called by log_full.sh. If you capture the std out of the
'ontape -a' to a file, say logical.out, then you can get the log number(s)
from that output, and even incorporate that (those) into the new name of the
log backup file. For example:
##====================== BEGIN CODE SAMPLE ======================##
#
# Perform "automatic" backup of logical logs...
#
ontape -a << !EOF! > logical.out 2>&1
n
!EOF!
exitsts=$?
cat logical.out >> $MSGFILE
if [[ $exitsts != 0 ]] then
echo "ERROR -- exit status = ${exitsts} from 'ontape -a' cmd" >> $MSGFILE
cat $MSGFILE | mailx -m -s ">>> $HOST LOGICAL-LOG BACKUP FAILED! <<<"
infxdbas
cat $MSGFILE >> $LOGFILE
exit $exitsts
fi
#
# rename backup with current date and log number(s)...
#
BLOG=`egrep "^ " logical.out | head -1 | awk '{print $1}'`
ELOG=`egrep "^ " logical.out | head -1 | awk '{print $3}'`
newname=$LOGBKUPFILEDIRP/logbackup.${LOGBKUPDATE}.$BLOG
if [[ -n $ELOG ]] then
newname=${newname}-$ELOG
fi
mv $LOGBKUPFILE $newname
#
# re-create empty backup file...
#
> $LOGBKUPFILE
chmod 664 $LOGBKUPFILE
chgrp informix $LOGBKUPFILE
#
# compress renamed backup file (this is optional)...
#
compress $newname &
##====================== END CODE SAMPLE ======================##
HTH,
Paul Mosser
-----Original Message-----
From: Martin, Wayne E. [mailto:WMartin@kmart.com]
Sent: Wednesday, May 10, 2000 9:55 AM
To: 'richard.spitz@ana.med.uni-muenchen.de'; informix-list@iiug.org
Subject: RE: IDS 7.31: Backing up logical logs to disk
We set up a cron job to execute every 1/2 hour and do a logical
log back up. Of course there is a window for failure of 30 min.
and we have accepted this risk. Plus make sure there are log's
available.
Wayne E. Martin
Informix Database Administrator
Kmart Corp.
Sent: Wednesday, May 10, 2000 8:54 AM
To: informix-list@iiug.org
Subject: IDS 7.31: Backing up logical logs to disk
Hi Informixers,
currently I'm using onbar and Legato Networker to backup IDS 7.31
logical logs to tape. This works just great, however I'm afraid that
this puts too much strain on my tapes and tape drives.
My jukebox has only two Exabyte 8mm 5/10GB drives (I know, REALLY old,
but newer equipment is not in our budget), so I cannot reserve one
drive exclusively to log backup. Since there is a lot of backup
activity especially during nighttime, the tape where the logs go
to is frequently unloaded to make room for other backups. When a
log becomes full, it is then reloaded and has to be repositioned.
I use rather small logical log files (1MB), and they become full and
have to be backed up to reuse them about 5-10 times daily during
normal database activity. I am afraid that the resulting tape un- and
reloading and frequent repositioning may be harmful to my tapes and
drives.
One alternative would be to backup the logs to disk and have the
resulting files backed up with the normal daily filesystem backup.
I tried this on another system by setting the LTAPEDEV parameter
in onconfig to a filesystem file and editing the "log_full.sh"
script to use "ontape -a" as backup command. This works, but the
filesystem file is overwritten every time a log becomes full.
Of course I could copy this file away every time it gets written,
but how do I know which log number it contains? Does anyone have
a better solution for this?
BTW: I chose to use a rather small log size so the logs will get
backed up more frequently. Are there any important reasons for not
doing so?
Regards, Richard
--
+--------------------------+------------------------------------------+
| Dr. med Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de |
| EDV-Gruppe Anaesthesie | Tel : +49-89-7095-6110 |
| Klinikum Grosshadern | FAX : +49-89-7095-6420 |
| 81366 Munich, Germany | GSM : +49-172-8933578 |
+--------------------------+------------------------------------------+