title: Reset Oracle Sequence to have MIN VALUE = 1 and STARTING number from 1
body: <p>I have a problem resetting Oracle Sequence to have MIN VALUE = 1 and starting next number used is 1.</p>
  
  <p>I have followed through the answer of this question:
  <a href="https://stackoverflow.com/questions/51470/how-do-i-reset-a-sequence-in-oracle">How do I reset a sequence in Oracle?</a> </p>
  
  <pre><code>   create or replace procedure reset_seq( p_seq_name in varchar2 ) is
          l_val number; 
  begin
          execute immediate
          'select ' || p_seq_name || '.nextval from dual' INTO l_val;
  
          execute immediate
          'alter sequence ' || p_seq_name || ' increment by -' || l_val || 
                                                                ' minvalue 0';
  
          execute immediate
          'select ' || p_seq_name || '.nextval from dual' INTO l_val;
  
          execute immediate
          'alter sequence ' || p_seq_name || ' increment by 1 minvalue 0'; 
  end;
  </code></pre>
  
  <p>But, the problem is the code above is resetting the sequence with min value = 0, and the next val to be used is 2. </p>
  
  <p>Is it possible to set the min_value = 1, and nextval to be 1, after the reset is done?</p>
  
  <p>I tried to set it but getting the error mentioning approximately as below:</p>
  
  <blockquote>
    <p>The current value cannot be higher then Minimum Value.</p>
  </blockquote>
  
  <p>Thanks!</p>