reset sequence value

to reset your current sequence to value 1 follow the following steps:

we will assume the sequence name is SQ_CURR

1. Search for the current sequence value via the command:

SQL> select SQ_CURR.currval from dual;  

 2. Then change the sequence by adding the negative value of your previous result but subtract and addition one so for example if the value was 133389 you will increment it by -133388

SQL>  ALTER SEQUENCE SQ_CURR  INCREMENT by -133388; 

 

3. Then run the command that will reset the sequence:

SQL> SQ_CURR.NEXTVAL SELECT FROM DUAL; 

 

4. To restore the increment of the sequence:

SQL> ALTER SEQUENCE SQ_CURR  INCREMENT by 1;

 

hope this helps ….cheers!

😉