AUTH_GET_INSTANCE_AUTHID - Get the instance owner authorization ID
The AUTH_GET_INSTANCE_AUTHID scalar function returns the authorization ID of the instance owner
Syntax
The schema is SYSPROC.
Authorization
EXECUTE privilege on the AUTH_GET_INSTANCE_AUTHID scalar function.
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
Information returned
This function returns a value of type VARCHAR(128) that specifies the authorization ID of the instance owner.
Usage notes
A user who holds SYSADM authority does not have implicit DBADM authority. As a result, applications that run under the instance owner account and that perform operations that are not within the scope of SYSADM authority might experience authorization errors such as SQL1092N, SQL0551N, or SQL0552N.
The UPGRADE DATABASE and RESTORE DATABASE commands no longer grant DBADM authority to the SYSADM group.
- Use the SYSPROC.AUTH_GET_INSTANCE_AUTHID() scalar function to
determine the instance owner authorization ID. For example:
db2 "VALUES SYSPROC.AUTH_GET_INSTANCE_AUTHID()"This command returns.1 -------------------------------------- BOB 1 record(s) selected. - Get a list of the authorities for this authorization ID. For
example:
SELECT * FROM TABLE (SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('BOB', 'U') ) AS T ORDER BY AUTHORITY - If necessary, grant any missing authorities. For example:
GRANT DBADM ON DATABASE TO USER BOB
Example
db2 "values SYSPROC.AUTH_GET_INSTANCE_AUTHID()"1
-------------------------...-------------
ZURBIE
1 record(s) selected.