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: about sequence in oracle

Re: about sequence in oracle

From: Brian Peasland <oracle_dba_at_qwest.net>
Date: Wed, 22 Aug 2001 12:39:18 GMT
Message-ID: <3B83A7F6.DB306E5F@qwest.net>


As has been talked about numerous times in this newsgroup....

There is only way to ensure that an ALTER SEQUENCE INCREMENT BY and a SELECT NEXTVAL will be one atomic operation. In a system where accessing the sequence occurs quite frequently, you run the risk of someone selecting NEXTVAL before you do so you can have your sequence decremented by 31372 (15686*2). So either drop the sequence and recreate it. Or, if you want to use the ALTER SEQUENCE command, startup the database in restricted mode, alter the sequence, and then open the database.

HTH,
Brian

Honza Pazdziora wrote:
>
> On 14 Aug 2001 09:21:56 -0700, David Fitzjarrell <oratune_at_msn.com> wrote:
>
> > there is no such ALTER SEQUENCE ... START WITH ... option. And, for
> > large discrepancies [starting value of 1, current value 15687] it is
> > far easier to drop and recreate the sequence with the proper starting
> > value than it would be to run through 15686 iterations with a negative
> > increment.
>
> Just do one iteration with increment -15686.
>
> --
> ------------------------------------------------------------------------
> Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
> .project: Perl, mod_perl, DBI, Oracle, auth. WWW servers, XML/XSL, ...
> Petition for a Software Patent Free Europe http://petition.eurolinux.org
> ------------------------------------------------------------------------
Received on Wed Aug 22 2001 - 07:39:18 CDT

Original text of this message

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