How to view the tables created in Oracle using SQL?
In Oracle database, there are two methods available to view the tables that have been created.
- Utilize the SQL*Plus command line tool:
- Open the terminal or command prompt window, and enter the following command to log in to the Oracle database:
sqlplus username/password@hostname:port/service_nameIn this command, username is your database username, password is the corresponding password, hostname is the host name or IP address of the database server, port is the port number of the database listener, and service_name is the name of the database service.
- After successfully logging in, you can use the following SQL statement to view a list of all tables:
SELECT table_name FROM user_tables;This will display the names of all tables under the current user’s schema.
- To view tables owned by other users, you can use the following SQL statement:
SELECT table_name FROM all_tables WHERE owner = ‘username’;Replace ‘username’ with the username of the user whose tables you want to view.
- Utilizing Oracle SQL development tools (such as Oracle SQL Developer):
- Open the SQL development tool and log in to the database using the correct connection information.
- Within the interface of the tool, you can locate a tab or panel labeled “Tables” (or similar) that allows you to view all tables in the database. Please refer to the respective tool’s documentation or help files for specific instructions as the operating methods may vary.
No matter which method you use, you can view the list of tables that have been created.