1 1、查找表的所有索引(包括索引名,类型,构成列):
2
3 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 = 表名
4 2、查找表的主键(包括名称,构成列):
5 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 = 表名
6 3、查找表的唯一性约束(包括名称,构成列):
7 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 = 表名
8 4、查找表的外键(包括名称,引用表的表名和对应的键名,下面是分成多步查询):
9 select * from user_constraints c where c.constraint_type = 'R' and c.table_name = 表名
10 外键约束的列名:
11 select * from user_cons_columns cl where cl.constraint_name = 外键名称
12 引用表的键的列名:
13 select * from user_cons_columns cl where cl.constraint_name = 外键引用表的键名
14 5、查询表的所有列及其属性:
15 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 = 表名

oracle 查询数据库的约束条件的更多相关文章

  1. Oracle查询数据库中所有表的记录数

    1.Oracle查询数据库中所有表的记录数,但是有可能不准建议用第二种方式进行查询 select t.table_name,t.num_rows from user_tables t 2.创建orac ...

  2. ORACLE查询数据库的锁表情况

      查询数据库的锁表情况语句如下: SELECT p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_na ...

  3. oracle 查询数据库的各种命令

    以下查询都是使用plsql查询oracle 11g 1.查询数据库版本信息 select * from v$version; 2.查询数据库优化模式 select name, value from v ...

  4. SQLSERVER 和 ORACLE 查询数据库文件大小

    SQLSERVER: SQLSERVER一个库的文件分为数据文件(行数据)和日志文件两个文件,详情可以在数据库的属性->文件中查看. 在资源管理器中打开文件所在路径可以直接看到这两个文件 但是, ...

  5. oracle查询数据库资源位置

    archival log list; 归档日志文件位置 select file_name from dba_data_files; 查询数据库文件位置 select parameter control ...

  6. oracle 查询数据库表空间大小和剩余空间

    dba_data_files:数据库数据文件信息表.可以统计表空间大小(总空间大小). dba_free_space:可以统计剩余表空间大小. 增加表空间即向表空间增加数据文件,表空间大小就是数据文件 ...

  7. oracle查询数据库最大连接数等信息

    .当前的数据库连接数 select count(*) from v$process where program='ORACLE.EXE(SHAD)'; .数据库允许的最大连接数 select valu ...

  8. oracle 查询数据库锁及锁处理

    1.数据库锁表查询语句: SELECT SESS.SID, SESS.SERIAL#, LO.ORACLE_USERNAME, LO.OS_USER_NAME, AO.OBJECT_NAME 被锁对象 ...

  9. oracle(查询数据库对象1)

    1 --查询表信息 2 xxx_tables--包含表的基本描述信息和统计信息 3 xxx_tab_columns--包含表中列的描述信息和统计信息 4 xxx_all_tables--包含当前数据库 ...

随机推荐

  1. AD软件使用心得

    1.在更新原理图之前一定要标记所有器件,否则无法生成PCB器件. 2.学会用sch list网表来批量修改器件名称 3.布线的面

  2. Linux centos 防火墙篇

    防火墙的关闭 service iptables stop 永久关闭 chkconfug iptables off 查看状态 service iptables status

  3. js获取网页面的高度和宽度

    网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth ...

  4. list vector map set (转)

    List封装了链表,Vector封装了数组, list和vector得最主要的区别在于vector使用连续内存存储的,他支持[]运算符,而list是以链表形式实现的,不支持[]. Vector对于随机 ...

  5. CCSprite使用记录

    CCSprite使用需要CCTexture2D,就是需要纹理.可以设置绘制纹理的区域. CCSprite 有 draw方法 ,由CCDirector/mainLoop()调用(当前使用的场景为根,向下 ...

  6. 修改输入框placeholder的样式

    1. h5页面: //修改placeholder 样式 (chrome,其余类似加前缀) ::-webkit-input-placeholder { color:rgba(21,30,38,0.35) ...

  7. mysql每组前N条

    SELECT * from ( select end rownum, else @prov:=t.province end prov, t.* from ( money UNION all money ...

  8. LOJ #2183「SDOI2015」序列统计

    有好多好玩的知识点 LOJ 题意:在集合中选$ n$个元素(可重复选)使得乘积模$ m$为$ x$,求方案数对$ 1004535809$取模 $ n<=10^9,m<=8000且是质数,集 ...

  9. Invalid bound statement (not found) 找不到mapper 映射文件异常

    访问页面报如下错(注意第一行后面的 invalid bound statement (not found)) 这时候再mapper的pom.xml文件要加如下. 否则该节点mybatis的mapper ...

  10. django 学习手册 - ORM 报错集(随时更新)

    报错问题: 问题一:(1050代码) django.db.utils.InternalError: (1050, "Table 'app01_group' already exists&qu ...