准备SQL考试,找了很久,明白了。
The roles in Oracle Database have no owner as well as directories have no owner.
When the user with CREATE ROLE
or SYSDBA
privilege creates the role, he or she is automatically assigned that role WITH ADMIN OPTION
which means that the user can subsequently grant that role to other users even if the privilege CREATE ROLE
is revoked from the user.
You can see what roles are assigned to which users querying DBA_ROLE_PRIVS
view, or USER_ROLE_PRIVS
if you want to know what roles are assigned to the current user.
Also, a user cannot create a role if the role with the same name already exists. However you can audit role creation and granting. You can do that with AUDIT ROLE statement (if it was for some reason disabled with NOAUDIT ROLE
), and then querying DBA_AUDIT_TRAIL
view.
通过下面的sql可以查看
select * from dba_role_privs
select * from user_role_privs