Re: Informix Startup on HP-UX UNIX
Posted in 1997
>From: eric_r@iacorp.com
>Date: Mon, 17 Mar 1997 17:33:51 -0600
>X-Informix-List-Id: <news.35410>
>
>Hi, I am trying to add Informix to the startup/shutdown procedures for
>HP-UX 10.2. The DB is Informix DS for UNIX, Version 7.12.UC1. I already
>know how to add scripts so that they get executed at startup and shutdown.
> What I don't know is what shell script to execute, or the Informix
>commands within the shell, to startup or shutdown Informix. Any help, or
>sample scripts, would be appreciated. Thanks!!! :-) Eric Roseland
For my Solaris machine, I have a script in /etc/init.d which reads:
# Start-up and Shut-down script for Informix-OnLine 7.21.UC1 on Anubis
INFORMIXDIR=/usr/informix/7.21.UC1export INFORMIXDIR
PATH=$INFORMIXDIR/bin:$PATHexport PATH
INFORMIXSERVER=anubis_43export INFORMIXSERVER
INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhostsexport INFORMIXSQLHOSTS
ONCONFIG=onconfig.anubis.43export ONCONFIG
case "$1" in
start)
echo "Starting Informix-OnLine Dynamic Server ($INFORMIXSERVER)"
onstat -V
oninit || echo "*** FAILED TO START $INFORMIXSERVER ***"
;;
stop)
if onstat -p > /dev/null
then echo "Stopping Informix-OnLine Dynamic Server ($INFORMIXSERVER)"
onmode -ky || echo "*** FAILED TO STOP $INFORMIXSERVER ***"
else echo "Informix-OnLine Dynamic Server ($INFORMIXSERVER) not running"
fi
;;
*)
echo "Usage: $0 { start | stop }" 1>&2
exit 1
;;
esac
This is then linked to /etc/rc0.d/K30ods721UC1 /etc/rc2.d/S78ods721UC1
which, respectively, stop and start the database system on transition to
run state 0 (ready to reboot) and run state 2 (multi-user, but not NFS
server).
Note that for oninit (and many of the other OnLine control programs), you
do need ONCONFIG set; most normal uses (eg ESQL/C programs or ESQL/C-based
programs such as those in I4GL, NewEra, etc) do not.
This is a minor adaptation of a script I created to control two instances
of Informix-Universal Server; it works for that too. If you are using
OnLine 5.0x or earlier, then ONCONFIG, INFORMIXSERVER and INFORMIXSQLHOSTS
are not relevant, and you will need to set TBCONFIG instead, and you may
want to set SQLEXEC too. You also may need to worry about locale
information too -- being based in the USA means I don't have to worry about
that so much. However, I did find a bug B66593 with some versions of ODS
(6.00 and later) whereby if I start the OnLine system with DBDATE=dmy4/ in
the environment, this becomes the default value of DBDATE for users with no
explicit value of DBDATE in their environment (and not mdy4/ as
documented). B66593 doesn't seem to affect the 5.0x servers.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>