Opret et tilbagevendende planlagt job, der nulstiller sekvensen ved midnat den 1. januar hvert år.
Noget lignende (forudsat at du har en YOUR_SCHEMA.RESET_ANNUAL_SEQUENCE
procedure for at udføre nulstillingen):
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'reset_annual_sequence_job',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN your_schema.reset_annual_sequence; END;',
start_date => ADD_MONTHS( TRUNC( SYSTIMESTAMP, 'YY' ), 12 ),
repeat_interval => 'FREQ=YEARLY; BYDATE=0101;',
enabled => TRUE,
comments => 'Annual sequence reset'
);
END;
/