无法变更启动序列号

如果想更新一个序列的start with值,是不可以直接更改的,会报错:

SQL> alter sequence seq_xxrs start with 1000;
 
alter sequence seq_xxrs start with 1000
 
ORA-02283: 无法变更启动序列号

那么,如何增加一个序列的值呢?可以采用更改increment by的方式更改:

1.更改increment为一个你想让序列增加到的值

alter sequence seq_xxrs increment by 1000;

2.执行一次查询序列的语句

select seq_xxrs.nextval from dual;

3.然后将increment改回来

alter sequence seq_xxrs increment by 1;

此时的序列的值就增大了。

如需转载,请注明出处:http://blog.csdn.net/nanaranran/article/details/17398591

原文地址:https://www.cnblogs.com/yuanchaoyong/p/6696797.html