Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> 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_at_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 = <OWNER_NAME>
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
Import Sequences with start value as 1
SELECT 'DROP SEQUENCE ' || SEQUENCE_NAME || ' ;'
from ALL_SEQUENCES
WHERE SEQUENCE_OWNER = <OWNER_NAME>
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
HTH
Raj
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_at_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_at_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 mayReceived on Thu Sep 28 2000 - 13:58:54 CDT
![]() |
![]() |