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
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 "impersonate" 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  on the user ID you wish to impersonate.
Then, when you logon you simply use SET SESSION_USER :
CONNECT TO SAMPLE USER DB2ADMIN;
GRANT SETSESSIONUSER ON USER FRED TO USER BARNEY;
CONNECT TO SAMPLE USER BARNEY;
SET SESSION_USER FRED;
If Barney now does something like "VALUES USER;" he should see: