By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.