Re: Informix Backups
Posted in 1998
Topics: Backup & Restore, Server Administration
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---1607792580-143302914-895764591=:27637
Content-Type: TEXT/PLAIN; charset=US-ASCII
Here is an ontape script that I give to our operators. It allows them to
set the archive level and change the tape drive. It adjusts the tape size
parameters to match the selected drive (or administration standard is that
devices 4c and 7c represent an array of 5 DLT4000 drives with a a combined
capacity of about 120GB compressed and other devices are older arrays of 7
4GB DAT drives with combined capacity, compressed, of 16GB. The KSH
script uses awk to modify the ONCONFIG file. Also there is a feature to
automatically change the logging status of a database. If the file
~informix/AddLogs exists it contains a list of databases which are to be
modified to Unbuffered Logging status. If the file ~informix/DropLogs
exists it contains a list of databases to be set to Unlogged status.
In this way the operators are free to use whatever sets of drives are free
(we share the drives with the system archives) and need not know about the
ONCONFIG file and need not manually modify it. In addition I can control
logging status by creating the database list files, as appropriate, and
the operators just run their normally scheduled archives (or any
specially scheduled archives that I need performed) without the hassle of
having to remember to do anything different than usual.
Art S. Kagel, kagel@bloomberg.com
---1607792580-143302914-895764591=:27637
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=fb7
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.D-G.3.96.980521112951.27637B@dg1>
Content-Description:
#! /usr/bin/ksh
date
. informix.7.0
drv=`egrep '^TAPEDEV' $INFORMIXDIR/etc/$ONCONFIG`
drv=${drv##*/}
drv=${drv%%#*}
drv=${drv%%[ ]*}
echo
read ndrv?"Enter drive on which tapes are mounted (1c,2c,4c,7c)(default: ${drv}): "
if [[ -z $ndrv ]]; then ndrv=${drv}; fi
if [[ $ndrv != $drv ]]
then
cp -p $INFORMIXDIR/etc/$ONCONFIG $INFORMIXDIR/etc/$ONCONFIG.prev
if [[ $ndrv = 4c || $ndrv = 7c ]]; then
echo "/^TAPEDEV/{sub(\\$2,\\"/dev/rmt/$ndrv\\",\\$0);}/^TAPESIZE/{sub(\\$2,\\"120000000\\",\\$0);}{print \\$0;}" >/tmp/fb$$.awk
elif [[ $ndrv = null ]]; then
echo "/^TAPEDEV/{sub(\\$2,\\"/dev/$ndrv\\",\\$0);}/^TAPESIZE/{sub(\\$2,\\"120000000\\",\\$0);}{print \\$0;}" >/tmp/fb$$.awk
else
echo "/^TAPEDEV/{sub(\\$2,\\"/dev/rmt/$ndrv\\",\\$0);}/^TAPESIZE/{sub(\\$2,\\"16000000\\",\\$0);}{print \\$0;}" >/tmp/fb$$.awk
fi
awk -f /tmp/fb$$.awk $INFORMIXDIR/etc/$ONCONFIG >$INFORMIXDIR/etc/$ONCONFIG.new
rm /tmp/fb$$.awk
mv $INFORMIXDIR/etc/$ONCONFIG.prev $INFORMIXDIR/etc/$ONCONFIG.last
mv $INFORMIXDIR/etc/$ONCONFIG.new $INFORMIXDIR/etc/$ONCONFIG
fi
read level?"Enter Archive level (0/1/2)(default: 0): "
if [[ -z $level ]]; then level=0; fi
ans=no
if [[ $level -eq 0 && (-f ~informix/AddLogs || -f ~informix/DropLogs) ]]; then
echo Changes to the logging status of one or more databases is requested.
echo Need to bring Informix to QUIESCENT MODE to set database logging.
echo This will kill all processes attached to Informix.
echo
read ans?'Do you want to set database logging status as requested?'
if [[ $ans = [yY]* ]]; then
echo Defering Logging Status changes to next Archive!
fi
fi
if [[ $ans = [yY]* ]]; then
echo Bringing Engine to QUIESCENT mode. Mark `uname -n` off.
echo Dbdwn and rstrt the Bloomberg environment after archive finishes.
LogDBs=""
if [[ $level -eq 0 && -f ~informix/AddLogs ]]; then
LogDBs=${LogDBs} -U
for db in `cat ~informix/AddLogs`; do
LogDBs="$LogDBs $db"
done
mv ~informix/AddLogs ~informix/AddLogs.done
touch AddLogs.done
fi
if [[ $level -eq 0 && -f ~informix/DropLogs ]]; then
LogDBs=${LogDBs} -N
for db in `cat ~informix/DropLogs`; do
LogDBs="$LogDBs $db"
done
mv ~informix/DropLogs ~informix/DropLogs.done
touch DropLogs.done
fi
onmode -uy
onmode -c
mt -f /dev/rmt/${ndrv} rewind
echo ontape -s -L ${level} $LogDBs
ontape -s -L ${level} $LogDBs
echo Archive complete. Bringing Informix back to ONLINE mode.
onmode -my
echo Informix is back ONLINE. You may rstrt the Bloomberg environment.
else
mt -f /dev/rmt/${ndrv} rewind
echo ontape -s -L ${level}
ontape -s -L ${level}
fi
date
---1607792580-143302914-895764591=:27637--