Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence missing values
fumi wrote:
> Phil Britton ¼¶¼g©ó¤å³¹ <361cc5ca.21219522_at_pub.news.uk.psi.net>...
> >We're using a single sequence within a schema that is called in
> >various procedures that are run to set up a database. THe sequence is
> >owned by the schema and only one session is running on this schema.
> >After the procedures have been run it appears that the sequence has
> >been missing certain values. e.g a value that we had expected to be
> >1001 is actually 1009. The jump seems to be random. Does anyone have
> >*any* idea what could be causing this. Apart from the obvious ones
> >like somebody else getting the nextval, which is not happening.
>
> One possibility is the misuse of NEXTVAL and CURRVAL.
> Query the nextval once, and then query the currval during your
> procedures, you will get the same number.
>
> Hope this help!
If you are using parallel Oracle you need to use NOCACHE -option in your sequence if you want to get the values in the right order, otherwise you might first get values from instance1 like 1, 2, 3 and then from instance2 like 10, 11, 12 and then again from instance1 like 4, 5, 6 and so on.
Regards,
Maija-Leena Received on Mon Oct 12 1998 - 02:28:58 CDT