Message-Id: <10633.118181@fatcity.com> From: Mosy Lo Date: Thu, 28 Sep 2000 14:58:54 -0400 Subject: RE: Export Sequences from a database Thanks very very much for all your time. I got the sequences import to the new db with Raj's script. -----Original Message----- From: Jamadagni, Rajendra [mailto:rajendra.jamadagni@espn.com] Sent: Thursday, September 28, 2000 11:06 AM To: Multiple recipients of list ORACLE-L Subject: RE: Export Sequences from a database Import Sequences with current value ... SELECT 'DROP SEQUENCE ' || SEQUENCE_NAME || ' ;' from ALL_SEQUENCES WHERE SEQUENCE_OWNER = UNION ALL select 'CREATE SEQUENCE ' || SEQUENCE_NAME || ' INCREMENT BY ' || INCREMENT_BY || ' START WITH ' || to_char(LAST_NUMBER+1) || ' MINVALUE ' || to_char(MIN_VALUE) || Decode(LENGTH(TO_CHAR(MAX_VALUE)), 27, '', ' MAXVALUE ' || TO_CHAR(MAX_VALUE) ) || Decode(CYCLE_FLAG, 'N', ' NOCYCLE', 'Y', ' CYCLE' ) || Decode(CACHE_SIZE, 0, ' NOCACHE', ' CACHE ' || TO_CHAR(CACHE_SIZE) ) || Decode(ORDER_FLAG, 'N', ' NOORDER', 'Y', ' ORDER' ) || ';' from ALL_SEQUENCES where SEQUENCE_OWNER = Import Sequences with start value as 1 SELECT 'DROP SEQUENCE ' || SEQUENCE_NAME || ' ;' from ALL_SEQUENCES WHERE SEQUENCE_OWNER = UNION ALL select 'CREATE SEQUENCE ' || SEQUENCE_NAME || ' INCREMENT BY ' || INCREMENT_BY || ' START WITH 1' || Decode(LENGTH(TO_CHAR(MAX_VALUE)), 27, '', ' MAXVALUE ' || TO_CHAR(MAX_VALUE) ) || Decode(CYCLE_FLAG, 'N', ' NOCYCLE', 'Y', ' CYCLE' ) || Decode(CACHE_SIZE, 0, ' NOCACHE', ' CACHE ' || TO_CHAR(CACHE_SIZE) ) || Decode(ORDER_FLAG, 'N', ' NOORDER', 'Y', ' ORDER' ) || ';' from ALL_SEQUENCES where SEQUENCE_OWNER = HTH Raj ______________________________________________________ Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com QOTD: Any clod can have facts, but having an opinion is an art ! Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify ESPN at (860) 766-2000 and delete this e-mail message from your computer, Thank you. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jamadagni, Rajendra INET: rajendra.jamadagni@espn.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may