Granting and revoking SQL privileges

Users automatically own any objects they create and save in the database (unless they create a table with a different owner). The owner of an object automatically has all SQL privileges on objects he or she owns, and can grant (or revoke) these privileges to other users. Anyone with DB2 administrator authority can grant or revoke SQL privileges for any object in the database. The user Q has this authority, and is predefined to DB2 during QMF installation.

When granting or revoking privileges on objects you do not own, qualify the object with the SQL authorization ID of the owner:

JONES.ORDER__BACKLOG

SQL authorization IDs can be implicit qualifiers. Queries can contain unqualified table, view, and index names. QMF commands can contain unqualified query, procedure, and form names. In these cases, the user's SQL authorization ID serves as the implicit qualifier. For example, a user is operating with JONES as the current SQL authorization ID. During the session, the user issues the command:

RUN QUERYA (FORM=FORMA

which runs the following SQL query:

SELECT * FROM TABLEA

The RUN command refers to the query JONES.QUERYA and the form JONES.FORMA. The SELECT command refers to the table JONES.TABLEA.

If you create a table, view, index, or alias with an unqualified name, your current authorization ID becomes the owner of the object. That ID must have the privileges needed to create the object.

You must have DBA authority to create a table, view, or index with a qualified name that is not your current authorization ID.

[ Previous Page | Next Page | Contents | Index ]