Results 1 to 8 of 8
  1. #1
    Join Date
    May 2007
    Posts
    56

    Unanswered: OS User Id information

    I am running DB2 ESE v9.1.4 on Windows 64 bits server.
    I would like ot know if there is any way (if any simple) to obtain OS User Id information which is connecting / accessing information against DB2 database. I can see this information for example on tools cush as DB2 Monitor (freeware tool). So I know it is possible somehow.

    Customer requested to have this information at application level so that they can store who is doing what (without audit tables).

    Could anyone help me please?

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Snapshot functions?

    select * from table (snapshot_appl_info('YOURDB', -1)) t
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2007
    Posts
    56
    Thanks Nick!
    It worked like a Champ! That's exactly what I was looking for.

    One question though, I don't need to run any "get snapshot for application" before issuing this SQL in order to refresh those snapshot tables right?
    I mean if I connect to a database and I want to know who is accessing (is terms of user id) I don't need to "refresh this table?

    Regards

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    No, you don't need to refresh anything, it retrieves the monitor data dynamically.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    If you just want to know the users connected, you can also try the following on shell prompt:

    db2 "list applications show detail" | awk '{print $1}'

    Jayanta Datta
    DB2 UDB DBA
    IBM India, Global Delivery
    New Delhi

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by JAYANTA_DATTA
    db2 "list applications show detail" | awk '{print $1}'
    Just curious, why do you use "show detail" if you are only extracting the first column anyway?
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Separately, I noticed in 9.5 (not sure about 9.1) they finally got rid of the hex values of the client IP address on the list applications command and display it in normal decimal format.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  8. #8
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    Quote Originally Posted by n_i
    Just curious, why do you use "show detail" if you are only extracting the first column anyway?

    No extra significance. Just put the complete command, "show detail" can be ignored. Thanks for pointing out.

    Jayanta Datta
    DB2 UDB DBA
    IBM India, Global Delivery
    New Delhi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •