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的时间才能执行完成. 以前也在其他客户的生产库遇到过一样的情况,当时是由于回收站的内容过多引起的. 不过这次的情况却不 ...
随机推荐
- [CareerCup] 18.11 Maximum Subsquare 最大子方形
18.11 Imagine you have a square matrix, where each cell (pixel) is either black or white. Design an ...
- call与apply基础用法告诉你
Js用法中还有个极好的但是有些抽象的用法——call与apply,今天我要简单总结一下: var ob1={ //对象ob1 name:"ob1", func1:function( ...
- Java web MVC开发模式入门感悟
当我进行第一个完整的java web项目的开发时,对以前所学的Java web知识体系有了一个清晰的进阶认识.我觉得非常有必要对此进行必要的总结. MVC,意指model(数据持久层)+viewer( ...
- thinkphp上传至服务器后模板无法解析原因
前几日做好的响应式静态页面上传至虚拟空间,打开网址地址出现: 模板不存在:./app/Home/View/Index/index.html 错误位置 FILE: /home/u333385714/pu ...
- jq最新前三篇文章高亮显示
/*---------最新前三篇文章高亮显示-------------*/ function latest(){ var color_arr=new Array( "blue", ...
- hdu Dragon Balls
这题是一道简单的并查集的运用.龙珠所在的城市.该城市龙珠数目都是很简单的问题,稍微麻烦一点的就是龙珠被移动的次数,因为每一次要移动的是一个城市中所有的龙珠,所以每次移动该城市中所有龙珠的移动次数都要加 ...
- c#面向对象基础 类、方法、方法重载
C#是纯粹的面向对象编程语言,它真正体现了“一切皆为对象”的精神.在C#中,即使是最基本的数据类型,如int,double,bool类型,都属于System.Object(Object为所有类型的基类 ...
- NeuSoft(2)添加系统调用
1.下载内核 apt-get install linux-source 在/usr/src下 2.解压内核 cd /usr/src tar -jxvf linux-source-3.2.0.tar.b ...
- centos MariaDB10.1.X galera cluster
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1.12/centos6-amd64 gpgkey=https://yum.m ...
- php获取真实IP地址
function user_realip() { if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } elseif (g ...