资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

oracle的表名怎么看,oracle查看表名称

如何在oracle中查询所有用户表的表名、主键名称、索引、外键等

1、查找表的所有索引(包括索引名,类型,构成列):

创新互联是专业的冷水滩网站建设公司,冷水滩接单;提供做网站、网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行冷水滩网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

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、查询表的所有列及其属性

如何查看oracle数据库表名称

使用具有dba权限的帐号登录数据库

执行命令"select username from dba_users"

官方文档对dba_users的定义:DBA_USERS describes all users of the database.因此可以如此查询。

oracle 怎样查询某用户下的所有表的表名

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 --查询本用户的表的列名等信息。

扩展资料

ORACLE下有三个视图

DBA_TABLES  拥有DBA角色的用户可以查看系统中的所有表

USER_TABLES 登录数据库的当前用户拥有的所有表

ALL_TABLES 登录数据库的当前用户有权限查看的所有表

参考资料:百度百科-Oracle

oracle下怎么查看数据库表名

SELECT * FROM ALL_TABLES;系统里有权限的表

SELECT * FROM DBA_TABLES; 系统表

SELECT * FROM USER_TABLES; 当前用户下的表

oracle 怎样查询某用户下的所有表的表名?

解决方法:

1、dba_tables(在dba权限下可查)  SQL conn / as sysdba  Connected.

SQL select count(*) from dba_tables where owner='TEST';

COUNT(*)

52

注:表名以及各详细内容可以通过desc dba_tables查看相应字段,在查询相应内容。

2、all_tables(在dba权限下可查) SQL conn / as sysdba Connected.

SQL select count(*) from all_tables where owner='TEST';

COUNT(*)

52

SQL

注:表名以及各详细内容可以通过desc all_tables查看相应字段,在查询相应内容。

3、user_tables(当前用户下可查) SQL conn test/test  Connected.

SQL select count(*) from user_tables;

COUNT(*)

52

SQL conn matchhr/matchhr  Connected.

SQL select count(*) from user_tables;

COUNT(*)

28

SQL

注:表名以及各详细内容可以通过desc user_tables查看相应字段,在查询相应内容。


新闻名称:oracle的表名怎么看,oracle查看表名称
标题链接:http://cdkjz.cn/article/dsiojgh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220