bitPrison.net - Database http://bitprison.net/blog-categories/database en Oracle unable to extend table in tablespace http://bitprison.net/oracle_unable_to_extend_tablespace <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I've got the next error message from Oracle server, when I try to insert new record:</p> <pre class="prettyprint linenums"><code>ORA-01653: unable to extend table OWNER.TABLE_NAME by BYTE in tablespace TABLESPACE</code></pre><!--break--><p>Where TABLESPACE is the name of your tablespace. In the future you need to replace TABLESPACE with name of your tablespace.</p> <p>If you have enough disk space, you need to check how many bytes are used by Oracle in TABLESPACE:</p> <pre class="prettyprint linenums"><code>SELECT *<br />FROM<br />   dba_data_files<br />WHERE<br />   tablespace_name = 'TABLESPACE';<br />--Where TABLESPACE is the name of your tablespace.<br />--Please replace it.</code></pre><p> "BYTES" column shows maximum size of this tablespace in bytes. If value of "AUTOEXTENSIBLE" column is NO, then Oracle don't extends the maximum size of tablespace. If this value is YES, then Oracle extends tablespace when no more space in it.</p> <p>If value of "AUTOEXTENSIBLE" column is NO, check how many bytes are used by Oracle:</p> <pre class="prettyprint linenums"><code>SELECT<br />  tablespace_name,<br />  SUM(bytes/1024/1024)<br />FROM<br />  dba_segments<br />GROUP BY<br />  tablespace_name;<br />--Where TABLESPACE is the name of your tablespace.<br />--Please replace it.</code></pre><p> Now look at your tablespace size. If the different between this value and maximum size is enough small you need to set AUTOEXTENSIBLE to<br /> YES. I have generated a query, what set the YES value with this command:</p> <pre class="prettyprint linenums"><code>SELECT<br />  'alter database datafile '''||<br />  file_name||<br />  ''' '||<br />  ' autoextend on;'<br />FROM<br />  dba_data_files<br />WHERE tablespace_name = 'TABLESPACE';<br />--Where TABLESPACE is the name of your tablespace.<br />--Please replace it.</code></pre><p> Copy and paste generated query end execute it.</p> <p>Now your tablespace is AUTOEXTENSIBLE and it will grow if need.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-2 field-type-taxonomy-term-reference field-label-inline clearfix"><span class="field-label">Blog categories: </span><a href="taxonomy/term/58" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>Database</a></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><span class="field-label">Blog tags: </span><a href="taxonomy/term/4" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>programming</a> <a href="taxonomy/term/52" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>system admin</a> <a href="taxonomy/term/59" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>oracle</a> <a href="taxonomy/term/60" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>database</a> <a href="taxonomy/term/61" class="btn btn-primary btn-mini btn-taxonomy"><i class="icon-tag">&nbsp;</i>sql</a></div> Wed, 05 Nov 2008 20:47:48 +0000 Jozsef 28 at http://bitprison.net http://bitprison.net/oracle_unable_to_extend_tablespace#comments