467,887 Members | 1,569 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,887 developers. It's quick & easy.

Finding the 'Client login ID' aka 'Execution ID': DB2 AIX

ARK
Database: DB2 AIX V8.*

Question: I want to be able to get the 'Client login ID' aka 'Execution
ID' (as opposed to the authid or application_id) for the current
connection within a stored procedure and without requiring SYSADM,
SYSCTRL, SYSMAINT, or SYSMON authority. This would be for audit
purposes as several different people can share an authid.

Obviously I can create a stored procedure to do the SQL below and then
grant execute to the users authid but I don't want to give them SYSADM,
SYSCTRL, SYSMAINT, or SYSMON authority which means the call will fail
for security reasons. <==tested

************************************************** ************************************************
I figured out how to do it using the snapshot (see below) but I don't
want to give the prod id sysmon authority.

Explanation: This query returns the Client login ID aka Execution ID
for the current connection to database dbname

Query:
SELECT EXECUTION_ID FROM TABLE(SNAPSHOT_APPL_INFO('dbname',-1))
AS SNAPSHOT_APPL_INFO
WHERE APPL_ID = application_id();

Authorized users can capture snapshots of monitor information for a DB2
instance by using snapshot table functions in SQL queries.

Prerequisites
You must have SYSADM, SYSCTRL, SYSMAINT, or SYSMON authority to capture
a database snapshot.

May 5 '06 #1
  • viewed: 2148
Share:
2 Replies
ARK wrote:
Database: DB2 AIX V8.*

Question: I want to be able to get the 'Client login ID' aka 'Execution
ID' (as opposed to the authid or application_id) for the current
connection within a stored procedure and without requiring SYSADM,
SYSCTRL, SYSMAINT, or SYSMON authority. This would be for audit
purposes as several different people can share an authid.


Does the CURRENT CLIENT_USERID special register give you what you want?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
May 8 '06 #2
ARK
Indeed it does but it has to be set at the client level. I was hoping
to be able to use something without a the client special registers
being set.

May 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Robert Wagner | last post: by
9 posts views Thread by Laurent Bugnion | last post: by
bartonc
reply views Thread by bartonc | last post: by
3 posts views Thread by dm3281 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.