Re: Q: What instances have I?
Posted in 1997
In article <860693229.16150@dejanews.com>, science@raptor.cqi.com wrote:
>How does one find information about various instances that exist on one's
>machine? Specifically, say you go up to a new (to you) machine and want
>to answer the question, "What are my instances, and what are their
>configurations?" I'm having a little problem with this.
>
>For example, one can set the INFORMIXSERVER variable, then run "onstat
>-c", but if the ONCONFIG variable is not set, it always gives the contents
>of $INFORMIXDIR/etc/onconfig. If you set the ONCONFIG variable to
>something that does not correspond to the true configuration file
>associated with the INFORMIXSERVER setting, onstat will duly give you the
>information associated with the ONCONFIG setting. And one can't rely on
>using, say, "grep '^DBSERVERNAME' $INFORMIXDIR/etc/* | grep
>$INFORMIXSERVER" because several files like this might exist in that
>directory.
>
>Also, the instance files in $INFORMIXDIR/etc/.infos.* don't appear to be
>guaranteed accurate, either. These could be wiped out (the DBA Guide,
>vol. 2 tells how to regenerate *one* for a given INFORMIXSERVER), and the
>documentation also says that when an instance is taken offline, this file
>is removed.
>
>Please reply to the group or via e-mail. Thanks.
Hi Charlie,
Using $INFORMIXDIR/etc/sqlhosts as a starting point, one can identify
the possible servers on the machine. Then, working with the fact
that onmonitor uses shared memory information (as far as possible)
to output information under the 'configuration' option, you could
be able to get some of the info you are looking for.
The following shell script should help (v 7.20)
:
for SERVER in `cat $INFORMIXDIR/etc/sqlhosts | grep -v '^#" \\
awk '{print $1}'
do
INFORMIXSERVER=$SERVER; export INFORMIXSERVER clear; echo "Working with $SERVER"; sleep 1
onmonitor # Now, use "Configuration" option to get info.
done
Note that information not available in shared memory structures is
not reported correctly. Examples are
LOGFILES, TAPEDEV, LTAPEDEV, SERVERNUM, SHMVIRTSIZE, CKPTINTVL
HTH
----------------------
Rudy Fernandes
GIC, Kuwait
OL 7.20, 4Gl 6.04
----------------------