Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continous Logical Log Backup 2

Status
Not open for further replies.

govmule

MIS
Dec 17, 2002
90
0
0
US
Hello,

We're running Informix Dynamic Server 7.3 on a Sun Box running Solaris 7. We have one instance and one pretty small proudction database.

I'm attempting to backup my logical logs to a dedicated 4MM dat tape continuously using ontape -c & (running in the background). My plan was to change the tape everyday to avoid running out of space.

Every morning when I change the tape the next time a log completes and a backup starts the backup just hangs. I then try to do a manual backup (ontape -a) but the system tells me a backup is running. I take the system offline and then bring it back online and then can do a manual backup.

I think my problem is running ontape -c in the background. I've read conflicting reports about this. Some say it's ok, others say you need a dedicated terminal, and still others recommend letting a script manage the whold affair.

Can anyone point me in the right direction. At the moment I'm backing up the logs to /dev/null which I really hait to do.

Thank you in advance,

Jack Luster
 
Hi Jack,

I run ontape -c, but not in the background, with no problems on an AIX box. The correct method to end continuous logging gracefully is by keying in a cntrl-C, don't know what the method would be on a Solaris box but I'm sure that it's something similar.

If you're running continuous logging in the background, you'll never be notified if a tape is full & to insert another unless you check the process manually. Too easy to forget to check & who has the time.

Also, if the process is running in the background I'm not sure cntrl-C (or something like it) can terminate continuous logging gracefully.

I'd stay away from running it in the background.

Good luck
 
jack, if you're still interested i can send you a script i wrote which archives the logs for you to disk (and also compresses them).
you can then back them up to tape in your own time.

the idea is you replace informix's log_full.sh script (rename it to log_full.sh.bac) with the one i'll send you.
anyway, let me know if it's still needed.
 
Hello Zag,

Yes I would love the script. It really would be a big help.

Thank you,

Jack
 
hi basshead,
sorry about the late response, i've been on hols for virtually the whole of august!
anyway the script is at work, however i'll be back to work on monday so i'll post it for you then.
cheers
 
Thanks ZAG that would be great. I appreciate it.

See ya,

Jack
 
hi sorry about the late response - here's the script:

obviously replace the variables with your own choices.

#!/bin/sh
export BACKDIR=/inf_archives/logs
[ -f ${BACKDIR}/log_full.running ] && exit 0
[ -z "$(ps -ef | grep oninit | grep -v grep)" ] && exit 0

exec 1>> ${BACKDIR}/logical.trc 2>&1 # create a trace file
touch ${BACKDIR}/log_full.running
set -x

PROG=`basename $0`
USER_LIST=informix
EXIT_STATUS=0
EVENT_SEVERITY=$1
EVENT_CLASS=$2
EVENT_MSG="$3"
EVENT_ADD_TEXT="$4"
EVENT_FILE="$5"

DAT=$(date '+%b%d_%H%M%S')

case "$EVENT_CLASS" in
23)
cat /dev/null > ${BACKDIR}/logical.log
ontape -a <<-END

N
END

EXIT_STATUS=$?

[ -s "${BACKDIR}/logical.log" ] &&
{
compress -c ${BACKDIR}/logical.log > \
${BACKDIR}/logical.$DAT.Z

cat /dev/null > ${BACKDIR}/logical.log
}
;;

# One program is shared by all event alarms. If this ever gets expanded to
# handle more than just archive events, uncomment the following:
*)
# EXIT_STATUS=1
;;
esac

rm ${BACKDIR}/log_full.running

exit $EXIT_STATUS
# end of script
 
oh by the way, don't forget these parameters in your onconfig file:

ALARMPROGRAM /users/informix/infdir/etc/log_full.sh
# Alarm program path

# Log Archive Tape Device
LTAPEDEV /inf_archives/logs/logical.log # Log tape device path
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top