Very useful information - and all in one place! Thanks.
I often use these techniques in combination with spooling to generate actual scripts.
By inserting literal SQL code and concatenating with output from queries, very powerful scripts can be generated automatically.
set head off
set pages 0
set trims on
set lines 2000
set feed off
set echo off
set serveroutput on
select 'CREATE SEQUENCE ' || SEQUENCE_NAME || ' INCREMENT BY 1 START WITH ' ||
to_char(LAST_NUMBER+1) || ' MINVALUE 1 NOCYCLE CACHE 20 NOORDER;' from
will generate the file sequences.sql that contains ready to run statements to re-create the sequences.
-- (February 10, 2004)
on Reverse Engineering a Data Model