CREATE SEQUENCE my_sequence
START WITH 60005963
INCREMENT BY 1
The user start generate the check last week and sequence was generated fine from 60005883 to 60005934. So today, when she generate check , we expect to have the check number 60005935 but it disn't generate this number and it generate number 60005943.
1. Why it generated 60005943 instead of 60005935 ???
2. What is the cache mean in the sequences
If you say CACHE 20, it means Oracle will cache 20 sequential numbers in buffer cache and will make them immediately available to you.
However, if you re-start the database, these 20 numbers would be gone. After the re-start, Oracle would make another set of 20 number available to you in the cache.
Due to which, you would see some difference between the present value and the last value before the database re-start.