Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
SQL Statements (continued), 3 of 6
To revoke system privileges and roles from users and roles. To revoke object privileges from users and roles, refer to "REVOKE schema_object_privileges". For information on granting system privileges and roles, see "GRANT system_privileges_and_roles".
You must have been granted the system privilege or role with the ADMIN
OPTION
. Also, you can revoke any role if you have the GRANT
ANY
ROLE
system privilege.
The REVOKE
statement can revoke only privileges and roles that were previously granted directly with a GRANT
statement. You cannot use this statement to revoke:
system_priv |
is a system privilege to be revoked. For a list of the system privileges, see Table 7-5. |
|
Restriction: A system privilege cannot appear more than once in the list of privileges to be revoked. |
role |
is a role to be revoked. For a list of the roles predefined by Oracle, see "GRANT system_privileges_and_roles".
Restriction: A system role cannot appear more than once in the list of roles to be revoked. |
|
identifies users and roles from which the system privileges or roles are to be revoked.
Restriction: A user, a role, or |
|
revokes the system privilege or role from all users. |
The following statement revokes the DROP ANY TABLE
system privilege from the users BILL
and MARY
:
REVOKE DROP ANY TABLE FROM bill, mary;
BILL
and MARY
can no longer drop tables in schemas other than their own.
The following statement revokes the role CONTROLLER
from the user HANSON
:
REVOKE controller FROM hanson;
HANSON
can no longer enable the CONTROLLER
role.
The following statement revokes the CREATE
TABLESPACE
system privilege from the CONTROLLER
role:
REVOKE CREATE TABLESPACE FROM controller;
Enabling the CONTROLLER
role no longer allows users to create tablespaces.
To revoke the role VP
from the role CEO
, issue the following statement:
REVOKE vp FROM ceo;
VP
is no longer granted to CEO
.
To revoke the CREATE
ANY
DIRECTORY
system privilege from user SCOTT
, issue the following statement:
REVOKE CREATE ANY DIRECTORY FROM scott;
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|