- 18
- 0
- 约8.22万字
- 约 19页
- 2016-10-21 发布于河南
- 举报
oracle查询表和数据字典
oracle查询表和数据字典
oracle 查看用户表数目,表大小,视图数目等 (2012-08-03 17:08:22)转载▼
标签: 杂谈
查看当前用户的缺省表空间
SQLselect username,default_tablespace from user_users;
查看当前用户的角色
SQLselect * from user_role_privs;
查看当前用户的系统权限和表级权限
SQLselect * from user_sys_privs;
SQLselect * from user_tab_privs;
查看用户下所有的表
SQLselect * from user_tables;
1、用户
查看当前用户的缺省表空间
SQLselect username,default_tablespace from user_users;
查看当前用户的角色
SQLselect * from user_role_privs;
查看当前用户的系统权限和表级权限
SQLselect * from user_sys_privs;
SQLselect * from user_tab_privs;
显示当前会话所具有的权限
SQLselect * from session_privs;
显示指定用户所具有的系统权限
SQLselect * from dba_sys_privs where grantee=GAME;
2、表
查看用户下所有的表
SQLselect * from user_tables;
查看名称包含log字符的表
SQLselect object_name,object_id from user_objects
where instr(object_name,LOG)0;
查看某表的创建时间
SQLselect object_name,created from user_objects where object_name=upper(table_name);
查看某表的大小
SQLselect sum(bytes)/(1024*1024) as size(M) from user_segments
where segment_name=upper(table_name);
查看放在ORACLE的内存区里的表
SQLselect table_name,cache from user_tables where instr(cache,Y)0;
3、索引
查看索引个数和类别
SQLselect index_name,index_type,table_name from user_indexes order by table_name;
查看索引被索引的字段
SQLselect * from user_ind_columns where index_name=upper(index_name);
查看索引的大小
SQLselect sum(bytes)/(1024*1024) as size(M) from user_segments
where segment_name=upper(index_name);
4、序列号
查看序列号,last_number是当前值
SQLselect * from user_sequences;
5、视图
查看视图的名称
SQLselect view_name from user_views;
查看创建视图的select语句
SQLset view_name,text_length from user_views;
SQLset long 2000; 说明:可以根据视图的text_length值设定set long 的大小
SQLselect text from user_views where view_name=upper(view_name);
6、同义词
查看同义词的名称
SQLselect * from user_synonyms;
7、约束条件
查看某表的约束条件
SQLselect constraint_name, constraint_type,search_condition, r_constraint_name
from user_constraints where table_name = upper(table_name);
SQLselect c.constraint_name,c.constraint_type,cc.co
您可能关注的文档
最近下载
- GB50461-2024:石油化工静设备安装工程施工质量验收规范.pptx VIP
- 三江A116火灾报警控制器简易操作规程.docx
- (新版)社会体育指导员理论知识考试题库(含答案).docx VIP
- DB31T 1104-2018 城市轨道交通导向标识系统设计规范.docx VIP
- 2023年浙江省军队转业干部录用考试试题.docx VIP
- 口渴了-朋友帮你.ppt VIP
- Xikong西莱克低温机控制板SHXK814用户手册.pdf
- 爱迪生牛顿大发明攻略.doc VIP
- 重庆天齐锂电新材料有限公司新建1000吨_年高能锂电材料电池级金属锂项目环评报告.pdf VIP
- 朗文3A复习资料及垃圾分类作文8篇.doc VIP
原创力文档

文档评论(0)