Oracle查询用户所有表
 
下面为您介绍的语句用于实现Oracle查询用户所有表,如果您对oracle
查询方面感兴趣的话,不妨一看。 www.2cto.com  
 
select * from all_tab_comments
-- 查询所有用户的表,视图等
 
select * from user_tab_comments  
-- 查询本用户的表,视图等
 
select * from all_col_comments
 
--查询所有用户的表的列名和注释.
 
select * from user_col_comments
-- 查询本用户的表的列名和注释
 
select * from all_tab_columns
--查询所有用户的表的列名等信息(详细但是没有备注).
 
select * from user_tab_columns
--查询本用户的表的列名等信息(详细但是没有备注).
 
--一般使用1:  www.2cto.com  
select t.table_name,t.comments from user_tab_comments t
 
--一般使用2:
select r1, r2, r3, r5
from (select a.table_name r1, a.column_name r2, a.comments r3
          from user_col_comments a),
       (select t.table_name r4, t.comments r5 from user_tab_comments t)
where r4 = r1
 
以上就是oracle查询用户所有表的语句介绍。
 
如何在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查询用户所有表的更多相关文章

  1. 【转】oracle查询用户表,函数,储存过程,

    ◆Oracle查询用户表空间:select * from user_all_tables ◆Oracle查询所有函数和储存过程:select * from user_source ◆Oracle查询所 ...

  2. Oracle 查询用户表信息,导入导出处理表空间不一致

    select table_name,tablespace_name from user_tables t; //查询用户默认表空间信息 SELECT t.* FROM USER_USERS t; 导入 ...

  3. Oracle查询用户权限

    Oracle查询用户权限 -- 确定角色的权限select * from role_tab_privs ;              包含了授予角色的对象权限select * from role_ro ...

  4. ORACLE 查询一个数据表后通过遍历再插入另一个表中的两种写法

    ORACLE 查询一个数据表后通过遍历再插入另一个表中的两种写法 语法 第一种: 通过使用Oracle语句块  --指定文档所有部门都能查看 declare cursor TABLE_DEPT and ...

  5. oracle删除用户所有表

    在删除数据表的时候往往遇到外键约束无法删除的情况,我们可以通过以下几步将数据库表删除,建议在删除库之前先对数据库进行备份,养成良好习惯. 1.删除外键 --查询用户所有表的外键,owner条件为use ...

  6. 查找oracle自己用户的表

    查找oracle自己用户的表 select table_name from user_tables;

  7. oracle查询某张表的外键,并用 truncate 命令有外键的表中的数据

    注:本文来源于<oracle查询某张表的外键(最终解决办法)> 一:几个查询表外键的脚本 select b.table_name, b.column_name from user_cons ...

  8. oracle删除用户及其表空间

    oracle删除用户及其表空间 删除表空间:可以先将其offlinealter tablespace xx offline;将磁盘上的数据文件一同删除drop tablespace xxx inclu ...

  9. Oracle创建用户、表(1)

    Oracle创建用户.表(1) 1. 连接 C:\Users\LEI>sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on ...

随机推荐

  1. python基础:6.python最大的递归层数

    python解释器版本:3.7 def recursion(n): print(n) n += 1 recursion(n) recursion(1) # maximum recursion dept ...

  2. Thymeleaf 基本用法总结

    Thymeleaf 基本用法总结 一.引用命名空间 <html xmlns:th="http://www.thymeleaf.org"> 在html中引入此命名空间,可 ...

  3. jQuery中keyup() 和 keydown()方法

    kuydown()方法与上方用法一样:一个按键松开执行代码,一个按键按下执行.

  4. uwsgi部署django项目

    一.更新系统软件包 yum update -y 二.安装软件管理包及依赖 yum -y groupinstall "Development tools" yum install o ...

  5. PHP curl_multi_exec函数

    curl_multi_exec — 运行当前 cURL 句柄的子连接 说明 int curl_multi_exec ( resource $mh , int &$still_running ) ...

  6. Buuctf | BUU LFI COURSE 1

    跟着赵师傅学CTF,这里是我的学习记录 ?file=/flag ?file=/var/log/nginx/access.log :包含ngnix的日志记录 在user-agent里面插入 :bbbbb ...

  7. vim如何达到高效

    参考:http://blog.jobbole.com/44891/ 搜索技巧 1. 使用*快速查询当前光标所在的单词 然后使用n快速找到下一个查询结果: 使用N快速找到上一个查询结果 2. 在.vim ...

  8. HBase 中加盐之后的表如何读取:Spark 篇

    在 <HBase 中加盐之后的表如何读取:协处理器篇> 文章中介绍了使用协处理器来查询加盐之后的表,本文将介绍第二种方法来实现相同的功能. 我们知道,HBase 为我们提供了 hbase- ...

  9. A Bite Of React(1)

    react: component and views : produce html abd add them on a page( in the dom) <import React from ...

  10. Scrapy框架: 通用爬虫之CSVFeedSpider

    步骤01: 创建项目 scrapy startproject csvfeedspider 步骤02: 使用csvfeed模版 scrapy genspider -t csvfeed csvdata g ...