Home  >  Article  >  Database  >  How to cancel permissions in oracle

How to cancel permissions in oracle

WBOY
WBOYOriginal
2022-02-28 10:11:378452browse

Method: 1. Use the "revoke system_privilege from user|role" command to cancel system permissions; 2. Use the "revoke obj_privilege|allon object from user|role" command to cancel object permissions.

How to cancel permissions in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to revoke permissions in oracle

Oracle revoke permissions

The concept of Oracle revoking permissions is to recycle the permissions of users or roles, that is, to revoke permissions of users Delete a certain system permission or delete the operation permission of an object.

Oracle revokes system permissions

Oracle revokes system permissions. Only users with DBA permissions can revoke (revoke) operations. The syntax for revoking system permissions is as follows:

revoke system_privilege from user|role;

Syntax analysis:

1. system_privilege: refers to the name of the revoked system permissions. When revoking system permissions, the user must have the system Permissions cannot be revoked if system permissions do not exist.

2. user|role: refers to whether the object of revoking permission is a user or a role.

Example 1. Use the revoke command to revoke the create session permission of the user teacher. The code is as follows:

revoke create session from teacher;

Then you can query the system permissions of TEACHER through the data dictionary dba_sys_privs and find that create session no longer exists. .

Oracle revokes object permissions

Oracle also uses the revoke command to revoke object permissions. The syntax structure is as follows:

revoke obj_privilege|all
on object
from  user|role;

Syntax analysis:

1. obj_privilege|all: refers to the operation permissions of the corresponding database object. all means to revoke all operation permissions.

Example 2. Use the revoke command to revoke the user teacher’s delete operation permission on the student information table (stuinfo). The code is as follows:

revoke delete  on student.stuinfo from  teacher ;

Then, query stuinfo through the data dictionary dba_tab_privs The operation permission was found to have been deleted, leaving only the query permission.

Note: When revoking permissions, the revocation of system permissions and the revocation of object permissions are different. From the previous chapter of Oracle permission authorization management, we know that the authorization of system permissions is not cascaded, and the authorization of object permissions is not cascaded. The authorization is cascaded. The same is true when revoking permissions. When object permissions are revoked, the object permissions granted by the user to other users will also be revoked. Revoking system permissions will not revoke the permissions of other users.

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to cancel permissions in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn