The sequence starts from 0 every morning during Oracle storage.
Create or replace procedure seq_reset
N NUMBER (10 );
Tsql VARCHAR2 (100 );
BEGIN
Execute immediate 'select SQD_LSH.nextval from dual'
INTO n;
N: =-(n );
Tsql: = 'alter sequence SQD_LSH increment by '| n;
Execute immediate tsql;
Execute immediate 'select SQD_LSH.nextval from dual'
INTO n;
Tsql: = 'alter sequence SQD_LSH increment by 1 ';
Execute immediate tsql;
END seq_reset;
First obtain the current value of sequence, and then set its step size to the opposite number of this value. Execute nextval to subtract the increasing part, so that the sequence returns to zero, and finally the recovery step size is 1.
Create a job and set it to run the stored procedure every day. See
Use JDBC to call Oracle stored procedures and functions in Java
Local compilation of Oracle stored procedures
Use of Oracle stored procedures and REF CURSOR
Solution to prompt "insufficient Permissions" during Oracle Storage
Oracle uses the stored procedure to return the result set development report
Tips for using temporary tables in Oracle stored procedures