RE: sequences

  • From: "Zelli, Brian" <Brian.Zelli@xxxxxxxxxxxxxxx>
  • To: saurabh manroy <saurabhmanroy@xxxxxxxxx>
  • Date: Tue, 11 Mar 2014 14:58:29 +0000

That was exactly what I was thinking.  Just rebuild the sequence after the 
import and use that last value as the starting value.....


Brian


From: saurabh manroy [mailto:saurabhmanroy@xxxxxxxxx]
Sent: Tuesday, March 11, 2014 10:44 AM
To: Zelli, Brian
Cc: oracle-l (oracle-l@xxxxxxxxxxxxx)
Subject: Re: sequences

Hi Brian,

Hoping that your application can tolerate skipping some sequence values,
One simple way that I use to refresh sequences is :

1. Make note of the increment by value for sequence(s1) on source database.
2. Get last_number from dba_sequences at the source database for s1. 
Last_number will provide the last cached value.
3. Alter the sequence on destination database and set 'increment by'  to a 
value found in step 2.
4. Issue 'select s1.nextval from dual' to make sure that sequence moves to the 
expected value.
5. Change the increment by value back to the one identified in step 1.


Regards,
Saurabh Manroy


On Tue, Mar 11, 2014 at 3:05 PM, Zelli, Brian 
<Brian.Zelli@xxxxxxxxxxxxxxx<mailto:Brian.Zelli@xxxxxxxxxxxxxxx>> wrote:
I am exporting data from 10g to 11g and when we did it in test, the analyst 
said the sequences were out of whack.  I would then play around until I could 
get it close.  How do I deal with a sequence after it has been imported so it 
starts with the next value?


Brian



This email message may contain legally privileged and/or confidential 
information. If you are not the intended recipient(s), or the employee or agent 
responsible for the delivery of this message to the intended recipient(s), you 
are hereby notified that any disclosure, copying, distribution, or use of this 
email message is prohibited. If you have received this message in error, please 
notify the sender immediately by e-mail and delete this email message from your 
computer. Thank you.



This email message may contain legally privileged and/or confidential 
information.  If you are not the intended recipient(s), or the employee or 
agent responsible for the delivery of this message to the intended 
recipient(s), you are hereby notified that any disclosure, copying, 
distribution, or use of this email message is prohibited.  If you have received 
this message in error, please notify the sender immediately by e-mail and 
delete this email message from your computer. Thank you.

Other related posts: