How to set the sequence to the last used id for all tables in Oracle?
First you have to find out what the current sequence value is and then reset it. I would write a script which does the following tasks:


Get the max value from the table
update/recreate the sequence


The script could look like this:

declare
  maxval number;
begin
  select max(id) into maxval from &lt;table_1&gt;;
  execute immediate 'ALTER SEQUENCE &lt;sequence_name_1&gt; START WITH '|| maxval+1 ||';';

  select max(id) into maxval from &lt;table_2&gt;;
  execute immediate 'ALTER SEQUENCE &lt;sequence_name_2&gt; START WITH '|| maxval+1 ||';';
end;
/


I'm pretty sure there are better scripts but if you have to do this task frequently this might do the job without much development time.