Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP ! : sequence nextval
Brian wrote:
>
> I rebuilt a server & reinstalled the DB & many of the sequences were renewed
> back to thier initial value (1). I need to get them back up to the values
> they need to be.
>
> I am new to the DB programming environment. Using SQL*Plus at the command
> line how can I do this. I tried various versions of the nextval function
> (i.e. example from postings) but nothing works. The sequences are not used
> as primary keys but rather the are one field of a composite key.
>
> TIA,
>
> Brian
determine what the value you need to start the sequence at (eg.
max(your_id_column)+1 type of thing).
the following code creates your sequence from scratch:
create sequence sequence_name_here
start with 2236 (whatever your starting value is)
increment by 1
nomaxvalue
nocache
nocycle;
commit;
Make sure you re-use the sequence name (drop the original if so) if they are already referenced in your code, else name it however you like.
hth
Bricklen Received on Thu Apr 17 2003 - 10:26:02 CDT