<?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>Laurent Schneider</title>
	<atom:link href="http://laurentschneider.com/feed" rel="self" type="application/rss+xml" />
	<link>http://laurentschneider.com</link>
	<description>Oracle Certified Master</description>
	<lastBuildDate>Mon, 13 May 2013 08:43:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>New environment for OCM 11g</title>
		<link>http://laurentschneider.com/wordpress/2013/05/new-environment-for-ocm-11g.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/05/new-environment-for-ocm-11g.html#comments</comments>
		<pubDate>Mon, 13 May 2013 08:43:18 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[11gR2]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[OCM]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1562</guid>
		<description><![CDATA[For my readers who are preparing the ocm 11g exam, the environment just changed (From 13th May 2013 onwards) Instead of using OEM 10g, you will be using OEM 11g. The upgrade exam is still using OEM 10g and DB 11gR1 (!) but I did not care installing OEM 10g and I prepared with OEM [...]]]></description>
				<content:encoded><![CDATA[<p>For my readers who are preparing the ocm 11g exam, the environment just changed (From 13th May 2013 onwards)</p>
<p>Instead of using OEM 10g, you will be using OEM 11g. </p>
<p>The upgrade exam is still using OEM 10g and DB 11gR1 (!) but I did not care installing OEM 10g and I prepared with OEM 11g.</p>
<p>Ref: <a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=5001&#038;get_params=p_exam_id:11GOCM&#038;p_org_id=&#038;lang=">p_exam_id:11GOCM</a></p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/05/new-environment-for-ocm-11g.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>use cron to schedule a job only once</title>
		<link>http://laurentschneider.com/wordpress/2013/05/use-cron-to-schedule-a-job-only-once.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/05/use-cron-to-schedule-a-job-only-once.html#comments</comments>
		<pubDate>Mon, 06 May 2013 11:15:02 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1559</guid>
		<description><![CDATA[I wrote about not using DAY OF MONTH and DAY OF WEEK simultanously in how to cron The correct method is to use 15 14 15 05 * /tmp/run-my-job But&#8230; I wrote this five years ago. Hmmm ! Not that correct then since it would run every year Ok, periodically I check for jobs are [...]]]></description>
				<content:encoded><![CDATA[<p>I wrote about not using <i>DAY OF MONTH</i> and <i>DAY OF WEEK</i> simultanously in <a href="http://laurentschneider.com/wordpress/2008/05/how-to-cron.html">how to cron</a></p>
<p><i>The correct method is to use</i><br />
<code>15 14 15 05 * /tmp/run-my-job</code></p>
<p>But&#8230; I wrote this five years ago. Hmmm ! Not that correct then since it would run every year <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Ok, periodically I check for jobs are scheduled to run a specific date only<br />
<pre><code>$ crontab -l|awk &#039;$1!~/#/&amp;&amp;$3*$4&#039;
15 14 15 05 * /tmp/run-my-job
</code></pre></p>
<p>I have 9 more days to remove this before it runs for the fifth time <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/05/use-cron-to-schedule-a-job-only-once.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Delete one billion row</title>
		<link>http://laurentschneider.com/wordpress/2013/04/delete-one-billion-row.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/04/delete-one-billion-row.html#comments</comments>
		<pubDate>Wed, 24 Apr 2013 12:39:57 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[dba]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[delete]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1552</guid>
		<description><![CDATA[To delete large number of rows, for instance rows with date until 2010, you can issue this simple statement. SQL&#62; DELETE FROM T WHERE C&#60;DATE &#039;2011-01-01&#039;; 1&#039;000&#039;000&#039;000 rows deleted Elapsed: 23:45:22.01 SQL&#62; commit; This is perfectly fine. The table remains online, other users are not much affected (maybe they will not even notice the lower [...]]]></description>
				<content:encoded><![CDATA[<p>To delete large number of rows, for instance rows with date until 2010, you can issue this simple statement.</p>
<p><pre><code>
SQL&gt; DELETE FROM T WHERE C&lt;DATE &#039;2011-01-01&#039;;
1&#039;000&#039;000&#039;000 rows deleted 
Elapsed: 23:45:22.01
SQL&gt; commit;
</code></pre></p>
<p>This is perfectly fine. The table remains online, other users are not much affected (maybe they will not even notice the lower IO performance).</p>
<p>It will generate quite a lot of UNDO, and you will need enough space for archivelog and a large undo tablespace and a large undo retention setting (to prevent ORA-01555 snapshot too old).</p>
<p>If your table is like 100G big, you do it during week-end, you have 500Gb Undo and 250G free space in your archive destination, you will be fine. Well. Maybe.</p>
<p>There are workarounds where you create a new table then rename etc&#8230; but this is not the scope of this post and you will need to validate your index / foreign keys / online strategy with the application guys.</p>
<p>Another way to decrease runtime pro statement and undo requirement pro statement (but increase overall elapsed time) is to divided it chunks, for instance to delete 100&#8217;000&#8217;000 rows each night during 10 days.</p>
<p><pre><code>
SQL&gt; DELETE FROM T WHERE C&lt;DATE &#039;2011-01-01&#039; AND ROWNUM&lt;=100000000;
100&#039;000&#039;000 rows deleted 
Elapsed: 04:11:15.31
SQL&gt; commit;
</code></pre></p>
<p>Or if you want to delete in much smaller chunks to accomodate your tiny undo tablespace, you could try</p>
<p><pre><code>
BEGIN
&nbsp;&nbsp;LOOP
&nbsp;&nbsp;&nbsp;&nbsp;DELETE FROM T WHERE C&lt;DATE &#039;2011-01-01&#039; AND ROWNUM &lt;= 1000;
&nbsp;&nbsp;&nbsp;&nbsp;EXIT WHEN SQL%ROWCOUNT = 0;
&nbsp;&nbsp;&nbsp;&nbsp;COMMIT;
&nbsp;&nbsp; END LOOP;
END;
/
</code></pre></p>
<p>This will run longer than a single transaction, but it is quite usefull if your undo tablespace is too small. Also if you abort it (CTRL-C or kill session), you will not lose all progresses (but you lose on integrity/atomicity) and your KILL SESSION will not last for ever. With a single transaction, your session may be marked as killed for hours/days&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/04/delete-one-billion-row.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>When v$session_longops is not long enough</title>
		<link>http://laurentschneider.com/wordpress/2013/04/when-vsession_longops-is-not-long-enough.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/04/when-vsession_longops-is-not-long-enough.html#comments</comments>
		<pubDate>Sun, 21 Apr 2013 08:00:15 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[dba]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[v$session_longops]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1549</guid>
		<description><![CDATA[With large table scans, sometimes the estimated total work is far beyond reality SQL&#62; select message from v$session_longops where target=&#039;SCOTT.EMP&#039;; MESSAGE ------------------------------------------------------------ Table Scan:&#160;&#160;SCOTT.EMP: 7377612 out of 629683 Blocks done The total work is the Oracle estimation : SQL&#62; select blocks from dba_tables where table_name=&#039;EMP&#039;; &#160;&#160;&#160;&#160;BLOCKS ---------- &#160;&#160;&#160;&#160;629683 This may differ quite a lot from [...]]]></description>
				<content:encoded><![CDATA[<p>With large table scans, sometimes the estimated total work is far beyond reality</p>
<p><pre><code>
SQL&gt; select message from v$session_longops where target=&#039;SCOTT.EMP&#039;;

MESSAGE
------------------------------------------------------------
Table Scan:&nbsp;&nbsp;SCOTT.EMP: 7377612 out of 629683 Blocks done
</code></pre></p>
<p>The total work is the Oracle estimation :<br />
<pre><code>
SQL&gt; select blocks from dba_tables where table_name=&#039;EMP&#039;;

&nbsp;&nbsp;&nbsp;&nbsp;BLOCKS
----------
&nbsp;&nbsp;&nbsp;&nbsp;629683
</code></pre></p>
<p>This may differ quite a lot from the segment size, for instance if the table is not very often analyzed :</p>
<p><pre><code>
SQL&gt; select blocks, sysdate, last_analyzed from dba_tables where table_name=&#039;EMP&#039;;

&nbsp;&nbsp;&nbsp;&nbsp;BLOCKS SYSDATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LAST_ANALYZED
---------- ------------------- -------------------
&nbsp;&nbsp;&nbsp;&nbsp;629683 2013-04-21_09:21:47 2007-10-13_21:40:58

SQL&gt; select blocks from dba_segments where segment_name=&#039;EMP&#039;;

&nbsp;&nbsp;&nbsp;&nbsp;BLOCKS
----------
&nbsp;&nbsp; 7749888
</code></pre></p>
<p>I have customized my very long ops query to deal with very long waits.</p>
<p><pre><code>
col target for a20
set lin 150 pages 40000 termout off
alter session set nls_currency=&#039;%&#039;;
col PCT_DONE for 990.00L jus r
col time_remaining for 999999

select
&nbsp;&nbsp;lo.target,lo.sofar,seg.blocks,
&nbsp;&nbsp;lo.ELAPSED_SECONDS*seg.blocks/lo.sofar-lo.ELAPSED_SECONDS TIME_REMAINING,
&nbsp;&nbsp;100*lo.sofar/seg.blocks PCT_DONE
from
&nbsp;&nbsp;dba_segments seg,
&nbsp;&nbsp;v$session_longops lo
where
&nbsp;&nbsp;lo.units=&#039;Blocks&#039;
&nbsp;&nbsp;and lo.totalwork&gt;0 and (lo.time_remaining&gt;0 or lo.time_remaining is null)
&nbsp;&nbsp;and regexp_substr(lo.target,&#039;[^.]+&#039;) = seg.owner
&nbsp;&nbsp;and regexp_substr(lo.target,&#039;[^.]+$&#039;) = seg.segment_name
/
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/04/when-vsession_longops-is-not-long-enough.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generate Microsoft Office Documents from command line</title>
		<link>http://laurentschneider.com/wordpress/2013/04/generate-microsoft-office-documents-from-command-line.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/04/generate-microsoft-office-documents-from-command-line.html#comments</comments>
		<pubDate>Thu, 04 Apr 2013 10:13:55 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[sqlplus]]></category>
		<category><![CDATA[Office Format]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1543</guid>
		<description><![CDATA[In previous posts (e.g. Export to Excel) I wrote about using HTML format to export to Excel. Let&#8217;s do it for real, let&#8217;s dive into the .xls file format and learn how to generate dynamic excel from Unix! 1) create one time your excel file manually. With graphs, colors, sounds, up to you. Or Word, [...]]]></description>
				<content:encoded><![CDATA[<p>In previous posts (e.g. <a href="http://laurentschneider.com/wordpress/2007/05/export-to-excel.html">Export to Excel</a>) I wrote about using HTML format to export to Excel.</p>
<p>Let&#8217;s do it for real, let&#8217;s dive into the .xls file format and learn how to generate dynamic excel from Unix!</p>
<p>1) create one time your excel file manually. With graphs, colors, sounds, up to you. Or Word, Powerpoint or whatever (minimum MS Office 2007)<br />
<img src="http://laurentschneider.com/wordpress/wp-content/uploads/2013/04/excel-screenshot.jpg" alt="excel-screenshot" class="alignnone size-full wp-image-1544" /></p>
<p>2) save as excel 2007 or later format (.xlsx)<br />
this is called the <a href="http://en.wikipedia.org/wiki/Office_Open_XML">Office Open XML</a> format. It is neither OpenOffice nor OpenSource. It is XML and license restriction may apply. </p>
<p>3) transfer the excel file to your favorite platform</p>
<p>4) unzip the excel file (yes, you read it correctly, unzip the .xlsx file)<br />
<pre><code>
$ unzip /tmp/DynamicExcel.xlsx
Archive:&nbsp;&nbsp;/tmp/DynamicExcel.xlsx
&nbsp;&nbsp;inflating: [Content_Types].xml
&nbsp;&nbsp;inflating: _rels/.rels
&nbsp;&nbsp;inflating: xl/_rels/workbook.xml.rels
&nbsp;&nbsp;inflating: xl/workbook.xml
&nbsp;&nbsp;inflating: xl/styles.xml
&nbsp;&nbsp;inflating: xl/worksheets/sheet2.xml
&nbsp;&nbsp;inflating: xl/worksheets/_rels/sheet1.xml.rels
&nbsp;&nbsp;inflating: xl/worksheets/_rels/sheet2.xml.rels
&nbsp;&nbsp;inflating: xl/drawings/_rels/drawing1.xml.rels
&nbsp;&nbsp;inflating: xl/theme/theme1.xml
&nbsp;&nbsp;inflating: xl/worksheets/sheet1.xml
&nbsp;&nbsp;inflating: xl/drawings/drawing2.xml
&nbsp;&nbsp;inflating: xl/charts/chart1.xml
&nbsp;&nbsp;inflating: xl/drawings/drawing1.xml
&nbsp;&nbsp;inflating: xl/sharedStrings.xml
&nbsp;&nbsp;inflating: docProps/core.xml
&nbsp;&nbsp;inflating: docProps/app.xml
</code></pre></p>
<p>5) now substitute the data with some script output (for instance select * from v$backup_redologs). Here I am substituing all datas from row r=2<br />
<pre><code>
cd xl/worksheets

tr -d &#039;\r&#039; &lt; sheet1.xml | sed &#039;s,&lt;row r=&quot;2&quot;.*,,&#039; &gt; head
sqlplus -s -L / as sysdba &lt;&lt;&#039;EOF&#039; &gt; body
set feed off pages 0 lin 2000 longc 2000 long 2000
SELECT XMLELEMENT (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;row&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlattributes ((rownum+1) AS &quot;r&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;1:2&#039; AS &quot;spans&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;0.2&#039; AS &quot;x14ac:dyDescent&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XMLELEMENT (&quot;c&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlattributes (&#039;A&#039; || (rownum+1) AS &quot;r&quot;, &#039;1&#039; AS &quot;s&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XMLELEMENT (&quot;v&quot;, d-date &#039;1899-12-30&#039;)),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XMLELEMENT (&quot;c&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlattributes (&#039;B&#039; || (rownum+1) AS &quot;r&quot;, &#039;2&#039; AS &quot;s&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XMLELEMENT (&quot;v&quot;, c)))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x
&nbsp;&nbsp;FROM (&nbsp;&nbsp;SELECT TRUNC (next_time, &#039;DD&#039;) d, COUNT (*) c
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM v$backup_redolog
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE next_time BETWEEN TRUNC (SYSDATE - 90)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND TRUNC (SYSDATE) - 1 / 86400
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GROUP BY TRUNC (next_time, &#039;DD&#039;)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORDER BY 1);
EOF
tr -d &#039;\r&#039; &lt; sheet1.xml | sed -n &#039;s,.*&lt;/sheetData&gt;,&lt;/sheetData&gt;,p&#039; &gt; tail
cat head body tail | tr -d &#039;\n&#039; &gt; sheet1.xml
rm head body tail
</code></pre></p>
<p>6) recreate zip file<br />
<pre><code>
$ cd ../..
$ zip -r /tmp/DynamicExcel2.xlsx *
&nbsp;&nbsp;adding: [Content_Types].xml (deflated 78%)
&nbsp;&nbsp;adding: docProps/ (stored 0%)
&nbsp;&nbsp;adding: docProps/core.xml (deflated 51%)
&nbsp;&nbsp;adding: docProps/app.xml (deflated 53%)
&nbsp;&nbsp;adding: _rels/ (stored 0%)
&nbsp;&nbsp;adding: _rels/.rels (deflated 60%)
&nbsp;&nbsp;adding: xl/ (stored 0%)
&nbsp;&nbsp;adding: xl/_rels/ (stored 0%)
&nbsp;&nbsp;adding: xl/_rels/workbook.xml.rels (deflated 71%)
&nbsp;&nbsp;adding: xl/workbook.xml (deflated 42%)
&nbsp;&nbsp;adding: xl/styles.xml (deflated 56%)
&nbsp;&nbsp;adding: xl/worksheets/ (stored 0%)
&nbsp;&nbsp;adding: xl/worksheets/sheet2.xml (deflated 45%)
&nbsp;&nbsp;adding: xl/worksheets/_rels/ (stored 0%)
&nbsp;&nbsp;adding: xl/worksheets/_rels/sheet1.xml.rels (deflated 39%)
&nbsp;&nbsp;adding: xl/worksheets/_rels/sheet2.xml.rels (deflated 39%)
&nbsp;&nbsp;adding: xl/worksheets/sheet1.xml (deflated 81%)
&nbsp;&nbsp;adding: xl/drawings/ (stored 0%)
&nbsp;&nbsp;adding: xl/drawings/_rels/ (stored 0%)
&nbsp;&nbsp;adding: xl/drawings/_rels/drawing1.xml.rels (deflated 39%)
&nbsp;&nbsp;adding: xl/drawings/drawing2.xml (deflated 58%)
&nbsp;&nbsp;adding: xl/drawings/drawing1.xml (deflated 61%)
&nbsp;&nbsp;adding: xl/theme/ (stored 0%)
&nbsp;&nbsp;adding: xl/theme/theme1.xml (deflated 79%)
&nbsp;&nbsp;adding: xl/charts/ (stored 0%)
&nbsp;&nbsp;adding: xl/charts/chart1.xml (deflated 85%)
&nbsp;&nbsp;adding: xl/sharedStrings.xml (deflated 22%)
</code></pre></p>
<p>7) Check it</p>
<p><a href="http://laurentschneider.com/wordpress/wp-content/uploads/2013/04/DynamicExcel2.xlsx">DynamicExcel2.xlsx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/04/generate-microsoft-office-documents-from-command-line.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Default Oracle Home in Windows</title>
		<link>http://laurentschneider.com/wordpress/2013/03/default-oracle-home-in-windows.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/03/default-oracle-home-in-windows.html#comments</comments>
		<pubDate>Tue, 19 Mar 2013 17:45:57 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[home selector]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1536</guid>
		<description><![CDATA[In Oracle Universal Installer and OPatch User&#8217;s Guide it is documented that The first Oracle home is named the &#8220;DEFAULT_HOME&#8221; and registers itself in the Windows NT Registry. Remember, NT means New Technology There is apparently a Home Selector that is a part of the installation software, maybe something like D:\oracle\product\11.2.0\client_1\bin\selecthome.bat. Sometimes. Not sure But [...]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://docs.oracle.com/cd/E11882_01/em.112/e12255/oui2_manage_oracle_homes.htm#OUICG163">Oracle Universal Installer and OPatch User&#8217;s Guide</a> it is documented that <i>The first Oracle home is named the &#8220;DEFAULT_HOME&#8221; and registers itself in the Windows NT Registry</i>.</p>
<p>Remember, NT means New Technology <img src='http://laurentschneider.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>There is apparently a <i>Home Selector that is a part of the installation software</i>, maybe something like D:\oracle\product\11.2.0\client_1\bin\selecthome.bat. Sometimes. Not sure</p>
<p>But there is no DEFAULT HOME in the registry. </p>
<p><pre><code>PS C:\&gt; gci HKLM:\SOFTWARE\ORACLE

&nbsp;&nbsp;&nbsp;&nbsp;Hive: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

Name&nbsp;&nbsp;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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NLS_LANG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: AMERICAN_AMERICA.WE8MSWIN1252
KEY_oracle_sysman_db_12_1_0_2_ ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:\oracle\plugins\oracle.sysman.db.discovery.plugin_12.1.0.2.0
0_discovery_Home0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORACLE_HOME_NAME&nbsp;&nbsp;: oracle_sysman_db_12_1_0_2_0_discovery_Home0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_GROUP_NAME : Oracle - oracle_sysman_db_12_1_0_2_0_discovery_Home0
KEY_oracle_sysman_emas_12_1_0_ ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:\oracle\plugins\oracle.sysman.emas.discovery.plugin_12.1.0.2.0
2_0_discovery_Home0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORACLE_HOME_NAME&nbsp;&nbsp;: oracle_sysman_emas_12_1_0_2_0_discovery_Home0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_GROUP_NAME : Oracle - oracle_sysman_emas_12_1_0_2_0_discovery_Home0
KEY_oracle_sysman_oh_12_1_0_1_ ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:\oracle\plugins\oracle.sysman.oh.agent.plugin_12.1.0.1.0
0_agent_Home0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORACLE_HOME_NAME&nbsp;&nbsp;: oracle_sysman_oh_12_1_0_1_0_agent_Home0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_GROUP_NAME : Oracle - oracle_sysman_oh_12_1_0_1_0_agent_Home0
KEY_oracle_sysman_oh_12_1_0_1_ ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:\oracle\plugins\oracle.sysman.oh.discovery.plugin_12.1.0.1.0
0_discovery_Home0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORACLE_HOME_NAME&nbsp;&nbsp;: oracle_sysman_oh_12_1_0_1_0_discovery_Home0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:\oracle\sbin
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_HOME_NAME&nbsp;&nbsp;: sbin12c1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_GROUP_NAME : Oracle - sbin12c1
ODP.NET
remexecservicectr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remaining_time : 120000
SYSMAN
</code></pre></p>
<p>How do I set my Oracle Home? </p>
<p>Actually if you enter a command like &#8220;lsnrctl start&#8221;, the OS will search in the PATH for lsnrctl and determines the Oracle Home name accordingly. </p>
<p>Therefore, the only thing you must do to change your default Oracle Home is to <b>set the PATH environment variable</b>. Only then your LSNRCTL START will find the right binary and right parameter file to start your listener.</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/03/default-oracle-home-in-windows.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BUILD DEFERRED takes ages</title>
		<link>http://laurentschneider.com/wordpress/2013/03/build-deferred-takes-ages.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/03/build-deferred-takes-ages.html#comments</comments>
		<pubDate>Tue, 12 Mar 2013 09:27:38 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[materialized view]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1533</guid>
		<description><![CDATA[When building a materialized view, you may want to postpone the loading to a later phase, for instance you install a new release, and the refresh happends every night. BUILD DEFERRED allow you to build an empty materialized view and refresh it later. But this may still takes ages. SQL&#62; create materialized view mv1 build [...]]]></description>
				<content:encoded><![CDATA[<p>When building a materialized view, you may want to postpone the loading to a later phase, for instance you install a new release, and the refresh happends every night.</p>
<p>BUILD DEFERRED allow you to build an empty materialized view and refresh it later. But this may still takes ages.</p>
<p><pre><code>
SQL&gt; create materialized view mv1 build deferred as select count(*) c from emp,emp,emp,emp,emp,emp,emp;

Materialized view created.

Elapsed: 00:00:17.28
SQL&gt; select * from mv1;

no rows selected
</code></pre></p>
<p>No data collected, but still a long time (17sec here, but much worst in real life)</p>
<p>A workaround is to use ON PREBUILT TABLE on an empty table, just add a few WHERE 1=0 in your subqueries<br />
<pre><code>
SQL&gt; create table mv1 as select * from (select count(*) c from emp,emp,emp,emp,emp,emp,emp where 1=0) where 1=0;

Table created.

Elapsed: 00:00:00.04
SQL&gt; create materialized view mv1 on prebuilt table as select count(*) c from emp,emp,emp,emp,emp,emp,emp;

Materialized view created.

Elapsed: 00:00:00.15
SQL&gt; select * from mv1;

no rows selected

Elapsed: 00:00:00.00
</code></pre></p>
<p>Much faster !</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/03/build-deferred-takes-ages.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rman and DBGSQL message</title>
		<link>http://laurentschneider.com/wordpress/2013/02/rman-and-dbgsql-message.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/02/rman-and-dbgsql-message.html#comments</comments>
		<pubDate>Fri, 01 Feb 2013 17:20:43 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[rman]]></category>
		<category><![CDATA[DBGSQL]]></category>
		<category><![CDATA[sqlcode]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1529</guid>
		<description><![CDATA[I have not seen DBGSQL very often. But today again, a duplicate in RMAN was failing with, amoung other errors, sqlcode 911 RMAN&#62; duplicate target database to DB02 &#160;&#160;until time &#34;to_date(&#039;2013-01-29_00:00:00&#039;,&#039;YYYY-MM-DD_HH24:MI:SS&#039;)&#34; &#160;&#160;nofilenamecheck ; DBGSQL:&#160;&#160;&#160;&#160; TARGET&#62; select 2013-01-29_00:00:00 from sys.dual DBGSQL:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sqlcode = 911 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure [...]]]></description>
				<content:encoded><![CDATA[<p>I have not seen DBGSQL very often. But today again, a duplicate in RMAN was failing with, amoung other errors, sqlcode 911</p>
<p><pre><code>
RMAN&gt; duplicate target database to DB02
&nbsp;&nbsp;until time &quot;to_date(&#039;2013-01-29_00:00:00&#039;,&#039;YYYY-MM-DD_HH24:MI:SS&#039;)&quot;
&nbsp;&nbsp;nofilenamecheck ;

DBGSQL:&nbsp;&nbsp;&nbsp;&nbsp; TARGET&gt; select 2013-01-29_00:00:00 from sys.dual
DBGSQL:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sqlcode = 911
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/01/2013 17:58:23
RMAN-05501: aborting duplication of target database
ORA-01861: literal does not match format string
</code></pre></p>
<p>I have not found anything useful except bug Bug 9351175 which is fixed in 11.2 (and I have 11.2.0.2/aix), but I could workaround the problem with </p>
<p><pre><code>
unset NLS_DATE_FORMAT
</code></pre></p>
<p>Because I do like to have readable timestamp (with seconds) in my RMAN logs, I set NLS_DATE_FORMAT in my spfile<br />
<pre><code>
alter system set nls_date_format=&#039;YYYY-MM-DD_HH24:MI:SS&#039;;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/02/rman-and-dbgsql-message.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Book review : EM12c</title>
		<link>http://laurentschneider.com/wordpress/2013/01/book-review-em12c.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/01/book-review-em12c.html#comments</comments>
		<pubDate>Fri, 11 Jan 2013 12:57:12 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[book]]></category>
		<category><![CDATA[OEM]]></category>
		<category><![CDATA[book review]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1520</guid>
		<description><![CDATA[OCM Oracle ACE Porus Homi Havewala wrote a new book on Cloud Control Oracle Enterprise Manager Cloud Control 12c: Managing Data Center Chaos It is a book about Enterprise Manager, but also a book about the Chaos. There is no separation of roles [...] there is no DBA Designer (the Senior DBA) [...] and no [...]]]></description>
				<content:encoded><![CDATA[<p>OCM Oracle ACE Porus Homi Havewala wrote a new book on Cloud Control </p>
<p><a href="http://www.amazon.com/dp/1849684782?tag=laureschne-20" target="_blank">Oracle Enterprise Manager Cloud Control 12c: Managing Data Center Chaos</a></p>
<p>It is a book about Enterprise Manager, but also a book about the Chaos.</p>
<blockquote><p>There is no separation of roles [...] there is no DBA Designer (the Senior DBA) [...] and no DBA Operator (the Junior DBA). The Senior [...] does not even have the time  [...] the Junior then decides to try out different things</p></blockquote>
<p>It is also a book about em. And about 12c. No mention of 12cR2, which is massively more performant. </p>
<p>I have been using 12c for about one year and multiple topics are covered. There is not much said on the Incident Manager, which seems to be powerfull but it is for me more time consuming than acknowledging the alerts in 10g/11g.</p>
<p>There is a huge advantage of using 12c, to deploy new agents and new targets in very large shops. </p>
<p>I have setup the software library in offline mode (download with pc from metalink and load in em with emcli), the offline fashion is not documented. In all the places where I have been working, an internet communication between outside world (oracle.com) and database server is banned. </p>
<p>Lot&#8217;s of screenshots on Exadata. Not sure where the author could try it, the domain were grayed out (why not edit to example.com with Photoshop? )</p>
<p>There is a lot of content (almost 400 pages), to mention only a few : Real Time ADDM, Real Application Testing, Database deployment, data masking.</p>
<p>At the end of book you will enjoy the case studies. Reading thru the lines, it is not always success stories, but rather expectations that em will do the job</p>
<blockquote><p>The bank also wanted to ensure that their data center was in compliance with security best practices.</p></blockquote>
<p>As in any IT book, you do not have to read it from page 1 to page 379, myself I have no DB Machine so I could skip the largest chapter which is on Exadata. But it is a pleasant lecture.</p>
<p>The book is very friendly with Oracle. I have experienced awful performance in 12cR1 and Internet Explorer, some annoying and unavoidable java exceptions in the web interface and the dumbest requirement for me was to install cygwin, bash, ssh on one windows server only to deploy the agent!</p>
<p>I recommend the book, it is a good book</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/01/book-review-em12c.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How big was my database last month</title>
		<link>http://laurentschneider.com/wordpress/2012/12/how-big-was-my-database-last-month.html</link>
		<comments>http://laurentschneider.com/wordpress/2012/12/how-big-was-my-database-last-month.html#comments</comments>
		<pubDate>Fri, 21 Dec 2012 10:22:53 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[dba]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[backup history]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1512</guid>
		<description><![CDATA[If you backup your database at least weekly, you could check the datafile size from your backup history. Without catalog : select to_char(d,&#039;&#34;W&#34;IW-IYYY&#039;) compl, sum(b)/1024/1024/1024*8192 GB from ( &#160;&#160;select max(DATAFILE_BLOCKS) b, trunc(completion_time,&#039;IW&#039;) d &#160;&#160;from v$backup_datafile &#160;&#160;group by FILE# ,trunc(completion_time,&#039;IW&#039;) ) group by d order by d; COMPL&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;GB -------- ------ W30-2012&#160;&#160; 3.73 W31-2012&#160;&#160; 4.84 W32-2012&#160;&#160; 5.00 [...]]]></description>
				<content:encoded><![CDATA[<p>If you backup your database at least weekly, you could check the datafile size from your backup history.</p>
<p>Without catalog :<br />
<pre><code>
select to_char(d,&#039;&quot;W&quot;IW-IYYY&#039;) compl, sum(b)/1024/1024/1024*8192 GB 
from 
(
&nbsp;&nbsp;select max(DATAFILE_BLOCKS) b, trunc(completion_time,&#039;IW&#039;) d 
&nbsp;&nbsp;from v$backup_datafile 
&nbsp;&nbsp;group by FILE# ,trunc(completion_time,&#039;IW&#039;)
) 
group by d 
order by d;
</code></pre></p>
<p><pre><code>
COMPL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GB
-------- ------
W30-2012&nbsp;&nbsp; 3.73
W31-2012&nbsp;&nbsp; 4.84
W32-2012&nbsp;&nbsp; 5.00
W33-2012&nbsp;&nbsp; 5.05
W34-2012&nbsp;&nbsp; 5.35
W35-2012&nbsp;&nbsp; 5.80
W36-2012&nbsp;&nbsp; 6.12
W37-2012&nbsp;&nbsp; 6.39
W38-2012&nbsp;&nbsp;&nbsp;&nbsp;.93
W39-2012&nbsp;&nbsp; 7.02
W40-2012&nbsp;&nbsp; 7.56
W41-2012&nbsp;&nbsp; 7.72
W42-2012&nbsp;&nbsp; 7.88
W43-2012&nbsp;&nbsp; 8.08
W44-2012&nbsp;&nbsp; 8.83
W45-2012&nbsp;&nbsp; 9.03
W46-2012&nbsp;&nbsp; 9.45
W47-2012&nbsp;&nbsp; 9.61
W48-2012&nbsp;&nbsp;10.11
W49-2012&nbsp;&nbsp;10.29
W50-2012&nbsp;&nbsp;10.38
</code></pre></p>
<p>The history mostly depends on control_file_record_keep_time. If you do not use an rman catalog, set it to a high value like 93 (3M) or 366 (1Y)</p>
<p>With the rman catalog, use the RC_ view</p>
<p><pre><code>
select DB_NAME,to_char(d,&#039;&quot;W&quot;IW-IYYY&#039;) compl, sum(b)/1024/1024/1024*8192 GB 
from 
(
&nbsp;&nbsp;select DB_NAME,max(DATAFILE_BLOCKS) b, trunc(completion_time,&#039;IW&#039;) d 
&nbsp;&nbsp;from rc_backup_datafile 
&nbsp;&nbsp;group by DB_NAME,FILE# ,trunc(completion_time,&#039;IW&#039;)
) 
group by DB_NAME,d 
order by DB_NAME,d;
</code></pre></p>
<p><pre><code>
DB_NAME&nbsp;&nbsp;COMPL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GB
-------- -------- ------
DB01&nbsp;&nbsp;&nbsp;&nbsp; W30-2012&nbsp;&nbsp; 3.73
DB01&nbsp;&nbsp;&nbsp;&nbsp; W31-2012&nbsp;&nbsp; 4.83
DB01&nbsp;&nbsp;&nbsp;&nbsp; W32-2012&nbsp;&nbsp; 5.00
DB01&nbsp;&nbsp;&nbsp;&nbsp; W33-2012&nbsp;&nbsp; 5.05
DB01&nbsp;&nbsp;&nbsp;&nbsp; W34-2012&nbsp;&nbsp; 5.34
DB01&nbsp;&nbsp;&nbsp;&nbsp; W35-2012&nbsp;&nbsp; 5.79
DB01&nbsp;&nbsp;&nbsp;&nbsp; W36-2012&nbsp;&nbsp; 6.11
DB01&nbsp;&nbsp;&nbsp;&nbsp; W37-2012&nbsp;&nbsp; 6.39
DB01&nbsp;&nbsp;&nbsp;&nbsp; W38-2012&nbsp;&nbsp;&nbsp;&nbsp;.93
DB01&nbsp;&nbsp;&nbsp;&nbsp; W39-2012&nbsp;&nbsp; 7.01
DB01&nbsp;&nbsp;&nbsp;&nbsp; W40-2012&nbsp;&nbsp; 7.56
DB01&nbsp;&nbsp;&nbsp;&nbsp; W41-2012&nbsp;&nbsp; 7.71
DB01&nbsp;&nbsp;&nbsp;&nbsp; W42-2012&nbsp;&nbsp; 7.87
DB01&nbsp;&nbsp;&nbsp;&nbsp; W43-2012&nbsp;&nbsp; 8.08
DB01&nbsp;&nbsp;&nbsp;&nbsp; W44-2012&nbsp;&nbsp; 8.82
DB01&nbsp;&nbsp;&nbsp;&nbsp; W45-2012&nbsp;&nbsp; 9.02
DB01&nbsp;&nbsp;&nbsp;&nbsp; W46-2012&nbsp;&nbsp; 9.44
DB01&nbsp;&nbsp;&nbsp;&nbsp; W47-2012&nbsp;&nbsp; 9.60
DB01&nbsp;&nbsp;&nbsp;&nbsp; W48-2012&nbsp;&nbsp;10.10
DB01&nbsp;&nbsp;&nbsp;&nbsp; W49-2012&nbsp;&nbsp;10.28
DB01&nbsp;&nbsp;&nbsp;&nbsp; W50-2012&nbsp;&nbsp;10.37
</code></pre></p>
<p>If you need to check which table grows the most, check <a href="http://laurentschneider.com/wordpress/2012/12/how-big-was-my-table-yesterday.html">How big was my table yesterday</a>. But remember, RMAN backup is free to use, AWR and the WRI$ tables require the diagnostic pack and the Enterprise edition</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2012/12/how-big-was-my-database-last-month.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
