oracle delete all the tables under a user


General approach:
first use sql query:

SELECT 'DELETE FROM '|| table_name || ';' FROM USER_TABLES ORDER BY TABLE_NAME;

The results replicate it in sql command window to perform once again delete all the tables.

There is a more comprehensive delete:
and a similar upper, first using sql query:

select 'drop table '||table_name||';' from cat where table_type='TABLE' ORDER BY TABLE_NAME;

This query is cat table, the result will be greater than the number of queries on one of which contains a table because BIN $ beginning, there will be residual after the oracle delete table, if you want to delete these remaining tables are also necessary in this sql query, and then on a method like the same

The results replicate it in sql command window to perform once again delete all the tables.
----------------
Disclaimer: This article is CSDN blogger "Fox's yi Pakistan 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/jiuweihu521/article/details/81115801

Guess you like

Origin www.cnblogs.com/nietzsche2019/p/11773034.html