Sequence Default Cache value 20; ORA-04013: number to CACHE must be less than one cycle

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World

Error Description

SQL>   create sequence seq_norm start with 1 maxvalue 100 increment by 25 cycle;

  create sequence seq_norm start with 1 maxvalue 100 increment by 25 cycle

*

ERROR at line 1:

ORA-04013: number to CACHE must be less than one cycle

Solution Description

The Cache clause caches the ‘n’ number of values from the sequence for the fast performance. By default value is 20 for the synonym cache. If you are not specifying the nocache clause it will cache 20 values. So in the above case one cycle is of just 4 values of 25 increments and the number of cache should be less than one cycle.

So either you can mention nocache clause or cache maximum 4 you can mention while creation.

SQL> create sequence seq_norm start with 1 maxvalue 100 increment by 25 cycle cache 4;

Sequence created.

SQL> drop sequence seq_norm ;

Sequence dropped.

SQL>  create sequence seq_norm start with 1 maxvalue 100 increment by 25 cycle nocache;

Sequence created.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer