If no cyclic cycle is set for sequence, a ORA-08004 error occurs when the maximum value of sequence is exceeded.
SQL> Create sequence test_seq_no_cycle
2 minvalue 1
3 maxvalue 200
4 start with 100
5 increment by 50
6 nocache;
Sequence created
SQL> select test_seq_no_cycle.nextval from dual;
Nextval
----------
100
SQL> select test_seq_no_cycle.nextval from dual;
Nextval
----------
150
SQL> select test_seq_no_cycle.nextval from dual;
Nextval
----------
200
SQL> select test_seq_no_cycle.nextval from dual;
Select test_seq_no_cycle.nextval from dual
ORA-08004: sequence test_seq_no_cycle.nextval exceeds maxvalue cannot be instantiated
SQL> Create sequence test_seq
2 minvalue 1
3 maxvalue 200
4 start with 100
5 increment by 50
6 nocache
7 cycle;
Sequence created
SQL> select test_seq.nextval from dual;
Nextval
----------
100
SQL> select test_seq.nextval from dual;
Nextval
----------
150
SQL> select test_seq.nextval from dual;
Nextval
----------
200
After the maximum value of sequenc is reached, if cycle is set, the initial value of sequence starts from minvalue, instead of the set start with value.
SQL> select test_seq.nextval from dual;
Nextval
----------
1
SQL> select test_seq.nextval from dual;
Nextval
----------
51
SQL> select test_seq.nextval from dual;
Nextval
----------
101
SQL> select test_seq.nextval from dual;
Nextval
----------
151
SQL> select test_seq.nextval from dual;
Nextval
----------
1
SQL> select test_seq.nextval from dual;
Nextval
----------
51