The AUTH_GET_INSTANCE_AUTHID scalar function returns the authorization ID of the instance owner
The schema is SYSPROC.
EXECUTE privilege on the AUTH_GET_INSTANCE_AUTHID scalar function.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
This function returns a value of type VARCHAR(128) that specifies the authorization ID of the instance owner.
Common configurations have the instance owner account as a member of the SYSADM group, therefore, before DB2® Version 9.7, applications that are run under the instance owner account had unlimited authority on the database. In DB2 Version 9.7 and later, a user who holds SYSADM authority no longer has implicit DBADM authority and as a result applications that are run under the instance owner account might experience authorization errors, such as SQL1092N, SQL0551N, and SQL0552N, when performing operations that are no longer within the scope of SYSADM authority.
The UPGRADE DATABASE command and the RESTORE DATABASE command (for a previous database) grant DBADM authority to the SYSADM group, however this is not the case for any new Version 9.7 database.
db2 "VALUES SYSPROC.AUTH_GET_INSTANCE_AUTHID()"
1
--------------------------------------
BOB
1 record(s) selected.
SELECT * FROM
TABLE (SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('BOB', 'U') ) AS T
ORDER BY AUTHORITY
GRANT DBADM ON DATABASE TO USER BOB
db2 "values SYSPROC.AUTH_GET_INSTANCE_AUTHID()"
1
-------------------------...-------------
ZURBIE
1 record(s) selected.