[ORACLE] 모든 테이블 삭제 및 시퀀스 삭제

2013. 10. 8. 15:07Database/Oracle

테이블 삭제

Begin
for c in (select table_name from user_tables) loop
  execute immediate 'drop table '||c.table_name||' cascade constraints';
end loop;
End;


시퀀스 삭제

Begin
for c in (SELECT * FROM all_sequences WHERE SEQUENCE_OWNER='DBUSER') loop
  execute immediate 'drop SEQUENCE '||c.sequence_name;
end loop;
End;