-2

On a db oracle we have system tables created by oracle and our tables created by us. I want to see our tables on postgresql I use

\d

on mysql

show tables;

And on oracle for a similar output?

3

To list all tables owned by the current user, type:

select tablespace_name, table_name from user_tables;

To list all tables in a database:

select tablespace_name, table_name from dba_tables;

To list all tables accessible to the current user, type:

select tablespace_name, table_name from all_tables;

You can find more info about views all_tables, user_tables, and dba_tables in Oracle Documentation. To describe a table, type:

desc <table_name>

SHOW TABLES displays all of the tables in the current schema.

If IN schemaName is specified, the tables in the given schema are displayed.

show tables;
0
0

You could do this:

select owner,
       table_name
from dba_tables
where owner not in ('SYS',
                    'SYSTEM')
order by owner,
         table_name
;

But there is no guarantee someone hasn't (foolishly) created tables under SYS or SYSTEM schemas. That aside, there are several other schemas that are created with the database, and the list may vary with the installation/creation options chosen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.