Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Autonumber in a Sequence after Export/Import

496733Nov 20 2006 — edited Nov 20 2006
Hi,

I have a sequence running in a DB, which increments an ID field. The problem comes up, when I need to backup/restore the DB. What I need then is a SQL script, which would allow me to set the MinValue to the max used value +1 (or + 100). Unfortunately something like

Create Sequence XXX.Mytable

Increment by 1

MinValue (SELECT MAX(COUNTERID) from XXX.Mytable);

MaxValue 1E+27

Cache 20;

does not work. So what is best practise to handle this case. I found many people posting this question, but no simple answer. Does anybody have one?

Thank you in advance

Pawel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2006
Added on Nov 20 2006
3 comments
195 views