show existing tables in database
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: show existing tables in database

  1. #1
    Join Date
    Nov 2001
    Posts
    27
    I usually work with MySQL databases. I need to move one of our web applications into an Oracle database. All I need to know is how I can display all existing tables in a database that I created.

    In MySQL all I have to type in is :

    SQL> show tables;

    It does not seem to be this simple in Oracle.
    Someone please help thank you.

  2. #2
    Join Date
    Sep 2001
    Location
    UK
    Posts
    45
    You can query either of the 2 data dictionary tables
    user_tables or all _tables depending on whether you want to see
    the tables you own or the tables you have access to

    SQL> select table_name from user_tables;

  3. #3
    Join Date
    Oct 2001
    Location
    Madrid, Spain
    Posts
    763
    Hi,

    In Oracle you can execute:

    > spool c:/tables.sql
    > SELECT OWNER,OBJECT_TYPE,OBJECT_NAME
    FROM DBA_OBJECTS
    WHERE OWNER NOT IN ('SYS','SYSTEM');
    > spool off

    This statement generate a file i.e tables.sql in drive c that contain all object in your database except that from users sys and system (superusers in Oracle).

    Hope this helps

  4. #4
    Join Date
    Nov 2001
    Posts
    27
    SQL> select table_name from user_tables;

    This syntax worked. But also what I found to work is this :

    SQL> select tname from tab;

    Thank you all for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width