Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Joseph Freemaker wanted to kill sessions by client IP and port using SQL. Eric Vercelletto showed the SQL Admin API: in sysadmin, EXECUTE FUNCTION task('onmode','z','session number'). Joseph asked where the client port is in sysmaster; Eric did not think it is there and suggested sqlhosts or client configuration. The port question stayed unanswered.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Need assistance.
From an Administrator SQL session need to kill client database sessions that
meet certain criteria.
Can do this in SQL Server and Oracle.
Need a SQL command that can kill a session based upon the client IP address
and port no.
In reviewing the sysmaster tables/views I see the view where the client
session's host IP address is. However cannot locate the port no. for the
client session.
Thanks in advance for any helpful information.
Joseph,
practically all the commands onmodeonstat etc .. .can be executed thru the
SQL Admin API.
check here
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.adref.doc/i
ds_sapi_094.htm
in your case you will to to do the following
dbaccess (or whatever) sysadmin;
EXECUTE FUNCTION task("onmode","z","14");14 is the number of the session you wanna kill
Hope this helps
Eric
Thank you. This is great.
Question. Want to query the client port no. for a database session. Are you
aware of what sysmaster table/view this would be in?
Just curious: why do you wanna query the session port # ?
I do not think this info is in sysmaster, but
depending on your client (CSDK, 4gl, Java), you will find the info associated
with the value of the INFORMIXSERVER variable, either in the
$INFORMIXDIR/etc/sqlhosts file (unix) or in the setnet32 utility(windows) or
in the connect string for java.
And if you don't have the port number, you cannot connect to the DB, thus you
can't query it :-)
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.