Database-level privileges
Three concentric layers of database-level privileges, Connect, Resource, and DBA, authorize increasing power over database access and control. Only a user with the DBA privilege can grant or revoke database-level privileges.
Because of the hierarchical organization of the privileges (as outlined in the privilege definitions that are described later in this section), if you revoke either the Resource or the Connect privilege from a user with the DBA privilege, the statement has no effect. If you revoke the DBA privilege from a user who has the DBA privilege, the user retains the Connect privilege on the database. To deny database access to a user with the DBA or Resource privilege, you must first revoke the DBA or the Resource privilege and then revoke the Connect privilege in a separate REVOKE statement.
Similarly, if you revoke the Connect privilege from a user who has the Resource privilege, the statement has no effect. If you revoke the Resource privilege from a user, the user retains the Connect privilege on the database.
Only users or PUBLIC can hold database-level privileges. You cannot revoke these privileges from a role, because a role cannot hold database level privileges.
Privilege | Effect |
---|---|
DBA | Has all the capabilities of the Resource privilege
and can perform the following additional operations:
|
RESOURCE | Lets you extend the structure of the database.
In addition to the capabilities of the Connect privilege, the holder
of the Resource privilege can perform the following operations:
|
CONNECT | If you have this privilege, you can query and modify
data, and modify the database schema if you own the database object
that you want to modify. A user holding the Connect privilege can
perform the following operations:
|
Tip: To determine which users have DBA privileges on a database, run this query from DB-Access or your application:
select username,usertype from sysusers;
The output shows user names (for example, public and informix) followed by one of the following codes:
- D = DBA privilege
- C = Connect privilege
- R = Resource privilege