RE: Which instances are configured?
Posted in 2000
The "onstat -g dis" command will show what Informix instances have been
configured and started. It may be obtaining its information from the
$INFORMIXDIR/etc/.conf.* files.
-----Original Message-----
From: Henderson, Scott [mailto:SHenderson@purolator.com]
Sent: Friday, October 20, 2000 17:48
To: 'informix-list@iiug.org'
Subject: RE: Which instanses are configured?
If you wanted to see what instances are on-line you could run ipcs -mo |
grep informix . This will provide you with the shared memory segments for
any active servers. Pay particular attention to 0x???? these will identify
the instance. 0x5256 + hex(servernum).
HTH
Scott
> ----------
> From: Rudy Fernandes[SMTP:rferdy@americasm01.nt.com]
> Reply To: Rudy Fernandes
> Sent: October 18, 2000 2:55 PM
> To: informix-list@iiug.org
> Subject: Re: Which instanses are configured?
>
> Here's a script which could help.
>
> #!/bin/ksh
> # rudy 29/8/97.
> # This script attempts to locate INFORMIX instances running on a machine.
> # The plan is as follows
> # 1. Locate INFORMIXDIR by identifying the file oninit and working
> backwords
> # 2. Locate ONCONFIG files by grepping $INFORMIXDIR/etc for keyword
> "ROOTNAME"
> # 3. Set environment variable appropriately for each INFORMIXDIR &
> ONCONFIG
> # and run onstat -c to get the instance information.
>
> if [ $# = 0 ]
> then
> echo Run `basename $0` with a directory. All subdirectories below will
> be searched
> echo For example : `basename $0` /opt
> exit 1
> fi
> SEARCHDIR=$1
> SUFFIX=$$
>
> CURRENTDIR=`pwd`
> echo Locating Informix software versions in $SEARCHDIR and its
> subdirectories...
> for INFORMIXDIR in `find $SEARCHDIR -name oninit -print 2>/dev/null | sed
> "s:\\(.*\\)\\(\\/bin.*\\):\\1:g"`
> do
> echo Found software in $INFORMIXDIR
> cd $INFORMIXDIR/etc
> for ONCONFIG in `grep -l "^ROOTNAME" *`
> do
> echo Examining Server configured in $ONCONFIG
> INFORMIXSERVER=`grep DBSERVERNAME $ONCONFIG | grep -v "^#" | awk> '{print $2'}`
> echo INFORMIXDIR=$INFORMIXDIR ONCONFIG=$ONCONFIG
> INFORMIXSERVER=$INFORMIXSERVER \\> > $CURRENTDIR/$ONCONFIG.$SUFFIX
> export INFORMIXDIR ONCONFIG INFORMIXSERVER
> onstat -c >> $CURRENTDIR/$ONCONFIG.$SUFFIX> done
> echo Output in files with suffix of $SUFFIX
> SUFFIX=`expr $SUFFIX + 1`
> done
>
> #### End #####
>
> Couple of drawbacks :
> 1. Can be slow if you have no clue on where your software resides.
> 2. Can give you duplicate information if "old" or "backup" onconfig files
> are floating around in $INFORMIXDIR/etc.
>
> Rudy
>
> c-eriks@algonet.se wrote:
>
> > Is there a way to query the DBMS which informix servers (instanses) are
> > configured in the server machine? One (work around) solution would be
> > to search the informix user's .profile with "grep" for 'INFORMIXSERVER'
> > and then test with "onstat -". Any other (more direct) solutions?
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>