Oracle how to reset sequence nextval

前端之家收集整理的这篇文章主要介绍了Oracle how to reset sequence nextval前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

2 Solutions:


1. drop and re-create it


drop sequence seqname;

create sequence seqname start with NEWVALUE ...


(Notice: don't forget about sequence's privilege)


2. alter sequence

alter sequence seqname increment by AVALUE -- (e.g.,expected - currentVal);


- When AVALUE is a positive number,seqname's value will be increased.

- When AVALUE is a negative number,seqname's value will be reduced.

原文链接:https://www.f2er.com/oracle/212201.html

猜你在找的Oracle相关文章