Method: Use "SELECT 'DELETE FROM '|| table_name || ';' FROM USER_TABLES ORDER BY TABLE_NAME;" to query; copy the query results and execute it again in the sql command window to delete all surface.
Delete all tables under a user in Oracle
General method:
First use sql query:
SELECT 'DELETE FROM '|| table_name || ';' FROM USER_TABLES ORDER BY TABLE_NAME;
Copy the query results and execute it again in the sql command window to delete all tables.
There is also a more comprehensive deletion:
Similar to the previous one, first use sql query:
select 'drop table '||table_name||';' from cat where table_type='TABLE' ORDER BY TABLE_NAME;
This query is the cat table , the number of query results will be greater than the previous one, because it contains tables starting with BIN$. There will be residues after deleting the tables in Oracle. If you want to delete these remaining tables, you must enter this query sql, and then Like the previous method
copy the query results and execute it again in the sql command window to delete all tables.
Recommended tutorial: "Oracle Tutorial"
The above is the detailed content of How to delete all tables under a user in oracle?. For more information, please follow other related articles on the PHP Chinese website!