+ -
当前位置:首页 → 问答吧 → 求查看数据库所有用户的权限及角色的脚本

求查看数据库所有用户的权限及角色的脚本

时间:2010-09-01

来源:互联网

如题:
各位大侠有没有脚本可以查出所有用户的权限、角色、创建日期、状态的脚本!
谢谢!!

作者: haowen   发布时间: 2010-09-01

恩 是可以的

用户的相关信息可以查看 dba_users视图

至于用户的权限、角色也有相关的视图可以查看,比如

dba_sys_privs
session_privis

很多 自己网上找找

作者: duolanshizhe   发布时间: 2010-09-01

select a.username ,b.privilege,a.created,a.account_status from dba_users a ,dba_sys_privs b  where a.username=b.grantee  select a.username,c.granted_role,a.created,a.account_status  from  dba_users a,dba_role_privs c where c.grantee=a.username and a.username not in (select grantee from dba_sys_privs) ;

自己写的不知道对不对啊?

作者: haowen   发布时间: 2010-09-01

修改了一下:
select a.username ,b.privilege,a.created,a.account_status from dba_users a ,dba_sys_privs b  where a.username=b.grantee union  select a.username,c.granted_role,a.created,a.account_status  from  dba_users a,dba_role_privs c where c.grantee=a.username ;

作者: haowen   发布时间: 2010-09-01