Wednesday, June 17, 2009

gen_drop_sequences.sql

SET PAGES 0 TRIMS ON ECHO OFF VERIFY OFF FEEDBACK OFF

PROMPT
PROMPT ***** Drop All Sequences *****
PROMPT

SPOOL drop_sequences.sql

SELECT 'SET ECHO ON TIME ON' FROM dual;
SELECT 'SPOOL drop_sequences.log' FROM dual;
SELECT '' FROM dual;

SELECT 'DROP SEQUENCE ' || sequence_owner ||'.'|| sequence_name ||';'
FROM dba_sequences
WHERE sequence_owner = '&1'
/

SELECT '' FROM dual;
SELECT 'SPOOL OFF' FROM dual;
SELECT 'SET ECHO OFF TIME OFF' FROM dual;

SPOOL OFF
SET PAGES 999 TRIMS ON ECHO OFF VERIFY ON FEEDBACK ON

PROMPT
PROMPT ******************************
PROMPT
PROMPT Output saved at drop_sequences.sql
PROMPT