ownership of system processes
Posted in 2017
Mary had a script that kills user sessions before a dbexport, filtering on sid>99, username <> 'informix' and is_incrit=0, but real users sometimes got session IDs below 100. She asked whether dropping the sid filter could kill needed system sessions. Art Kagel confirmed all internal/server sessions are owned by informix (and are effectively immortal), so it's safe; Paul Watson noted non-root installs are an exception and David mentioned onbar sessions can show as root on UNIX, suggesting filtering on the state column instead. Andreas Legner suggested targeting only sessions with the database open via sysopendb; the is_incrit filter was explained as legacy protection against crashing the engine when killing sessions in a critical section. Art also offered his myexport utility, which doesn't need an exclusive database lock.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Migration, Import/Export & Data Conversion
Although this may seem like a foolish question, I would like to verify that
all system processes are run by user informix. Here is the reason: We have a
script that logs off regular users prior to doing a dbexport. Here is the
query it uses:
database sysmaster;
unload to "c:\\\\batch\\\\logoffinfmxusers.txt"
select "onmode -z "||sid||" " from syssessions
where sid>99 and username <> "informix"
and is_incrit=0
Our problem is that some regular users get a session ID < 100. We would like
to remove the sid from the where clause, and just use 'where username <>
"informix" and is_incrit=0', but I want to make sure that will not kill any
necessary processes.
Thanks.
You should be good. All server internal sessions are owned by informix (and
are actually immortal). Although some secondary server sessions can be
killed, they are all owned by informix as well.
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Fri, Jul 7, 2017 at 6:51 PM, MARY GREEN <mgreen@flyravn.com> wrote:
> Although this may seem like a foolish question, I would like to verify that
> all system processes are run by user informix. Here is the reason: We have
> a
> script that logs off regular users prior to doing a dbexport. Here is the
> query it uses:
>
> database sysmaster;>
> unload to "c:\\\\batch\\\\logoffinfmxusers.txt">
> select "onmode -z "||sid||" " from syssessions
>
> where sid>99 and username <> "informix"
>
> and is_incrit=0
>
> Our problem is that some regular users get a session ID < 100. We would
> like
> to remove the sid from the where clause, and just use 'where username <>
> "informix" and is_incrit=0', but I want to make sure that will not kill any
> necessary processes.
>
> Thanks.
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
On UNIX I have seen some onbar sessions audited as user root.
Not sure who they would run as on windows, presumably whoever owns the process.
You could also exclude based on the state column in syssessions
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.adref.doc/i
ds_adr_0255.htm
e.g. "Special daemon"/"Archiving"/"Clean up dead processes"/"Special
buffer-flushing thread"/"B-tree cleaner thread".
Regards,
David.
> On 08 July 2017 at 00:51 MARY GREEN <mgreen@flyravn.com> wrote:
>
>
> Although this may seem like a foolish question, I would like to verify that
> all system processes are run by user informix. Here is the reason: We have a
> script that logs off regular users prior to doing a dbexport. Here is the
> query it uses:
>
> database sysmaster;>
> unload to "c:\\\\batch\\\\logoffinfmxusers.txt">
> select "onmode -z "||sid||" " from syssessions
>
> where sid>99 and username <> "informix"
>
> and is_incrit=0
>
> Our problem is that some regular users get a session ID < 100. We would like
> to remove the sid from the where clause, and just use 'where username <>
> "informix" and is_incrit=0', but I want to make sure that will not kill any
> necessary processes.
>
> Thanks.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
Are there any other states that would indicate an onbar process?
Unless you are running a non-root install ....
Paul Watson
Oninit www.oninit.com
+1 913 387 7529
Oninit® is a Registered Trademark of Oninit LLC
> On Jul 7, 2017, at 18:58, Art Kagel <art.kagel@gmail.com> wrote:
>
> You should be good. All server internal sessions are owned by informix (and
> are actually immortal). Although some secondary server sessions can be
> killed, they are all owned by informix as well.
>
> Art S. Kagel, President and Principal Consultant
> ASK Database Management
> www.askdbmgt.com
>
> Blog: http://informix-myview.blogspot.com/
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
> and do not reflect on the IIUG, nor any other organization with which I am
> associated either explicitly, implicitly, or by inference. Neither do
> those opinions reflect those of other individuals affiliated with any
> entity with which I am affiliated nor those of the entities themselves.
>
>> On Fri, Jul 7, 2017 at 6:51 PM, MARY GREEN <mgreen@flyravn.com> wrote:
>>
>> Although this may seem like a foolish question, I would like to verify that
>> all system processes are run by user informix. Here is the reason: We have
>> a
>> script that logs off regular users prior to doing a dbexport. Here is the
>> query it uses:
>>
>> database sysmaster;>>
>> unload to "c:\\\\batch\\\\logoffinfmxusers.txt">>
>> select "onmode -z "||sid||" " from syssessions
>>
>> where sid>99 and username <> "informix"
>>
>> and is_incrit=0
>>
>> Our problem is that some regular users get a session ID < 100. We would
>> like
>> to remove the sid from the where clause, and just use 'where username <>
>> "informix" and is_incrit=0', but I want to make sure that will not kill any
>> necessary processes.
>>
>> Thanks.
>>
>>
>> ************************************************************
>> *******************
>> Forum Note: Use "Reply" to post a response in the discussion forum.
>>
>>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
dbexport being your reason, wouldn't it be wiser to kill sessions based on
database they're having open (sysopendb) ?
Also I'm not sure what you're trying to filter using the is_incrit
criteria ...
HTH,
Andreas
From: "MARY GREEN" <mgreen@flyravn.com>
To: ids@iiug.org
Date: 07/08/2017 02:41 AM
Subject: Re: ownership of system processes [39525]
Sent by: ids-bounces@iiug.org
Are there any other states that would indicate an onbar process?
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Andreas, Your suggestion looks promising. We are exporting six databases, but only one - the most used one- has the problem. Question: Your suggestion seems to imply that system processes will only use one of the system databases. Is that correct? The script was written by someone who has retired, and I do not know why he filtered by is_incrit. Thank-you. -Mary Anne Green
Probably a very old script/code when onmode -z on session in a critical
phase could take the engine down, but not seen that issue in years
Cheers
Paul
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Andreas Legner1
Sent: Monday, July 10, 2017 7:24 AM
To: ids@iiug.org
Subject: Re: ownership of system processes [39536]
dbexport being your reason, wouldn't it be wiser to kill sessions based on
database they're having open (sysopendb) ?
Also I'm not sure what you're trying to filter using the is_incrit
criteria ...
HTH,
Andreas
From: "MARY GREEN" <mgreen@flyravn.com>
To: ids@iiug.org
Date: 07/08/2017 02:41 AM
Subject: Re: ownership of system processes [39525]
Sent by: ids-bounces@iiug.org
Are there any other states that would indicate an onbar process?
****************************************************************************
***
Forum Note: Use "Reply" to post a response in the discussion forum.
****************************************************************************
***
Forum Note: Use "Reply" to post a response in the discussion forum.
The filter is trying to avoid killing any processes that are in critical
sections. There have been bugs in one version or another over the years
under which doing so would crash the instance.
FYI if the issue is to be able to dbexport a database that is being
accessed (and so dbexport cannot get an exclusive lock on the database) you
can try using my dbexport replacement utility myexport which does not
require an exclusive database lock.
Art
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on the IIUG, nor any other organization with which I am
associated either explicitly, implicitly, or by inference. Neither do
those opinions reflect those of other individuals affiliated with any
entity with which I am affiliated nor those of the entities themselves.
On Mon, Jul 10, 2017 at 12:49 PM, MARY GREEN <mgreen@flyravn.com> wrote:
> Andreas, Your suggestion looks promising. We are exporting six databases,
> but
> only one - the most used one- has the problem.
>
> Question: Your suggestion seems to imply that system processes will only
> use
> one of the system databases. Is that correct?
>
> The script was written by someone who has retired, and I do not know why he
> filtered by is_incrit.
>
> Thank-you.
>
> -Mary Anne Green
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>