Class 12_1 Get Table List From Oracle Schema

Today we are going to learn some of the following features.

Extracts Or Get List of Tables From Oracle Schema.

  • List down or Get the schema tables.

 

Let say you are a DBA, and you wanted to check that how many tables were created by HR Schema or User. You can check this by following two ways.

  • You can connect with HR Schema by providing HR User and Password in our case
    1. Conn HR/HR OR  Conn HR/HR@listener
    2. Then query the TAB table using following statement. (Select * from tab;).
  • You can connect to “Sys” user using Sysdba privileges.
    1. Conn sys/password as sysdba, Or, Conn sys/password as sysdba@listener
    2. Then you can run following query
      1. select * from dba_tables where owner=’HR’;

Using above mentioned method, you can list down the tables of HR Schema. You can use this query to extract any schema and their tables.

Examples:

---LIST TABLES OF HR USER/SCHEMA
SELECT * FROM DBA_TABLES X WHERE X.OWNER='SH';
SELECT * FROM DBA_TABLES X WHERE X.OWNER='SCOTT';

 

Related Post

The above mentioned screen of terminal / Sqlplus tells you how to check the tables that were created by HR schema.

Selecting dba_tables from oracle Directory via SQL Developer.

In this second view, you can check all columns of DBA_TABLES, the above picture has taken from Oracle SQL Developer.  However, you can see in this snap that we have used the same query as mentioned above for simple sqlplus but the only difference here is that here we are querying all columns of DBA_TABLES.

Have a look thoroughly on the TABLESPACE_NAME column, where one value appears null against COUNTRIES table_name. The first question that often arise in our mind that why Tablespace_name contains null values against any table? Does Countries table not have any Tablespace?  However, don’t worry it simply means this Countries tables contained by temporary tablespace.

I hope this will make you understand that how you can list down the table of any schema, and you can query the DBA_TABLE for further information regarding any table and its info.




  • Rameez

    Recent Posts

    Heart Attack Causes and its Solution

    What is the Main Cause of a Heart Attack? What is its Solution? A heart attack is the blockage of… Read More

    12 months ago

    Understanding the Debt Ceiling: Its Impact, Importance, and Implications

    In the vast economic arena, one term that often takes center stage, inciting extensive debates and discussions, is the "debt… Read More

    1 year ago

    De-Dollarization: The New World Order of Currency and Its Global Impact

    De-Dollarization: The Changing Face of Global Finance The financial landscape is in a state of flux, with an intriguing economic… Read More

    1 year ago

    Unstoppable Bayern Munich: The Story Behind Their 11th Consecutive Bundesliga Title

    The curtains closed on a dramatic Bundesliga season with Bayern Munich standing tall once again, clinching their 11th straight title.… Read More

    1 year ago

    Celine Dion Cancels Concert Tour Due to Deteriorating Stiff-Person Syndrome

    The Unfolding Story of Celine Dion's Health In recent news that has left fans across the globe stunned, iconic singer… Read More

    1 year ago

    Navigating the Crossroads: LeBron James, Anthony Davis, and the LA Lakers’ Uncertain Future

    As the echoes of the recent NBA season start to fade, the attention of enthusiasts is firmly glued to one… Read More

    2 years ago