oracle查询表信息(索引,外键,列等)
oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助:
1、查询出所有的用户表 select * from user_tables 可以查询出所有的用户表
通过表名过滤需要将字母作如下处理
select * from user_tables where table_name = upper('表名')
因为无论你建立表的时候表名名字是大写还是小写的,create语句执行通过之后,对应的user_tables表中的table_name字段都会自动变为大写字母,所以必须通过内置函数upper将字符串转化为大写字母进行查询,否则,即使建表语句执行通过之后,通过上面的查询语句仍然查询不到对应的记录。
select * from user_tab_columns where table_name=upper('表名');
select cname,coltype,width from col where tname=upper('表名');;
查看索引个数和类别
select * from user_indexes where table_name='表名' ;
查看索引被索引的字段
SQL>select * from user_ind_columns where index_name=upper('&index_name');
PS:
查看某表的约束条件
SQL>select constraint_name, constraint_type,search_condition, r_constraint_name from user_constraints where table_name = upper('&table_name');
SQL>select c.constraint_name,c.constraint_type,cc.column_name from user_constraints c,user_cons_columns cc where c.owner = upper('&table_owner') and c.table_name = upper('&table_name') and c.owner = cc.owner and c.constraint_name = cc.constraint_name order by cc.position;
查看视图的名称
SQL>select view_name from user_views;
oracle查询表信息(索引,外键,列等)的更多相关文章
- 类型:Oracle;问题:oracle 查询表详细信息;结果:oracle查询表信息(索引,外键,列等)
oracle查询表信息(索引,外键,列等) oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助: 1.查询出所有的用户表sel ...
- 关于 Oracle外键列上是否需要索引问题?
外键列上缺少索引会带来两个问题,限制并发性.影响性能.而这两个问题中的任意一个都可能会造成严重性能问题. 无论是Oracle的官方文档,还是在Tom的书中都说明了两种情况下可以忽略外键上的索引.其 ...
- oracle查询表信息
oracle查询表信息(索引,外键,列等) oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下: 1.查询出所有的用户表 select * fro ...
- mysql字段约束-索引-外键---3
本节所讲内容: 字段修饰符 清空表记录 索引 外键 视图 一:字段修饰符 (约束) 1:null和not null修饰符 我们通过这个例子来看看 mysql> create table wo ...
- Oracle查找表的外键引用关系
Oracle查找表的外键引用关系 select t1.table_name, t2.table_name as "TABLE_NAME(R)", t1.constraint_nam ...
- 【转】PowerDesigner删除外键关系,而不删除外键列
原文:https://blog.csdn.net/tomsyc/article/details/6075530 PowerDesigner中配置外键关系时,如果要删除配置的外键关系,默认设置会一同删除 ...
- PowerDesigner删除外键关系,而不删除外键列[转]
PowerDesigner中配置外键关系时,如果要删除配置的外键关系,默认设置会一同删除外键列. 要更改此设置,需在菜单栏tools中打开Model Options,在Model Settings中点 ...
- PowerDesigner删除外键关系,而不删除外键列[转] 及编码格式
PowerDesigner删除外键关系,而不删除外键列[转] 数据库 database -> generate database ->format 设置为utf-8 PowerDesi ...
- Oracle 查询表的索引包含的字段
Oracle 查询表的索引包含的字段 select a.uniqueness 索引类型,b.index_name 索引名称,b.column_name 字段 from user_indexes a , ...
随机推荐
- MYSQL的硬盘IO过高引起的CPU过高判断
其实,为客户提供相关日志,不就是RACKSPACE主要作的事? 俺们以后也可以效仿的.不要去解决,而是协助客户定位. http://blog.const.net.cn/a/17275.htm 上文的思 ...
- InstallShield limited edition 生成单个 setup.exe 安装文件
1.vs里选中当前Setup项目, 2.在vs工具栏中"配置管理器"的下拉列表里,把"Debug"改为"SingleImage" 3.重新编 ...
- 高效算法——Most financial institutions 贪心 H
H - 贪心 Crawling in process... Crawling failed Time Limit:3000MS Memory Limit:0KB 64bit IO Fo ...
- Introduction to Glide, Image Loader Library for Android, recommended by Google
In the passed Google Developer Summit Thailand, Google introduced us an Image Loader Library for And ...
- [Locked] Paint House I & II
Paint House There are a row of n houses, each house can be painted with one of the three colors: red ...
- lightoj 1291 无向图边双联通+缩点统计叶节点
题目链接:http://lightoj.com/volume_showproblem.php?problem=1291 #include<cstdio> #include<cstri ...
- Let it Bead
http://poj.org/problem?id=2409 // File Name: poj2409.cpp // Author: bo_jwolf // Created Time: 2013年1 ...
- JavaScript笔记(一),
加法函数 javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显 //调用:accAdd(arg1,arg2) //返回值:arg1加上arg2的精确结果 function accA ...
- mysql主从复制 详解
转自 http://blog.csdn.net/m582445672/article/details/7731565 实践: http://shiyanjun.cn/archives/584.html ...
- Struts2 入门(新手必看)
船舶停靠在港湾是很安全的,但这不是造船的目的 Struts 2及其优势 Struts 2是一个MVC框架,以WebWork框架的设计思想为核心,吸收了Struts 1的部分优点 Struts ...