| user_sequences table [message #278675] |
Mon, 05 November 2007 06:32  |
mitthu
Messages: 3 Registered: November 2007
|
Junior Member |
|
|
Hi
I am trying the following query:
create sequence s start with 1 increment by 1;
Sequence created.
select s.nextval from dual;
NEXTVAL
----------
1
select CACHE_SIZE, LAST_NUMBER from user_sequences where sequence_name = 'S';
CACHE_SIZE shows value 20
LAST_NUMBER shows value 21
1 declare
2 begin
3 execute immediate ('alter sequence s increment by 10');
4* end;
PL/SQL procedure successfully completed.
select s.nextval from dual;
NEXTVAL
----------
11
select CACHE_SIZE, LAST_NUMBER from user_sequences where sequence_name = 'S';
CACHE_SIZE shows value 20
LAST_NUMBER shows value 211
What is the significance of these 2 columns and how do they change?
Thanks
Mitthu
|
|
|
|
|
|
|
|
| Re: user_sequences table [message #278682 is a reply to message #278679] |
Mon, 05 November 2007 06:57   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
|
I thought that the cached sequence values were held in memory for general use - I've just run a test on a sequence with a cache of 20 where different sessions have been able to consistently get consecutive values back from the sequence/
|
|
|
|
|
|
|
|
|
|