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

Home -> Community -> Usenet -> c.d.o.misc -> Re: sequence #'s skipping

Re: sequence #'s skipping

From: Howard Hyde <hhyde_at_us.oracle.com>
Date: 1997/12/15
Message-ID: <3495EEAE.7E2B6680@us.oracle.com>#1/1

Sequence numbers are cached in the database's SGA for fast retrieval. Once read from physical disk to volatile memory, they are implicitly 'used'.

The number of sequence values that are cached is determined by the CACHE clause of the CREATE SEQUENCE command that created the sequence in the first place. Your sequence was evidently created with a cache value of 20.

If you don't want to lose sequence numbers, don't cache them:

CREATE SEQUENCE MySequence NOCACHE;

This could impair performance, however, if you are calling for sequence values frequently, as each call to NEXTVAL requires a disk read.

Best Regards,

Howard Hyde



Information and views are mine and do not necessarily reflect those of Oracle Corporation.

Steve Lehrfeld wrote:

> we found that Oracle 7 skips sequence #'s after it has been reset. It
> always rounds to the nearest twenty, i.e. 10001, 10002, <reset>, 10020,
> 10021, 10022, <reset>, 10040, etc.
>
> Does anyone know why it does this and how to prevent it?
>
> -steve
Received on Mon Dec 15 1997 - 00:00:00 CST

Original text of this message

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