How to reset a sequence value?

What is the easiest way to set a sequence to a very high value.

E.g. currval = 100, set it to point to 1100.

Instead of dropping and recreating the sequence again, use the INCREMENT BY option to reset a sequence value. You can also decrement the sequence value by incrementing it with a negative number. Don't forget to reset the increment value to 1 or as the case.

Alter sequence x increment by 1000;

select x.nextval from dual;

Alter sequence x increment by 1;

Tip taken from:
http://www.amar-padhi.com/oradb_seq_reset.html

No comments :

Post a Comment