Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Copying sequence IDS from one db to another.

Re: Copying sequence IDS from one db to another.

From: Joel Garry <joelga_at_pebble.org>
Date: Thu, 13 Aug 1998 22:56:23 GMT
Message-ID: <slrn6t6rp6.3ns.joelga@pebble.org>


On Thu, 13 Aug 1998 16:12:08 GMT, seanm_at_rocketmail.com <seanm_at_rocketmail.com> wrote:
>
>
>Help,
>
>We have an application which uses Sequences. Now, is there a way of
>copying current (or nextvals) into an new oracle database.
>
>Example: We have setup an environment, used the application to create data
>(using a Sequence), this increments the sequence and writes the row.
>
>Now if we need to copy the environment (using imp/exp), the sequences
>get created, but are set to there initial value.

Are you sure they don't start with the beginning of the next cache? Anyway, the way to make the sequence any particular value is to create it and use the START WITH syntax.

>
>So, how (dynamicly) can I extract ALL sequence currval from the old database
>and place them into the new one.

I just use exp what/ever ROWS=N COMPRESS=Y FILE=whatever_table_defs.dmp and just grep for SEQUENCE, then edit it to my hearts content.

To be more correct, you would have to have code that actually gets a sequence, which of course will increment it. You would also have to NOCACHE your sequences. I'm wondering if you think they are being set to the initial value because of cacheing - try using larger numbers of sequences in your testing (cache default is 20).

>

 in advance for any help you can give.
>
>s e a n
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

jg
--
These opinions are my own and not necessarily those of Information Quest or Pebble In The Sky http://www.informationquest.com mailto:jgarry@nospameiq.com http://ourworld.compuserve.com/homepages/joel_garry Remove nospam to reply. mailto:joel_garry_at_compuserve.nospam.com "See your DBA?" I AM the @#%*& DBA! Received on Thu Aug 13 1998 - 17:56:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US