How to get list of table names in different schema of an Oracle database
How to get list of table names in different schema of an Oracle database
435
17-Jul-2023
Updated on 18-Jul-2023
Aryan Kumar
18-Jul-2023Sure, here is how you can get the list of tables names in different schemas of an Oracle database:
SQL
This query will first select all tables from the
all_tablesview. Theall_tablesview is a data dictionary view that contains information about all of the tables in the database.The next part of the query uses the
INoperator to check if the owner of each table in theall_tablesview is equal to one of the specified schemas. TheINoperator takes a list of values as its argument. In this case, the list of values is the list of schemas that you want to list the tables for.If the
INoperator returnsTRUEfor a table, then the table in theall_tablesview belongs to one of the specified schemas.The final part of the query selects the
table_namecolumn from theall_tablesview for all tables that belong to one of the specified schemas.To run this query, you will need to connect to the Oracle database using a tool like SQLPlus. Once you are connected, you can run the query by typing it into the SQLPlus prompt.
For example, to run the query above, you would type the following into the SQL*Plus prompt:
SQL
This would return a list of all tables in the specified schemas.