Re: How to know the number of Informix Instances
Posted in 1999
On Fri, 26 Feb 1999, Mark D. Stock wrote:
>Jonathan Leffler wrote:
>> >From: sanjeev sagar <sanjeevsagar@yahoo.com>
>> >Date: Wed, 24 Feb 1999 11:49:13 -0800 (PST)
>> >
>> >onstat -g dis>> >
>> >will tell you all the instances running on the host.
>>
>> On my machine, running OnLine 7.24, IDS 7.30, IDS/UDO 9.14, I ran 'onstat
>> -g dis' with the environment set to the 9.14 instance, and it said:
>>
><SNIP>
>>
>> The conclusion I draw from this is that at most, "onstat -g dis" displays
>> the servers being run from the current INFORMIXDIR -- it clearly does not
>> display every OnLine instance on my machine. But my machine setup is not
>> all that common.
>
>This is not a valid assumption.
I assumed nothing; I merely observed the results on my machine. I also
made a conclusion based on my observations which turns out to be partially
inaccurate; see below.
>If I run this command I see multiple
>versions in multiple directories (INFORMIXDIR). MY assumption was that
>this info came from /INFORMIXTMP. The INFORMIXDIR values for example are
>stored in /INFORMIXTMP/.infxdirs. Instance details can them be found in
>the $INFORMIXDIR/etc/.conf* & $INFORMIXDIR/etc/.infos* files.
It is good to know that it works for you.
I don't do anything in /INFORMIXTMP, and none of my cron jobs do either.
On my machine, /INFORMIXTMP/.infxdirs contains:
/usr/informix/7.24.UC1
/usr/informix/7.30.UC1
/usr/informix/9.14.UC4
Those are all real directories; further, the sub-directories are real, too.
By that, I mean they are not symlinks to other places. The majority of the
files under those directories *are* symlinks; the exceptions are the onconfig
files and any files created by running OnLine (.infos, .conf, etc).
[...dead end thought process deleted...]
Let's see what truss says onstat is doing...
...I was running onstat -g dis as myself, not informix, not root. I just
reran it under truss, and since onstat is a SUID program, I had to be root
to be allowed to use truss on it. Lo and behold, there's the complete
output for all three servers. And, when I ran it again as user informix, I
also got all three servers listed. So, if you are running as a
sufficiently privileged user, 'onstat -g dis' finds all the (sufficiently
recent - 7.x and later?) servers that are running. If you're running as a
mere mortal, it only tells you about one server at a time, or maybe about
all the servers under your current INFORMIXDIR (I don't run multiple
servers out of a single INFORMIXDIR, so I haven't been able to distinguish
between these alternatives).
My observations were correct, but were not complete enough. As a
consequence, my conclusion was wrong. I don't understand why you have
to be a privileged user to get the full information, but that's the way
it seems to work. If you might have older versions of Informix on the
system, then you do need to fall back on the searching algorithms which
were suggested yesterday. Needless to say, 'onstat -g dis' is both
quicker and neater -- use it if you can.
Yours,
Jonathan Leffler (jleffler@informix.com) #include <wish/I/was/skiing.h>
Guardian of DBD::Informix v0.60 (v0.61_02) -- http://www.perl.com/CPAN
Informix IDN for D4GL & Linux -- http://www.informix.com/idn
INFORMIX-Universal Server Version 9.14.UC4 -- On-Line -- Up 9 days 21:52:26 -- 8864 Kbytes
There are 3 servers found
Server : osiris_23
Server Number : 23
Server Type : ODS
Server Status : Up
Server Version: INFORMIX-OnLine Version 7.24.UC1
Shared Memory : 0xa000000
INFORMIXDIR : /usr/informix/7.24.UC1
ONCONFIG : /usr/informix/7.24.UC1/etc/onconfig.osiris_23
SQLHOSTS : /usr/informix/7.24.UC1/etc/sqlhosts
Host : osiris
Server : osiris_29
Server Number : 29
Server Type : ODS
Server Status : Up
Server Version: Informix Dynamic Server Version 7.30.UC3
Shared Memory : 0xa000000
INFORMIXDIR : /usr/informix/7.30.UC1
ONCONFIG : /usr/informix/7.30.UC1/etc/onconfig.osiris_29
SQLHOSTS : /usr/informix/7.30.UC1/etc/sqlhosts
Host : osiris
Server : osiris_37
Server Number : 37
Server Type : ODS
Server Status : Up
Server Version: INFORMIX-Universal Server Version 9.14.UC4
Shared Memory : 0xa000000
INFORMIXDIR : /usr/informix/9.14.UC4
ONCONFIG : /usr/informix/9.14.UC4/etc/onconfig.osiris_37
SQLHOSTS : /usr/informix/9.14.UC4/etc/sqlhosts
Host : osiris