Oracle中如何获取用户表信息等详情
1个回答
展开全部
1. 查询oracle中所有用户信息
select * from dba_users;
2. 只查询用户和密码
select username,password from dba_users;
3. 查询当前用户信息
select * from dba_ustats;
4. 查询用户可以访问的视图文本
select * from dba_varrays;
5. 查询数据库中所有视图的文本
select * from dba_views;
select distinct tablespace_name from SYS.DBA_FREE_SPACE where tablespace_name like '%RB%';
select * from dba_objects where object_name='JDE900_F0005';
select * from rbods.jde900_f0005;
select * from rbodm.dim_company;
查看当前用户的缺省表空间
select username,default_tablespace from user_users
查看当前用户的角色
select * from user_role_privs
查看当前用户的系统权限和表级权限
select * from user_sys_privs
select * from user_tab_privs
查看用户下所有的表
select * from user_tables
显示用户信息(所属表空间)
select default_tablespace,temporary_tablespace from dba_users
显示当前会话所具有的权限
select * from session_privs
显示指定用户所具有的系统权限
select * from dba_sys_privs
显示特权用户
select * from v$pwfile_users
查看名称包含log字符的表
select object_name,object_id from user_objects where instr(object_name,'log')>0
查看某表的创建时间
select object_name,created from user_objects where object_name='ZW_YINGYEZ'
查看某表的大小
select sum(bytes)/(1024*1024) tablesize from user_segments
where segment_name='ZW_YINGYEZ'
查看放在ORACLE的内存区里的表
select table_name,cache from user_tables where instr(cache,'Y')>0
查看索引个数和类别
select index_name,index_type,table_name from user_indexes order by table_name
查看索引被索引的字段
select * from user_ind_columns where table_name='CB_CHAOBIAOSJ201004'
查看索引的大小
select sum(bytes)/(1024*1024) as indexsize from user_segments
where segment_name=upper('AS_MENUINFO')
查看视图信息
select * from user_views
查看同义词的名称
select * from user_synonyms
查看函数和过程的状态
select object_name,status from user_objects where object_type='FUNCTION'
select object_name,status from user_objects where object_type='PROCEDURE'
查看函数和过程的源代码
select text from all_source where owner=user and name='SF_SPLIT_STRING'
查看表字段
select cname from col where tname='ZW_YINGYEZ'
select column_name from user_tab_columns where table_name='ZW_YINGYEZ'
查看oracle版本命令:
select * from v$version
select * from dba_users;
2. 只查询用户和密码
select username,password from dba_users;
3. 查询当前用户信息
select * from dba_ustats;
4. 查询用户可以访问的视图文本
select * from dba_varrays;
5. 查询数据库中所有视图的文本
select * from dba_views;
select distinct tablespace_name from SYS.DBA_FREE_SPACE where tablespace_name like '%RB%';
select * from dba_objects where object_name='JDE900_F0005';
select * from rbods.jde900_f0005;
select * from rbodm.dim_company;
查看当前用户的缺省表空间
select username,default_tablespace from user_users
查看当前用户的角色
select * from user_role_privs
查看当前用户的系统权限和表级权限
select * from user_sys_privs
select * from user_tab_privs
查看用户下所有的表
select * from user_tables
显示用户信息(所属表空间)
select default_tablespace,temporary_tablespace from dba_users
显示当前会话所具有的权限
select * from session_privs
显示指定用户所具有的系统权限
select * from dba_sys_privs
显示特权用户
select * from v$pwfile_users
查看名称包含log字符的表
select object_name,object_id from user_objects where instr(object_name,'log')>0
查看某表的创建时间
select object_name,created from user_objects where object_name='ZW_YINGYEZ'
查看某表的大小
select sum(bytes)/(1024*1024) tablesize from user_segments
where segment_name='ZW_YINGYEZ'
查看放在ORACLE的内存区里的表
select table_name,cache from user_tables where instr(cache,'Y')>0
查看索引个数和类别
select index_name,index_type,table_name from user_indexes order by table_name
查看索引被索引的字段
select * from user_ind_columns where table_name='CB_CHAOBIAOSJ201004'
查看索引的大小
select sum(bytes)/(1024*1024) as indexsize from user_segments
where segment_name=upper('AS_MENUINFO')
查看视图信息
select * from user_views
查看同义词的名称
select * from user_synonyms
查看函数和过程的状态
select object_name,status from user_objects where object_type='FUNCTION'
select object_name,status from user_objects where object_type='PROCEDURE'
查看函数和过程的源代码
select text from all_source where owner=user and name='SF_SPLIT_STRING'
查看表字段
select cname from col where tname='ZW_YINGYEZ'
select column_name from user_tab_columns where table_name='ZW_YINGYEZ'
查看oracle版本命令:
select * from v$version
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询