Sequencing in Oracle giving Problems. [message #70655] |
Wed, 10 July 2002 21:16 |
sahaslad
Messages: 23 Registered: May 2002
|
Junior Member |
|
|
Hi All,
I am facing a different problem and its related to sequencing.
The Problem is when i am using a sequence the sequence value should increment in proper fashion of what the increment value is provided.
Let say if the sequence i have created is:
create sequence autonum
start with 1
increment by 1
cache 20
order;
Then the above sequence should increment by 1 every time. But it does not happen i dont know but after some execution of the sequences the value of the sequence shoots up like if the value is 150 then at the next execution it should show 151 but it shows 175.
I dont know why it is happening.
Can u help me in this regard.
Thanks.
|
|
|
Re: Sequencing in Oracle giving Problems. [message #70665 is a reply to message #70655] |
Thu, 11 July 2002 05:40 |
christopher
Messages: 25 Registered: September 2000
|
Junior Member |
|
|
2 things to look at:
1) is there anybody else that might be using the sequence?
2) is your db being shutdown in between the use of the sequence. Meaning, you grabbed 150, is your db being shutdown before you try and get 151. When you specify the CACHE parameter (default is 20), it stores the next X numbers in memory. So when you shutdown the db your memory goes away, thus those numbers go away. to avoid this problem, specify NOCACHE for your index.
|
|
|
Re: Sequencing in Oracle giving Problems. [message #70672 is a reply to message #70665] |
Thu, 11 July 2002 21:45 |
sahaslad
Messages: 23 Registered: May 2002
|
Junior Member |
|
|
Thanks Christopher for ur Reply.
As per what u told.
1) The server in which the oracle 8i resides is been shutdown once in a week for maintainance ans what u said i think is because of that only.
I will try and tell u wheather ur second point works out or not
Thanks once again Christopher
|
|
|
Re: Sequencing in Oracle giving Problems. [message #70776 is a reply to message #70655] |
Mon, 22 July 2002 03:46 |
sunil bhola
Messages: 58 Registered: July 2002
|
Member |
|
|
This happened with sequence becauase the cache value is default to 20, it means oracle contains only 20 no's in the cache memory(RAM). that is if the system shutdown, the next value that is fetched from the sequence will be 21 in your case it is 175
type more than 20 in cache and try again
|
|
|