If you need to drop all tables in the database with Oracle, here’s an easy way!
run this command:
select 'drop table ', table_name, 'cascade constraints;' from user_tables;
Then copy the output and run that as a sql script.
If you need to drop all tables in the database with Oracle, here’s an easy way!
run this command:
select 'drop table ', table_name, 'cascade constraints;' from user_tables;
Then copy the output and run that as a sql script.
Nice
This would drop all tables that belongs to user, not just one tablespace
When I run this, I get the following, but it didn’t drop the tables.
‘DROPTABLE’ TABLE_NAME ‘CASCADECONSTRAINTS;
———– —————————— ——————–
drop table WM_AGENT_TIMEOFFS cascade constraints;
drop table WM_MARKED_TIMES cascade constraints;
drop table WM_AGENT_STATES cascade constraints;
drop table WM_FIXED_STATES cascade constraints;
drop table WM_SUBSYSTEMS cascade constraints;
drop table WM_FORECAST_DATA cascade constraints;
drop table WM_SUBSYSTEM_GROUPS cascade constraints;
drop table WM_SCH_AUDIT_LOG cascade constraints;
drop table WM_AGENT_EVENTS cascade constraints;
drop table WM_CFG_AUDIT_INFO cascade constraints;
drop table WM_REPORT_TASKS cascade constraints;
132 rows selected.
SQL>
That just generates the SQL. You then copy/paste all the middle lines “drop table… constraints;” and run those as a sql script.
Super Idea. Really Helps, After Running this we can Drop Table Space
Thank you!
thnx alot dude
Thank you
Sensacional!! Muito obrigada!!!
How much clever Idea. So thanks.
Thank u
that’s clever! thanks
Leave a Reply