Accessing data with the DATAACCESS authority

A database administrator must have the DATAACCESS authority to access data in all user tables, views, and materialized query tables in a Db2 subsystem.

About this task

Suppose that you are a database administrator DB2ADMIN1 and need access to data in TABLE1. You must first be granted the DATAACCESS authority.

Procedure

To access data with the DATAACCESS authority:

  1. Obtain the DATAACCESS authority from a security administrator.
    The SECADM (an authorization ID or role) can grant you the DATAACCESS authority by issuing the following statement:

    Begin general-use programming interface information.

    GRANT DATAACCESS ON SYSTEM TO DB2ADMIN1;
    End general-use programming interface information.

    Db2 inserts a row in SYSIBM.SYSUSERAUTH with the new column DATAACCESSAUTH set to 'Y', where column GRANTEE is set DB2ADMIN1.

  2. After obtaining the DATAACCESS authority, issue an SQL SELECT statement to select from table TABLE1.
    Db2 checks to make sure that you have the required privilege set, including the SELECT privilege that is granted by the DATAACCESS authority. The SELECT statement completes successfully.