Oracle equivalent of information_schema.tables

Arun picture Arun · Mar 7, 2019 · Viewed 7.5k times · Source

I get a "table or view does not exist" error while I try to execute the query below in Oracle:

SQL QUERY

SELECT table_type,
       table_name
FROM information_schema.tables
WHERE table_rows >= 1;

ERROR

ORA-00942: table or view does not exist

How do we query metadata about tables in Oracle?

Answer

Mureinik picture Mureinik · Mar 7, 2019

Oracle indeed doesn't provide the information_schema views, but has its own data dictionary. You can use all_tables to create a similar query:

SELECT *
FROM   all_tables
WHERE  num_rows > 1