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


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.
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google