ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORACLE用户常用查询SQL

ORACLE用户常用查询SQL

原创 Linux操作系统 作者:蜗牛--ora 时间:2008-07-23 10:58:14 0 删除 编辑

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

  SQL>select username,default_tablespace from user_users;

  查看当前用户的角色

  SQL>select * from user_role_privs;

  查看当前用户的系统权限和表级权限

  SQL>select * from user_sys_privs;

  SQL>select * from user_tab_privs;

  查看用户下所有的表

  SQL>select * from user_tables;

  显示用户信息(所属表空间)

  select default_tablespace,temporary_tablespace

  from dba_users where username='GAME';

  1、用户

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

  SQL>select username,default_tablespace from user_users;

  查看当前用户的角色

  SQL>select * from user_role_privs;

  查看当前用户的系统权限和表级权限

  SQL>select * from user_sys_privs;

  SQL>select * from user_tab_privs;

  显示当前会话所具有的权限

  SQL>select * from session_privs;

  显示指定用户所具有的系统权限

  SQL>select * from dba_sys_privs where grantee='GAME';

  显示特权用户

  select * from v$pwfile_users;

  显示用户信息(所属表空间)

  select default_tablespace,temporary_tablespace

  from dba_users where username='GAME';

  显示用户的PROFILE

  select profile from dba_users where username='GAME';

  2、表

  查看用户下所有的表

  SQL>select * from user_tables;

  查看名称包含log字符的表

  SQL>select object_name,object_id from user_objects

  where instr(object_name,'LOG')>0;

  查看某表的创建时间

  SQL>select object_name,created from user_objects where object_name=upper('&table_name');

  查看某表的大小

  SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments

  where segment_name=upper('&table_name');

  查看放在ORACLE的内存区里的表

  SQL>select table_name,cache from user_tables where instr(cache,'Y')>0;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14864453/viewspace-407018/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-07-15

  • 博文量
    16
  • 访问量
    13366