易截截图软件、单文件、免安装、纯绿色、仅160KB

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 = 要查询的表


相关文档:

Oracle DBA职责及日常工作分析

DBA 职责及日常工作职责:
    1.安装和升级数据库服务器,以及应用程序工具构建和配置网络环境.
    2.熟悉数据库系统的存储结构预测未来的存储需求,制订数据库的存储方案.
    3.根据开发人员设计的应用系统需求创建数据库存储结构.
    4.根据开发人员设 ......

Oracle 行级锁的开销

首先来复习一下行级锁的机制。当一个事务开始时必选先申请一个TX锁(保护回滚段、回滚数据块),只有先申请到回滚段资源后才能开始一个事务,才能进行DML操作。这个动作完成后,事务就可以开始修改数据了。当修改数据表的记录时,遵循以下的操作顺序。
1.获得表的TM锁(保护事务执行过程中其它用户不能修改表结构)
2.在 ......

oracle列转行方法总结

方法一:
----------------------------------------------------------------
---Muti-row to line(col2row)
----------------------------------------------------------------
create or replace type str_tab is table of varchar2(20);
/
grant all on str_tab to public;
create public synonym str_tab for ......

oracle 存储过程和函数学习笔记

oracle 存储过程和函数学习笔记
1、创建过程的语法:     
Code
create [or replace] procedure procedure_name
  [(argument[{in|out|in out}] type,
    
   argument[{in|out|in out}] type)]&n ......

卸载oracle的步骤(笔记)

今天重新整理电脑,找到一个文件,看了下日期(2006.11.3) ,怕不小心再丢了,存到网上来晒晒。
1.HKEY_LOCAL_MACHINE
  HKEY_LOCAL_MACHINE
  SOFTWARE
  ORACLE
2.HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services
3.重新启动机器.
create role  a  identified  by passwor ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号