Special register USER

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lenygold via DBMonster.com

    Special register USER

    Is there is a way in DB2 to update user id Special register USER ?
    Thank's in advance.

    --
    Message posted via DBMonster.com


  • Dave Hughes

    #2
    Re: Special register USER

    lenygold via DBMonster.com wrote:
    Is there is a way in DB2 to update user id Special register USER ?
    Thank's in advance.
    Indeed - log in as a different user ;-)

    However, if you're looking for a way to "impersonat e" another user -
    you can do this on DB2 9 and above, but only with certain privileges.
    First, someone with SECADM authority has to grant your user
    SETSESSIONUSER privilege [1] on the user ID you wish to impersonate.
    Then, when you logon you simply use SET SESSION_USER [2]:

    CONNECT TO SAMPLE USER DB2ADMIN;
    GRANT SETSESSIONUSER ON USER FRED TO USER BARNEY;
    CONNECT RESET;

    CONNECT TO SAMPLE USER BARNEY;
    SET SESSION_USER FRED;

    If Barney now does something like "VALUES USER;" he should see:

    1
    -----------
    FRED


    [1]

    uw.sql.ref.doc/doc/r0020073.html

    [2]

    uw.sql.ref.doc/doc/r0011139.html


    Cheers,

    Dave.

    Comment

    Working...