如何查询Oracle数据库以显示Oracle数据库中所有表的名称?


当前回答

下面是一个注释的SQL查询片段,描述了如何使用选项:

-- need to have select catalog role
SELECT * FROM dba_tables;

-- to see tables of your schema
SELECT * FROM user_tables;

-- tables inside your schema and tables of other schema which you possess select grants on
SELECT * FROM all_tables;

其他回答

为当前用户选择表的简单查询:

  SELECT table_name FROM user_tables;

当前用户登录模式中的表

select * from tabs;

我找不到一个有用的答案

DBA_ALL_TABLES (ALL_ALL_TABLES/USER_ALL_TABLES)

所以决定加上我的版本。 这个视图实际上返回比DBA_TABLES更多的数据,因为它也返回对象表(http://docs.oracle.com/cd/E11882_01/server.112/e40402/statviews_1003.htm)。

试试下面的数据字典视图。

tabs
dba_tables
all_tables
user_tables

下面是一个注释的SQL查询片段,描述了如何使用选项:

-- need to have select catalog role
SELECT * FROM dba_tables;

-- to see tables of your schema
SELECT * FROM user_tables;

-- tables inside your schema and tables of other schema which you possess select grants on
SELECT * FROM all_tables;