title: What is the best way of resetting a sequence in Oracle 10g?
body: <p>To reset an Oracle sequence, I follow the following temporary way. Let's say, I have a table named <code>TEMP_TABLE</code> with a sequence associated with it.</p>
  
  <p>The following SQL produces <strong>22</strong> as the sequence next value (only in this case).</p>
  
  <pre><code>SELECT TEMP_TABLE_SEQ.NEXTVAL from DUAL;
  </code></pre>
  
  <p>The following statement decreases the cache size to <code>SEQUENCE.MINVALUE</code>.</p>
  
  <pre><code>ALTER SEQUENCE TEMP_TABLE_SEQ INCREMENT BY -21;
  </code></pre>
  
  <p>Next, I'm performing a dummy select that retrieves <strong>1</strong> as the sequence value.</p>
  
  <pre><code>SELECT TEMP_TABLE_SEQ.NEXTVAL from DUAL;
  </code></pre>
  
  <p>I'm now resetting the cache size to <strong>1</strong>.</p>
  
  <pre><code>ALTER SEQUENCE TEMP_TABLE_SEQ INCREMENT BY 1;
  </code></pre>
  
  <p>So that the following statement,</p>
  
  <pre><code>SELECT TEMP_TABLE_SEQ.NEXTVAL from DUAL;
  </code></pre>
  
  <p>gives me <strong>2</strong> as the next sequence value and so on.</p>
  
  <hr>
  
  <p>In PostgreSQL server, the following only one statement is sufficient to reset a sequence.</p>
  
  <pre><code>ALTER SEQUENCE TEMP_TABLE_SEQ RESTART WITH 0;
  </code></pre>
  
  <p>Is there such a fair way in Oracle (10g) to reset a sequence?</p>