oracle怎么看表名,oracle怎么看有哪些表-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

oracle怎么看表名,oracle怎么看有哪些表

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

select * from all_tab_comments -- 查询所有用户的表,视图等。

创新互联建站主营零陵网站建设的网络公司,主营网站建设方案,手机APP定制开发,零陵h5小程序开发搭建,零陵网站营销推广欢迎零陵等地区企业咨询

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 怎样查询某用户下的所有表的表名?

解决方法:

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中查询所有用户表的表名、主键名称、索引、外键等

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

oracle里查出某个数据库里的所有表名

方法和详细的操作步骤如下:

1、第一步,

MySQL数据库使用特定字段查询所有表名,代码见下图,转到下面的步骤。

2、第二步,执行完上面的操作之后,Oracle数据库使用特定字段查询所有表名,代码见下图,转到下面的步骤。

3、第三步,执行完上面的操作之后,SQLServer数据库使用特定字段查询所有表名,代码见下图,转到下面的步骤。

4、第四步,执行完上面的操作之后,操作完成,见下图。这样,就解决了这个问题了。


本文标题:oracle怎么看表名,oracle怎么看有哪些表
本文网址:http://kswsj.cn/article/dsghojs.html

其他资讯