title: How to reclaim unused space in SYSAUX tablespace in Oracle?
body: <p>I have 6gb file for SYSAUX table space in 18xe oracle database.</p>
  <p>SYSAUX table space has 61% free space :</p>
  <pre><code>    select
         fs.tablespace_name                          as Tablespace,
         (df.totalspace - fs.freespace)              as Used_MB,
         fs.freespace                                as Free_MB,
         df.totalspace                               as Total_MB,
         round(100 * (fs.freespace / df.totalspace)) as Percentage_Free
      from
         (select tablespace_name, round(sum(bytes) / 1048576) TotalSpace from dba_data_files group by tablespace_name) df,
         (select tablespace_name, round(sum(bytes) / 1048576) FreeSpace from dba_free_space group by tablespace_name) fs
      where
         df.tablespace_name = fs.tablespace_name
         and df.tablespace_name = 'SYSAUX';
  </code></pre>
  <p>returns</p>
  <p><a href="https://i.stack.imgur.com/p0NnV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p0NnV.png" alt="enter image description here" /></a></p>
  <p>So I would like to reclaim the 61% free space if possible.</p>
  <h1>Attempt 1 :</h1>
  <pre><code>ALTER DATABASE DATAFILE '...\XE\SYSAUX01.DBF' RESIZE 5000M; 
  </code></pre>
  <p>But I'm getting the error :</p>
  <pre><code>ORA-03297: file contains used data beyond requested RESIZE value
  </code></pre>
  <h1>Attempt 2 :</h1>
  <pre><code>ALTER TABLESPACE SYSAUX SHRINK SPACE KEEP 5000M;
  </code></pre>
  <p>Error :</p>
  <pre><code>ORA-12916: cannot shrink permanent or dictionary managed tablespace
  </code></pre>
  <h1>Attempt 3 :</h1>
  <pre><code>ALTER TABLESPACE sysaux RESIZE 5000M;
  </code></pre>
  <p>Error</p>
  <pre><code>ORA-32773: operation not supported for smallfile tablespace SYSAUX
  </code></pre>
  <p>Does anyone know to relcaim this space please ?</p>
  <p>Thanks.</p>