Get list of all tables in Oracle?

2018-12-31 17:10发布

How do I query an Oracle database to display the names of all tables in it?

标签: sql oracle
19条回答
只若初见
2楼-- · 2018-12-31 17:20

With any of those, you can select:

SELECT DISTINCT OWNER, OBJECT_NAME 
    FROM DBA_OBJECTS 
    WHERE OBJECT_TYPE = 'TABLE' AND OWNER='SOME_SCHEMA_NAME';

SELECT DISTINCT OWNER, OBJECT_NAME 
    FROM ALL_OBJECTS 
    WHERE OBJECT_TYPE = 'TABLE' AND OWNER='SOME_SCHEMA_NAME';
查看更多
若你有天会懂
3楼-- · 2018-12-31 17:22

Oracle database to display the names of all tables using below query

SELECT owner, table_name FROM dba_tables;

SELECT owner, table_name FROM all_tables;

SELECT table_name FROM user_tables;

vist more : http://www.plsqlinformation.com/2016/08/get-list-of-all-tables-in-oracle.html

查看更多
梦醉为红颜
4楼-- · 2018-12-31 17:24

There exists 3 datadictinary for this

DBA_TABLES describes all relational tables in the database.

SELECT owner, table_name
  FROM dba_tables

Description of relational tables accessible to the user

SELECT owner, table_name
  FROM all_tables

USER_TABLES describes the relational tables owned by the current user. This view does not display the OWNER column.

SELECT table_name
  FROM user_tables
查看更多
孤独总比滥情好
5楼-- · 2018-12-31 17:27

We can get all tables including column details from below query:

SELECT * FROM user_tab_columns;
查看更多
泪湿衣
6楼-- · 2018-12-31 17:28

Try selecting from user_tables which lists the tables owned by the current user.

查看更多
人间绝色
7楼-- · 2018-12-31 17:28
select * from dba_tables

gives all the tables of all the users only if the user with which you logged in is having the sysdba privileges.

查看更多
登录 后发表回答