Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ARK - 05 May 2006 22:01 GMT
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.
Knut Stolze - 08 May 2006 09:44 GMT
> Database:  DB2 AIX V8.*
>
[quoted text clipped - 3 lines]
> 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?

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

ARK - 09 May 2006 04:54 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.