Table-Level Privileges
Table-level privileges, also called table privileges, specify which operations a user or role can perform on a table or view in the database. You can use a synonym to specify the table or view on which you grant or revoke table privileges.
Select, Update, and References privileges can be granted on a subset of the columns of a table or view, but can be revoked only for all columns. If Select privileges are revoked from a user for a table that is referenced in the SELECT statement defining a view that the same user owns, then that view is dropped, unless it also includes columns from tables in another database.
For table objects that the CREATE EXTERNAL TABLE statement has registered in the current database, only the Select privilege and the Insert privilege are supported; no other table or column access privileges can be granted or revoked.
Element | Description | Restrictions | Syntax |
---|---|---|---|
owner | Name of the user who owns the table, view, or synonym | Must be a valid authorization identifier | Owner name |
synonym, table, view | Synonym, table, or view on which privileges are granted | Must exist in the current database | Identifier |
Privilege | Effect after REVOKE |
---|---|
INSERT | User cannot insert rows. |
DELETE | User cannot delete rows. |
SELECT | User cannot display data retrieved by a SELECT statement. |
UPDATE | User cannot change column values. |
INDEX | User cannot create permanent indexes. You must have the Resource privilege to take advantage of the Index privilege. (But any user who has the Connect privilege can create indexes on temporary tables.) |
ALTER | The holder cannot add or delete columns, modify column data types, add or delete constraints, change the locking mode of a table from PAGE to ROW, nor add or drop a corresponding named ROW type table. The user also cannot enable or disable indexes, constraints, nor triggers, as described in SET Database Object Mode statement. |
Privilege | Effect after REVOKE |
---|---|
REFERENCES | User cannot reference columns in referential constraints. You must also have the Resource privilege on the database to take advantage of the References privilege on tables. (You can add, however, a referential constraint during an ALTER TABLE statement. without holding the Resource privilege on the database.) Revoking the References privilege disallows cascading DELETE operations. |
UNDER | User cannot create subtables under a typed table. |
ALL | This removes all of the table privileges that are listed above. (Here the PRIVILEGES keyword is optional. ) |
See also Table-Level Privileges.
If a user receives the same privilege from two different grantors and one grantor revokes the privilege, the grantee still has the privilege until the second grantor also revokes the privilege. For example, if both you and a DBA grant the Update privilege on your table to ted, both you and the DBA must revoke the Update privilege to prevent ted from updating your table.
If user ted holds the same privileges through a role or as PUBLIC, however, this REVOKE operation does not prevent ted from exercising the Update privilege.