title: Monitoring tablespace usage in Oracle XE
body: <p>As it says on the <a href="http://www.oracle.com/technetwork/database/express-edition/overview/index.html" rel="nofollow">Oracle XE overview page</a>:</p>
  
  <blockquote>
    <p>Oracle Database XE can be installed on any size host machine with any number of CPUs (one database per machine), but XE will store <strong>up to 4GB of user data</strong>, use up to 1GB of memory, and use one CPU on the host machine.</p>
  </blockquote>
  
  <p>Now if I want to monitor the database to see how much user data is in use or how much memory is the database using, how would I do that? It is possible to monitor these values from Oracle Application Express, but I want to monitor the database from a centralized monitoring system. <a href="http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/storage.htm#CHDHGJEB" rel="nofollow">Oracle XE documentation</a> presents a query which returns Flash Recovery Area usage, so I'm guessing there's a similar query for user data usage also.</p>
  
  <pre><code>SELECT
  NAME,
  TO_CHAR(SPACE_LIMIT, '999,999,999,999') AS SPACE_LIMIT,
  TO_CHAR(SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE,'999,999,999,999')
     AS SPACE_AVAILABLE,
  ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1)
     AS PERCENT_FULL
  FROM V$RECOVERY_FILE_DEST;
  </code></pre>
  
  <p>Also, what happens when user data is above the limit?</p>