Clean up your mess with following command

SELECT 'drop table ' || table_name || ' cascade constraints;'
FROM user_tables

Then, copy the resulting text script into sql console, and execute it. Voila!

 

For More VOILA!!!
Clean all sequences, triggers, tables

BEGIN

  --Bye Sequences!
  FOR i IN (SELECT us.sequence_name
              FROM USER_SEQUENCES us) LOOP
    EXECUTE IMMEDIATE 'drop sequence '|| i.sequence_name ||'';
  END LOOP;

  --Bye Triggers!
  FOR i IN (SELECT utr.trigger_name
              FROM USER_TRIGGERS utr) LOOP
    EXECUTE IMMEDIATE 'drop trigger '|| i.trigger_name ||'';
  END LOOP;


  --Bye Tables!
  FOR i IN (SELECT ut.table_name
              FROM USER_TABLES ut) LOOP
    EXECUTE IMMEDIATE 'drop table '|| i.table_name ||' CASCADE CONSTRAINTS ';
  END LOOP;

END;


That’s all, Folks!

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Written by Fikri Akbarsyah Anza, M.Kom

Lecturer