<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My stuff &#187; Oracle</title>
	<atom:link href="http://michelhollands.net/blog/index.php/category/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://michelhollands.net/blog</link>
	<description>Tech and travel tidbits</description>
	<lastBuildDate>Tue, 13 Dec 2011 09:59:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Authomatic statistics gathering</title>
		<link>http://michelhollands.net/blog/2007/10/29/authomatic-statistics-gathering/</link>
		<comments>http://michelhollands.net/blog/2007/10/29/authomatic-statistics-gathering/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 17:13:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/10/29/authomatic-statistics-gathering/</guid>
		<description><![CDATA[Oracle 10g has a feature where it gathers optimizer statistics automatically at night. This is done through a scheduled job called GATHER_STATS_JOB. If you want to disable this, you have to issue : EXEC dbms_scheduler.disable&#40;’GATHER_STATS_JOB’&#41;; To enable it again : EXEC dbms_scheduler.enable&#40;’GATHER_STATS_JOB’&#41;; The following query shows when this job was run : SELECT * FROM [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracle.com">Oracle 10g</a> has a feature where it gathers optimizer statistics automatically at night. This is done through a scheduled job called GATHER_STATS_JOB. If you want to disable this, you have to issue :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">EXEC</span> dbms_scheduler<span style="color: #66cc66;">.</span>disable<span style="color: #66cc66;">&#40;</span>’GATHER_STATS_JOB’<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>To enable it again :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">EXEC</span> dbms_scheduler<span style="color: #66cc66;">.</span>enable<span style="color: #66cc66;">&#40;</span>’GATHER_STATS_JOB’<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The following query shows when this job was run :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> dba_scheduler_job_run_details <span style="color: #993333; font-weight: bold;">WHERE</span> job_name <span style="color: #66cc66;">=</span> ’GATHER_STATS_JOB’;</pre></div></div>

<p>There are other tables, all starting with dba_scheduler, that show the schedules and so on. One of the more interesting ones is dba_scheduler_jobs.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/10/29/authomatic-statistics-gathering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NLS_LANG settings</title>
		<link>http://michelhollands.net/blog/2007/10/24/nls_lang-settings/</link>
		<comments>http://michelhollands.net/blog/2007/10/24/nls_lang-settings/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 10:11:19 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/10/24/nls_lang-settings/</guid>
		<description><![CDATA[To get the language setting of the current session : SELECT USERENV &#40;'language'&#41; FROM DUAL; This returns the database character set, not the user&#8217;s though. The NLS settings can be found in the following list, in this order. If a value is specified in NLS_SESSION_PARAMETERS, it has preference over a value in NLS_INSTANCE_PARAMETERS. NLS_SESSION_PARAMETERS NLS_INSTANCE_PARAMETERS [...]]]></description>
			<content:encoded><![CDATA[<p>To get the language setting of the current session :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> USERENV <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'language'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> DUAL;</pre></div></div>

<p>This returns the database character set, not the user&#8217;s though.</p>
<p>The NLS settings can be found in the following list, in this order. If a value is specified in NLS_SESSION_PARAMETERS, it has preference over a value in NLS_INSTANCE_PARAMETERS.</p>
<ol>
<li>NLS_SESSION_PARAMETERS</li>
<li>NLS_INSTANCE_PARAMETERS</li>
<li>NLS_DATABASE_PARAMETERS</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/10/24/nls_lang-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TNS_ADMIN</title>
		<link>http://michelhollands.net/blog/2007/10/19/tns_admin/</link>
		<comments>http://michelhollands.net/blog/2007/10/19/tns_admin/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 08:27:05 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/10/19/tns_admin/</guid>
		<description><![CDATA[By default Oracle expects tnsnames.ora to be in the $ORACLE_HOME\network\admin directory. This is not always the most convenient place, especially because that directory is usually owned by the oracle user. To get around this, you can set the TNS_ADMIN variable. This points to the directory where you have put your own copy of tnsnames.ora . [...]]]></description>
			<content:encoded><![CDATA[<p>By default Oracle expects tnsnames.ora to be in the $ORACLE_HOME\network\admin directory. This is not always the most convenient place, especially because that directory is usually owned by the oracle user.</p>
<p>To get around this, you can set the TNS_ADMIN variable. This points to the directory where you have put your own copy of tnsnames.ora . Like they say on TV : darn useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/10/19/tns_admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing an Oracle session</title>
		<link>http://michelhollands.net/blog/2007/09/26/killing-an-oracle-session/</link>
		<comments>http://michelhollands.net/blog/2007/09/26/killing-an-oracle-session/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 10:22:58 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/09/26/killing-an-oracle-session/</guid>
		<description><![CDATA[Every time you log into Oracle, you create a session. This is an easy way to kill these Oracle sessions, thanks to this article. First, select the session ID and serial number as such : SELECT s.sid, s.serial#, s.osuser, s.program FROM v$session s; The osuser and program field can be used to identify the session. [...]]]></description>
			<content:encoded><![CDATA[<p>Every time you log into Oracle, you create a session. This is an easy way to kill these Oracle sessions, thanks to <a href="http://www.oracle-base.com/articles/misc/KillingOracleSessions.php">this article</a>.</p>
<p>First, select the session ID and serial number as such :</p>

<div class="wp_syntax"><div class="code"><pre class="plsql" style="font-family:monospace;">  <span style="color: #00F;">SELECT</span> s<span style="color: #00F;">.</span>sid<span style="color: #00F;">,</span> s<span style="color: #00F;">.</span>serial#<span style="color: #00F;">,</span> s<span style="color: #00F;">.</span>osuser<span style="color: #00F;">,</span> s<span style="color: #00F;">.</span>program
    <span style="color: #00F;">FROM</span> v$session s<span style="color: #00F;">;</span></pre></div></div>

<p>The osuser and program field can be used to identify the session.</p>
<p>Then you can kill the session using :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">ALTER</span> SYSTEM <span style="color: #993333; font-weight: bold;">KILL</span> <span style="color: #993333; font-weight: bold;">SESSION</span> <span style="color: #ff0000;">'sid,serial#'</span>;</pre></div></div>

<p>It&#8217;s also possible to kill the session immediately (but that&#8217;s considered rude) :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">ALTER</span> SYSTEM <span style="color: #993333; font-weight: bold;">KILL</span> <span style="color: #993333; font-weight: bold;">SESSION</span> <span style="color: #ff0000;">'sid,serial#'</span> IMMEDIATE;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/09/26/killing-an-oracle-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selecting random rows</title>
		<link>http://michelhollands.net/blog/2007/08/01/selecting-random-rows/</link>
		<comments>http://michelhollands.net/blog/2007/08/01/selecting-random-rows/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 13:29:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/08/01/selecting-random-rows/</guid>
		<description><![CDATA[If you want to select random rows from a table, you can order the rows using the dbms_random.value function : SELECT COLUMN FROM TABLE ORDER BY dbms_random.VALUE To get 20 random rows from the table, we can add a condition on rownum. This selects the first 20 rows : SELECT COLUMN FROM &#40; SELECT COLUMN [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to select random rows from a table, you can order the rows using the dbms_random.value function :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COLUMN</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span>
   <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> dbms_random<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">VALUE</span></pre></div></div>

<p>To get 20 random rows from the table, we can add a condition on rownum. This selects the first 20 rows :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COLUMN</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COLUMN</span>
                 <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span>
                <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> dbms_random<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">VALUE</span> <span style="color: #66cc66;">&#41;</span>
   <span style="color: #993333; font-weight: bold;">WHERE</span> rownum <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">21</span></pre></div></div>

<p>With thanks to this <a href="http://www.petefreitag.com/item/466.cfm">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/08/01/selecting-random-rows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recompiling database objects</title>
		<link>http://michelhollands.net/blog/2007/07/26/recompiling-database-objects/</link>
		<comments>http://michelhollands.net/blog/2007/07/26/recompiling-database-objects/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 07:38:35 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/07/26/recompiling-database-objects/</guid>
		<description><![CDATA[The DBMS_UTILITY package has a function called compile_schema that compiles all procedures, functions, packages, and triggers. EXEC DBMS_UTILITY.compile_schema&#40;schema =&#62; 'SCOTT'&#41;; You can also use the UTL_RECOMP package, but I haven&#8217;t tried that one yet. With thanks to this ORACLE-BASE article.]]></description>
			<content:encoded><![CDATA[<p>The DBMS_UTILITY package has a function called compile_schema that compiles all procedures, functions, packages, and triggers.</p>

<div class="wp_syntax"><div class="code"><pre class="plsql" style="font-family:monospace;">  EXEC <span style="color: #00F;">DBMS_UTILITY</span><span style="color: #00F;">.</span>compile_schema<span style="color: #00F;">&#40;</span>schema <span style="color: #00F;">=&gt;</span> <span style="color: #F00;">'SCOTT'</span><span style="color: #00F;">&#41;</span><span style="color: #00F;">;</span></pre></div></div>

<p>You can also use the UTL_RECOMP package, but I haven&#8217;t tried that one yet.</p>
<p>With thanks to this <a href="http://www.oracle-base.com/articles/misc/RecompilingInvalidSchemaObjects.php">ORACLE-BASE article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/07/26/recompiling-database-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Statspack summary</title>
		<link>http://michelhollands.net/blog/2007/07/04/statspack-summary/</link>
		<comments>http://michelhollands.net/blog/2007/07/04/statspack-summary/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 10:41:01 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/07/04/statspack-summary/</guid>
		<description><![CDATA[This post is a summary of the Oracle Statspack Survival Guide. To install statspack : Create tablespace for it @?/rdbms/admin/spcreate (run as sysdba) To take snaps : exec statspack.snap; To create the report : @?/rdbms/admin/spreport.sql]]></description>
			<content:encoded><![CDATA[<p>This post is a summary of the <a href="http://www.akadia.com/services/ora_statspack_survival_guide.html">Oracle Statspack Survival Guide</a>.</p>
<p>To install statspack :</p>
<ul>
<li>Create tablespace for it</li>
<li>@?/rdbms/admin/spcreate (run as sysdba)</li>
</ul>
<p>To take snaps :</p>
<ul>
<li>exec statspack.snap;</li>
</ul>
<p>To create the report :</p>
<ul>
<li>@?/rdbms/admin/spreport.sql</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/07/04/statspack-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How much space does an Oracle table take up ?</title>
		<link>http://michelhollands.net/blog/2007/06/19/how-much-space-does-an-oracle-table-take-up/</link>
		<comments>http://michelhollands.net/blog/2007/06/19/how-much-space-does-an-oracle-table-take-up/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 09:47:56 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/06/19/how-much-space-does-an-oracle-table-take-up/</guid>
		<description><![CDATA[The following queries can be used to find out how much space a table takes up. The first query gets the block size used in this database. The second one shows how many blocks are used for a table. SELECT VALUE FROM v$parameter WHERE name = 'db_block_size'; &#160; SELECT blocks, last_analyzed FROM all_tables WHERE owner [...]]]></description>
			<content:encoded><![CDATA[<p>The following queries can be used to find out how much space a table takes up. The first query gets the block size used in this database. The second one shows how many blocks are used for a table.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">VALUE</span>
    <span style="color: #993333; font-weight: bold;">FROM</span> v$parameter
  <span style="color: #993333; font-weight: bold;">WHERE</span> name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'db_block_size'</span>;
&nbsp;
  <span style="color: #993333; font-weight: bold;">SELECT</span> blocks<span style="color: #66cc66;">,</span> last_analyzed
    <span style="color: #993333; font-weight: bold;">FROM</span> all_tables
  <span style="color: #993333; font-weight: bold;">WHERE</span> owner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'X'</span>
     <span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'Y'</span>;</pre></div></div>

<p>The blocks field will have a valid value if the table has been analyzed recently, that is why the last_analyzed field is selected as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/06/19/how-much-space-does-an-oracle-table-take-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking tablespace usage</title>
		<link>http://michelhollands.net/blog/2007/06/08/checking-tablespace-usage/</link>
		<comments>http://michelhollands.net/blog/2007/06/08/checking-tablespace-usage/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 09:44:19 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/06/08/checking-tablespace-usage/</guid>
		<description><![CDATA[This SQL, inspired by this, shows how full the tablespaces are : SELECT tablespace_name &#124;&#124; ' is ' &#124;&#124; TO_CHAR&#40;ROUND&#40;100-&#40;free_bytes*100/total_bytes&#41;, 2&#41;&#41; &#124;&#124; '% full.' T, total_bytes, free_bytes FROM &#40;SELECT a.tablespace_name, a.total_bytes, b.free_bytes FROM &#40;SELECT tablespace_name, NVL&#40;SUM&#40;bytes&#41;, 1&#41; AS total_bytes FROM dba_data_files GROUP BY tablespace_name&#41; a, &#40;SELECT tablespace_name, SUM&#40;bytes&#41; AS free_bytes FROM dba_free_space GROUP BY tablespace_name&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>This SQL, inspired by <a href="http://www.remote-dba.cc/oracle_tips_tablespace_full.htm">this</a>, shows how full the tablespaces are :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> tablespace_name                                     <span style="color: #66cc66;">||</span>
         <span style="color: #ff0000;">' is '</span>                                              <span style="color: #66cc66;">||</span>
         TO_CHAR<span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">-</span><span style="color: #66cc66;">&#40;</span>free_bytes<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">/</span>total_bytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span>
         <span style="color: #ff0000;">'% full.'</span> T<span style="color: #66cc66;">,</span> total_bytes<span style="color: #66cc66;">,</span> free_bytes
   <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> a<span style="color: #66cc66;">.</span>tablespace_name<span style="color: #66cc66;">,</span> a<span style="color: #66cc66;">.</span>total_bytes<span style="color: #66cc66;">,</span> b<span style="color: #66cc66;">.</span>free_bytes
           <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tablespace_name<span style="color: #66cc66;">,</span> NVL<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>bytes<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> total_bytes
                   <span style="color: #993333; font-weight: bold;">FROM</span> dba_data_files
                  <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> tablespace_name<span style="color: #66cc66;">&#41;</span> a<span style="color: #66cc66;">,</span>
                <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tablespace_name<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>bytes<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> free_bytes
                   <span style="color: #993333; font-weight: bold;">FROM</span> dba_free_space
                  <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> tablespace_name<span style="color: #66cc66;">&#41;</span> b
           <span style="color: #993333; font-weight: bold;">WHERE</span> a<span style="color: #66cc66;">.</span>tablespace_name <span style="color: #66cc66;">=</span> b<span style="color: #66cc66;">.</span>tablespace_name
        <span style="color: #66cc66;">&#41;</span>
  <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> tablespace_name;</pre></div></div>

<p>Another way of doing it is like this (courtesy of this <a href="http://vsbabu.org/oracle/sect03.html">site</a>) :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">  <span style="color: #993333; font-weight: bold;">SELECT</span> a<span style="color: #66cc66;">.</span>TABLESPACE_NAME<span style="color: #66cc66;">,</span>
           a<span style="color: #66cc66;">.</span>BYTES bytes_used<span style="color: #66cc66;">,</span>
           b<span style="color: #66cc66;">.</span>BYTES bytes_free<span style="color: #66cc66;">,</span>
           b<span style="color: #66cc66;">.</span>largest<span style="color: #66cc66;">,</span>
           round<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">-</span>b<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span>a<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> percent_used
    <span style="color: #993333; font-weight: bold;">FROM</span>
           <span style="color: #66cc66;">&#40;</span>
                <span style="color: #993333; font-weight: bold;">SELECT</span> TABLESPACE_NAME<span style="color: #66cc66;">,</span>
                         <span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>BYTES<span style="color: #66cc66;">&#41;</span> BYTES
                  <span style="color: #993333; font-weight: bold;">FROM</span> dba_data_files
                 <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> TABLESPACE_NAME
           <span style="color: #66cc66;">&#41;</span> a<span style="color: #66cc66;">,</span>
           <span style="color: #66cc66;">&#40;</span>
                <span style="color: #993333; font-weight: bold;">SELECT</span> TABLESPACE_NAME<span style="color: #66cc66;">,</span>
                         <span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>BYTES<span style="color: #66cc66;">&#41;</span> BYTES <span style="color: #66cc66;">,</span>
                         <span style="color: #993333; font-weight: bold;">MAX</span><span style="color: #66cc66;">&#40;</span>BYTES<span style="color: #66cc66;">&#41;</span> largest
                  <span style="color: #993333; font-weight: bold;">FROM</span> dba_free_space
                <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> TABLESPACE_NAME
           <span style="color: #66cc66;">&#41;</span> b
  <span style="color: #993333; font-weight: bold;">WHERE</span> a<span style="color: #66cc66;">.</span>TABLESPACE_NAME<span style="color: #66cc66;">=</span>b<span style="color: #66cc66;">.</span>TABLESPACE_NAME
   <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">-</span>b<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span>a<span style="color: #66cc66;">.</span>BYTES<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DESC</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/06/08/checking-tablespace-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if Java is installed in Oracle</title>
		<link>http://michelhollands.net/blog/2007/06/06/check-if-java-is-installed-in-oracle/</link>
		<comments>http://michelhollands.net/blog/2007/06/06/check-if-java-is-installed-in-oracle/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 15:52:49 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/2007/06/06/check-if-java-is-installed-in-oracle/</guid>
		<description><![CDATA[If you want to know if Java is installed, use the following SQL : select * from dba_registry; There should be an entry with comp_id equal to &#8216;JAVAVM&#8217;.]]></description>
			<content:encoded><![CDATA[<p>If you want to know if Java is installed, use the following SQL :</p>
<pre>
  select * from dba_registry;
</pre>
<p>There should be an entry with comp_id equal to &#8216;JAVAVM&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2007/06/06/check-if-java-is-installed-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.926 seconds -->

