欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

查看用户权限 博客分类: oracle  

程序员文章站 2024-02-25 23:01:51
...
1、查看所有用户

  select * from dba_user;

  select * from all_users;

  select * from user_users;

  2、查看用户系统权限

  select * from dba_sys_privs;

  select * from all_sys_privs;

  select * from user_sys_privs;

  3、查看用户对象权限

  select * from dba_tab_privs;

  select * from all_tab_privs;

  select * from user_tab_privs;

  4、查看所有角色

  select * from dba_roles;

  5、查看用户所拥有的角色

  select * from dba_role_privs;

  select * from user_role_privs;

-------遇到no privileges on tablespace 'tablespace '

alter user userquota 10M[unlimited] on tablespace;

  6、查看当前用户的缺省表空间

  select username,default_tablespace from user_users;

  7、查看某个角色的具体权限

  如grant connect,resource,create session,create view to TEST;

  8、查看RESOURCE具有那些权限

  用SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='RESOURCE';

9.给scott解锁

用 system 登录进去之后,执行下面的命令:

  SQL> alter user scott account unlock;(解锁命令)

  用户已更改。
    select account_status from dba_users where username='SCOTT';

    ACCOUNT_STATUS
----------------------------------------------------------------
    EXPIRED
    修改密码即可
  当然如果不知道其密码,你可以修改一下scott的登录密码:

  SQL> alter user scott identified by tiger;

  用户已更改。

  SQL> conn scott/tiger

  已连接。