oracle 查看用户 用户权限 用户表空间 用户默认表空间[转]

1、查看所有用户
select  *  from dba_users; //dba
select  *  from all_users; //all
select  *  from user_users; //当前
2、查看当前用户连接:
select  *  from v$Session;
3、查看当前用户权限:
select  *  from session_privs;
4、查看所有用户系统权限
select  *  from dba_sys_privs;
select  *  from user_sys_privs;
5、查看所有用户对象权限
select  *  from dab_tab_privs;
select  *  from all_tab_privs;
select  *  from user_tab_privs;
6、查看所有角色
select  *  from dba_roles;
select  *  from dba_role_privs;
select  *  from user_role_privs;
7、查看所有表空间、临时表空间等信息
select tablespace_name, file_name,bytes file_size,autoextensible  from dba_data_files;
select tablespace_name, file_name,bytes file_size,autoextensible  from dba_temp_files;
8、查看用户表空间使用情况:
select 
  a. file_id "FileNo",a.tablespace_name "Tablespace_name",
  a.bytes "Bytes",a.bytes - sum(nvl(b.bytes, 0)) "Used",  sum(nvl(b.bytes, 0)) "Free", sum(nvl(b.bytes, 0)) /a.bytes * 100 " %free" 
from dba_data_files a,dba_free_space b 
where a. file_id =b. file_id( +
group  by a.tablespace_name , a. file_id,a.bytes 
order  by a.tablespace_name; 
9、查看用户所有对象
select table_name,num_rows  from user_tables;
select  *  from all_tables;
10、询所有函数和存储过程
select  *  from dba_source;
select  *  from user_source;


名称: ♪4C.ESL | .↗Evon
口号: 遇到新问题♪先要寻找一个方案乄而不是创造一个方案こ
mail: 联系我

你可能感兴趣的:(oracle 查看用户 用户权限 用户表空间 用户默认表空间[转])