一些和用户权限相关的查询

select b.owner || '.' || b.table_name obj,
b.privilege what_granted, b.grantable,a.username
from sys.DBA_users a, sys.dba_tab_privs b
where  a.username = b.grantee
and a.username='SCOTT'
order by 1,2,3;

Select owner || '.' || table_name obj,
privilege what_granted, grantable, grantee
from sys.dba_tab_privs
where not exists(select 'x' from sys.dba_users
where username = grantee)
order by 1,2,3;

select b.privilege what_granted,b.admin_option, a.username
from sys.dba_users a, sys.dba_sys_privs b
where a.username = b.grantee
and username='SCOTT'
order by 1,2;

select b.granted_role ||decode(admin_option, 'YES',' (With Admin Option)',null) what_granted, a.username
from sys.dba_users a, sys.dba_role_privs b
where a.username = b.grantee
and username='SCOTT'
order by 1;

select a.username,
b.granted_role || decode(admin_option,'YES',' (With Admin Option)',null) what_granted
from sys.dba_users a, sys.dba_role_privs b
where a.username = b.grantee
and username='SCOTT'
UNION
select a.username,b.privilege || decode(admin_option,'YES',' (With Admin Option)', null)what_granted
from sys.dba_users a, sys.dba_sys_privs b
where a.username = b.grantee
and username='SCOTT'
UNION
select a.username,
b.table_name || ' - ' || b.privilege|| decode(grantable,'YES',' (With Grant Option)',null) what_granted
from sys.dba_users a, sys.dba_tab_privs b
where a.username = b.grantee
and username='SCOTT'
order by 1;
Select username, profile, default_tablespace,
temporary_tablespace, created
from sys.dba_users
where username='SCOTT'
order by username
/

标签: 暂无标签
oraunix

写了 199 篇文章,拥有财富 1026,被 339 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

成为第一个吐槽的人

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈