ORA-04008: START WITH cannot be more than MAXVALUE

文档解释

ORA-04008: START WITH cannot be more than MAXVALUE

Cause: the starting value would be larger than MAXVALUE

Action: make sure that the starting value is less than MAXVALUE

错误说明

ORA-04008报错是一条在Oracle数据库中常见的错误,此错误信息表明在创建或者修改序列时,START WITH不能大于MAXVALUE。

常见案例

当序列设置好,START WITH大于MAXVALUE时,会出现ORA-04008错误,例如:

SQL> CREATE SEQUENCE test_sequence

2 START WITH 4

3 INCREMENT BY 2

4 MAXVALUE 100;

ORA-04008: START WITH cannot be more than MAXVALUE

解决方法

对于ORA-04008错误,解决方法就是重新设置序列,将START WITH值设置成一个小于MAXVALUE值的数,例如:

SQL> CREATE SEQUENCE test_sequence

2 START WITH 2

3 INCREMENT BY 2

4 MAXVALUE 100;

Sequence created.

完成后,重新测试,看是否能够避免ORA-04008错误。

你可能感兴趣的