Let's say I have this sequence
CREATE SEQUENCE "NOMBRE_DB"."MI_SECUENCIA" MINVALUE 0 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
And we want to check your status to alter its value
Let's say I have this sequence
CREATE SEQUENCE "NOMBRE_DB"."MI_SECUENCIA" MINVALUE 0 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
And we want to check your status to alter its value
It would be like this, in oracle we make these queries supposing that the sequence goes in 10 and goes from 1 to 1 and we want to return to 1, the sequence must have a minimum value of 0.
Query to see where the account is going
select MI_SECUENCIA.nextval from dual;
Query to subtract what is needed to go back to 1 in this case
alter sequence MI_SECUENCIA increment by -10;
Then:
alter sequence MI_SECUENCIA increment by 1;