How to list all tables in a schema in Oracle SQL?
How to list all tables in a schema in Oracle SQL?
24617-Jul-2023
Updated on 18-Jul-2023
Home / DeveloperSection / Forums / How to list all tables in a schema in Oracle SQL?
How to list all tables in a schema in Oracle SQL?
Aryan Kumar
18-Jul-2023Sure, here is how you can list all tables in a schema in Oracle SQL:
SQL
This query will select all tables in the current user's schema. The
user_tables
view is a data dictionary view that contains information about all of the tables in the schema.The
table_name
column contains the name of the table.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 current user's schema.
You can also use the
all_tables
view to list all tables in the database, including tables that are owned by other users.Here is the syntax for the
all_tables
view:SQL
To run this query, you will need to have the
DBA
role or be granted theSELECT
privilege on theall_tables
view.