日期:2014-05-16  浏览次数:20548 次

oracle数据库管理数据字典和表空间的笔记

?

?

 //user_table 表示显示当前用户自己创建的所有表
 //它表示返回用户所对应方案的所有表
select table_name from user_tables
 //user_table 表示显示当前用户可以访问的所有表
 //它不就可以访问自己创建的表,
 //还可以返回当前用户可以访问的所有表
select table_name from all_tables
//它会显示所有方案拥有的数据库表
select table_name from dba_tables
//显示当前数据库所有用户的详细信息
select username from dba_users;
//表示查询 SCOTT所拥有的角色 ,一般是system登录
select * from dba_role_privs where GRANTEE='SCOTT';
//oracle究竟有多少个预定义角色
select * from dba_roles;
//查询oralce中所有的对象权限,一般是dba角色登录
select distinct privilege from dba_tab_privs;
// 查询oralce中所有的系统权限 ,一般也是dba角色登录
select * from system_privilege_map order by name
//查询数据库的表空间
select tablespace_name from dba_tablespace;
//如何查询一个角色,包括的权限?
//1.一个角色包含的系统权限,查询CONNECT角色的系统权限
 select * from 	dba_sys_privs where grantee='CONNECT'
 select * from role_sys_privs where role='CONNECT'
 //2.一个角色包含的对象权限,查询CONNECT角色的对象权限
 select * from  dba_tab_privs where grantee='CONNECT'
 //查询某个用户有什么角色
 select * from dba_role_privs where grantee='CONNECT';

?



?

?

?

?

?

?

?

?

?

?

?