Query method: 1. Use the "SELECT * FROM all_tables WHERE OWNER = 'username'" statement to query all table names of the specified user; 2. Use the "SELECT * FROM user_tables" statement to query the current All table names of the user.
The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.
Oracle queries all table names in the database
The first method
This method specifies the Oracle user name (that is, the schema in Oracle) for query, replace the * in the query condition with TABLE_NAME and only display the table name
-- DWD为用户名,用户名必须是大写,你填你的用户名 SELECT * FROM all_tables WHERE OWNER = 'DWD' -- 加 ORDER BY TABLE_NAME 是让结果按照表名顺序展示 SELECT * FROM all_tables WHERE OWNER = 'DWD' ORDER BY TABLE_NAME
Second method
View the table under the currently logged in user (mode), without specifying OWNER, replace the * in the query condition with TABLE_NAME and only display the table name
SELECT * FROM user_tables -- 加 ORDER BY TABLE_NAME 是让结果按照表名顺序展示 SELECT * FROM user_tables ORDER BY TABLE_NAME
Recommended tutorial : "Oracle Tutorial"
The above is the detailed content of How to query all table names in oracle database. For more information, please follow other related articles on the PHP Chinese website!