jumping sequences [message #352510] |
Wed, 08 October 2008 02:11 |
TeiMar71
Messages: 7 Registered: February 2001 Location: AUT
|
Junior Member |
|
|
Hi,
sometimes sequences on my oracle rdbms are raising the values by 20.
I can remember a note that i read some years ago. This note said, that after a db crash or shutdown/startup or recovery sequences are raised by 20.
But in my case the sequence raises without any of these actions.
Can anyone explain this behavior!?!?!?
Regards
Mario
|
|
|
|
Re: jumping sequences [message #352522 is a reply to message #352517] |
Wed, 08 October 2008 03:08 |
TeiMar71
Messages: 7 Registered: February 2001 Location: AUT
|
Junior Member |
|
|
No, i'm not in a RAC!
all sequences increment by 1!
for 2 sequences i know they are not recreated, because they're mine ...
Regards
Mario
|
|
|
|
Re: jumping sequences [message #352548 is a reply to message #352525] |
Wed, 08 October 2008 06:29 |
TeiMar71
Messages: 7 Registered: February 2001 Location: AUT
|
Junior Member |
|
|
i have a little program that inserts rows in a table every 5 minutes. the time is continous but not the id. sometimes there is a step by 20. but it used to last a long time until i found this out.
Regards
Mario
|
|
|
|
Re: jumping sequences [message #352566 is a reply to message #352559] |
Wed, 08 October 2008 06:58 |
TeiMar71
Messages: 7 Registered: February 2001 Location: AUT
|
Junior Member |
|
|
this is the script of the table where this happens :
create table mylog ( id number, startdate date, text varchar2(1000));
create sequence seq_mylog increment by 1 start with 1;
create or replace trigger TMYLOG
before insert on MYLOG
for each row
begin
select seq_mylog.nextval into :new.id from DUAL;
end;
/
every 5 minutes starts a program that inserts a row using the following statement :
insert into mylog (startdate, text) values (sysdate, 'prog started');
Regards
Mario
|
|
|
|
|
|
|
Re: jumping sequences [message #352615 is a reply to message #352605] |
Wed, 08 October 2008 10:43 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
TeiMar71 wrote on Wed, 08 October 2008 16:47 | that's it ... i think i should set all sequences to NOCACHE !
Regards
Mario
|
This was not my question but you could do this and if course you will have overhead and possibly waits on this sequence.
Regards
Michel
|
|
|