161214、oracle查询表信息
1、查找表的所有索引(包括索引名,类型,构成列): select t.*,i.index_type from user_ind_columns t,user_indexes i where t.index_name = i.index_name and t.table_name = i.table_name and t.table_name = 要查询的表 2、查找表的主键(包括名称,构成列): select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name = 要查询的表 3、查找表的唯一性约束(包括名称,构成列): select column_name from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'U' and au.table_name = 要查询的表 4、查找表的外键(包括名称,引用表的表名和对应的键名,下面是分成多步查询): select * from user_constraints c where c.constraint_type = 'R' and c.table_name = 要查询的表 查询外键约束的列名: select * from user_cons_columns cl where cl.constraint_name = 外键名称 查询引用表的键的列名: select * from user_cons_columns cl where cl.constraint_name = 外键引用表的键名 5、查询表的所有列及其属性 select t.*,c.COMMENTS from user_tab_columns t,user_col_comments c where t.table_name = c.table_name and t.column_name = c.column_name and t.table_name = 要查询的表 6、Oracle中每个用户表的表名和行数
select table_name,num_rows from user_tables; 7、Oracle查询用户表空间:select * from user_all_tables 8、Oracle查询所有函数和储存过程:select * from user_source 9、Oracle查询所有用户:
select * from all_users;
select * from dba_users 10、Oracle查看当前用户连接:select * from v$Session 11、Oracle查看当前用户权限:select * from session_privs 12、Oracle查看用户表空间使用情况: 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;
161214、oracle查询表信息的更多相关文章
- oracle查询表信息
oracle查询表信息(索引,外键,列等) oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下: 1.查询出所有的用户表 select * fro ...
- 类型:Oracle;问题:oracle 查询表详细信息;结果:oracle查询表信息(索引,外键,列等)
oracle查询表信息(索引,外键,列等) oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助: 1.查询出所有的用户表sel ...
- oracle查询表信息(索引,外键,列等)
oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助:1.查询出所有的用户表 select * from user_tables ...
- Oracle 查询表信息(字段+备注) .
var t= CardService.GetInstance().test("900000000233"); foreach (DataRow row in ...
- Oracle数据库查询表信息/列信息(列ID/列名/数据类型/长度/精度/是否可以为null/默认值/是否自增/是否是主键/列描述)
查询表信息(表名/表描述) Select table_Name As Name,Comments As Value From User_Tab_Comments Where table_Type='T ...
- Oracle 查询表分区相关信息
Oracle 查询表分区相关信息 --表分区 --1,分区表信息 -- (1)显示数据库所有分区表的信息 select * from DBA_PART_TABLES a where a.owner=u ...
- Oracle查询表主键、外键
项目中用到的一些Sql(oracle下的)总结: 1.查找表的所有索引(包括索引名,类型,构成列) select t.*,i.index_type from user_ind_columns t,us ...
- Oracle 查询表注释以及字段注释
Oracle 查询表注释以及字段注释 --表字段信息 select * from all_tab_columns a where a.TABLE_NAME='T_X27_USER'; --表注释信息 ...
- Oracle查询表空间使用率很慢
Oracle查询表空间使用率很慢 问题描述 执行查询表空间的语句,需要接近2min的时间才能执行完成. 以前也在其他客户的生产库遇到过一样的情况,当时是由于回收站的内容过多引起的. 不过这次的情况却不 ...
随机推荐
- mysql配置之skip-external-locking
转载:http://www.kuqin.com/database/20120815/328905.html MySQL的配置文件my.cnf中默认存在一行skip-external-locking的参 ...
- Some useful links
Integrating the FlyCapture SDK for use with OpenCV CStereoGrabber_Bumblebee.h OpenCV with PGR Flycap ...
- 【LeetCode】16. 4Sum
题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = ...
- css重新认识(2)
1)行内元素可以用margin-left与margin-right调整位置,但用margin-top与margin-bottom来调整位置不会有效果,只有具有block属性值后才能像块级元素般被外边距 ...
- Git基本命令行操作
A. 新建Git仓库,创建新文件夹git init B. 添加文件到git索引git add <filename> --- 单个文件添加git add * --- 全部文件添加 C. ...
- Jquery的优势
(1)轻量级.jQuery非常轻巧,采用Dean Edwards的Packer(http://dean.edwards.name/packer/)压缩后,只有不到30KB的大小,如果服务器端启用gzi ...
- 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"
上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2 报错原因:参数ID[hi ...
- GridView的详细用法
l GridView无代码分页排序 l GridView选中,编辑,取消,删除 l GridView正反双向排序 l GridView和下拉菜单DropDownList结合 l GridView和Ch ...
- jquery 温故而知新 animate动画的一些坑
注意1,只有hover事件后才能紧跟着第二个回调函数(mouseleave),尽量还是不使用mouseover事件了 注意2,.stop(false,true); 结束动画,在动画队列中删除自己,并且 ...
- c++20701除法(刘汝佳1、2册第七章,暴搜解决)
20701除法 难度级别: B: 编程语言:不限:运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 输入正整数n,按从小到大的顺序输出所有 ...