<?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>Tue, 18 Jun 2013 12:44:50 +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>Oracle ODBC hello world with powershell</title>
		<link>http://laurentschneider.com/wordpress/2013/06/oracle-odbc-hello-world-with-powershell.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/06/oracle-odbc-hello-world-with-powershell.html#comments</comments>
		<pubDate>Tue, 18 Jun 2013 12:44:50 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[odbc]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1589</guid>
		<description><![CDATA[Demo : cmd /c &#34;odbcconf.exe /a {configdsn &#34;&#34;Oracle in OraClient11g_home1&#34;&#34; &#34;&#34;DSN=helloworld&#124;SERVER=DB01&#34;&#34;}&#34; Create a helloworld data source connecting to your DB01 tns alias in your OraClient11g_home1 Oracle Home. It is easy to get the Oracle Home key with Get-itemproperty HKLM:\SOFTWARE\ORACLE\*&#124; Select-Object ORACLE_HOME,ORACLE_HOME_KEY ORACLE_HOME&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ORACLE_HOME_KEY -----------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --------------- C:\oracle\product\11.1.0\client_1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOFTWARE\ORACLE\KEY_OraClient11g_home1 C:\oracle\product\11.2.0\client_1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SOFTWARE\ORACLE\KEY_OraClient11g_home2 Then we create the connection (as [...]]]></description>
				<content:encoded><![CDATA[<p>Demo :<br />
<pre><code>
cmd /c &quot;odbcconf.exe /a {configdsn &quot;&quot;Oracle in OraClient11g_home1&quot;&quot; &quot;&quot;DSN=helloworld|SERVER=DB01&quot;&quot;}&quot;
</code></pre></p>
<p>Create a <i>helloworld</i> data source connecting to your <i>DB01</i> tns alias in your <i>OraClient11g_home1</i> Oracle Home.</p>
<p>It is easy to get the Oracle Home key with<br />
<pre><code>
Get-itemproperty HKLM:\SOFTWARE\ORACLE\*| Select-Object ORACLE_HOME,ORACLE_HOME_KEY

ORACLE_HOME&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_HOME_KEY
-----------&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------------
C:\oracle\product\11.1.0\client_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SOFTWARE\ORACLE\KEY_OraClient11g_home1
C:\oracle\product\11.2.0\client_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SOFTWARE\ORACLE\KEY_OraClient11g_home2
</code></pre></p>
<p>Then we create the connection (as we did in <a href="http://laurentschneider.com/wordpress/2012/03/to-ado-or-to-odp.html">ADO or ODP</a>) :<br />
<pre><code>
$conn = New-Object Data.Odbc.OdbcConnection
$conn.ConnectionString= &quot;dsn=helloworld;uid=scott;pwd=tiger;&quot;
$conn.open()
(new-Object Data.Odbc.OdbcCommand(&quot;select &#039;Hello World&#039; from dual&quot;,$conn)).ExecuteScalar()
$conn.close()
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/06/oracle-odbc-hello-world-with-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to rename datafiles on standby</title>
		<link>http://laurentschneider.com/wordpress/2013/06/how-to-rename-datafiles-on-standby.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/06/how-to-rename-datafiles-on-standby.html#comments</comments>
		<pubDate>Fri, 14 Jun 2013 16:27:30 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[dataguard]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1581</guid>
		<description><![CDATA[If you rename a file with alter database on primary, it will not occur on standby. If you want to rename it on standby to, you need to do it manually cancel the recovery (set dg_broker_start to false and restart db in mount status if you use dataguard) set the standby file management to manual [...]]]></description>
				<content:encoded><![CDATA[<p>If you rename a file with alter database on primary, it will not occur on standby. If you want to rename it on standby to, you need to do it manually</p>
<ol>
<li>cancel the recovery (set dg_broker_start to false and restart db in mount status if you use dataguard)</li>
<li>set the standby file management to manual <i>alter system set standby_file_management=manual</i></li>
<li>move the file with OS commands as you did on the primary</li>
<li>rename the file with <i>alter database rename file &#8216;old&#8217; to &#8216;new&#8217;</i></li>
<li>reenable automatic standby file management and dg broker and restart the recovery (start db in mount status if you use dataguard)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/06/how-to-rename-datafiles-on-standby.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best practice : use double quotes, even in DBMS_STATS</title>
		<link>http://laurentschneider.com/wordpress/2013/06/best-practice-use-double-quotes-even-in-dbms_stats.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/06/best-practice-use-double-quotes-even-in-dbms_stats.html#comments</comments>
		<pubDate>Tue, 11 Jun 2013 08:38:01 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[dbms_stats]]></category>
		<category><![CDATA[invalid identifier]]></category>
		<category><![CDATA[reserved keyword]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1577</guid>
		<description><![CDATA[Whenever you create a table, it is better to use double quotes to avoid invalid identified. SQL&#62; CREATE TABLE /XXX(x number); CREATE TABLE /XXX(x number) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * ERROR at line 1: ORA-00903: invalid table name SQL&#62; CREATE TABLE &#34;/XXX&#34;(x number); Table created. Even in DBMS_STATS you should use double quotes SQL&#62; exec dbms_stats.gather_table_stats(user,&#039;/XXX&#039;) BEGIN dbms_stats.gather_table_stats(user,&#039;/XXX&#039;); [...]]]></description>
				<content:encoded><![CDATA[<p>Whenever you create a table, it is better to use double quotes to avoid invalid identified.<br />
<pre><code>
SQL&gt; CREATE TABLE /XXX(x number);
CREATE TABLE /XXX(x number)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
ERROR at line 1:
ORA-00903: invalid table name

SQL&gt; CREATE TABLE &quot;/XXX&quot;(x number);

Table created.
</code></pre></p>
<p>Even in DBMS_STATS you should use double quotes</p>
<p><pre><code>
SQL&gt; exec dbms_stats.gather_table_stats(user,&#039;/XXX&#039;)
BEGIN dbms_stats.gather_table_stats(user,&#039;/XXX&#039;); END;

*
ERROR at line 1:
ORA-20001: /XXX is an invalid identifier
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 23829
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 23880
ORA-06512: at line 1

SQL&gt; exec dbms_stats.gather_table_stats(user,&#039;&quot;/XXX&quot;&#039;)

PL/SQL procedure successfully completed.
</code></pre></p>
<p>It is also a good practice to not use table name like &#8220;/XXX&#8221;, &#8220;FROM&#8221; or &#8220;ROWID&#8221;. But if you use dynamic SQL, be sure your code does not bug on invalid identifier.</p>
<p>It is pretty seldom that Oracle introduces new reserved words, as it breaks code, so if you do<br />
<pre><code>
CREATE TABLE MYTABLE(x number);
</code></pre><br />
you can be pretty sure that neither MYTABLE nor X will be reserved in 12c or 13c&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/06/best-practice-use-double-quotes-even-in-dbms_stats.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rman backup compression</title>
		<link>http://laurentschneider.com/wordpress/2013/06/rman-backup-compression.html</link>
		<comments>http://laurentschneider.com/wordpress/2013/06/rman-backup-compression.html#comments</comments>
		<pubDate>Wed, 05 Jun 2013 12:15:49 +0000</pubDate>
		<dc:creator>Laurent Schneider</dc:creator>
				<category><![CDATA[11gR2]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[advanced compression]]></category>

		<guid isPermaLink="false">http://laurentschneider.com/?p=1572</guid>
		<description><![CDATA[Did you know you can make your backup at least twice faster with a single line ? Demo : RMAN&#62; backup as compressed backupset database; Starting backup at 2013-06-05_13:08:01 ... Finished backup at 2013-06-05_13:13:59 6 minutes for a compressed backup on a NAS with 24 Channels and 100Gb of raw data. Not bad. But look [...]]]></description>
				<content:encoded><![CDATA[<p>Did you know you can make your backup at least twice faster with a single line ?</p>
<p>Demo :<br />
<pre><code>
RMAN&gt; backup as compressed backupset database;
Starting backup at 2013-06-05_13:08:01
...
Finished backup at 2013-06-05_13:13:59
</code></pre></p>
<p>6 minutes for a compressed backup on a NAS with 24 Channels and 100Gb of raw data. Not bad. But look at this !</p>
<p><pre><code>
RMAN&gt; configure compression algorithm &#039;low&#039;;
new RMAN configuration parameters are successfully stored
RMAN&gt; backup as compressed backupset database;
Starting backup at 2013-06-05_14:06:09
...
Finished backup at 2013-06-05_14:08:29
RMAN&gt; configure compression algorithm clear;
RMAN configuration parameters are successfully reset to default value
</code></pre></p>
<p>By configuring this magic parameter, it is now more than twice faster ! This is incredible !</p>
<p>Go to your cashier and grab some coins to get this amazing <a href="http://www.oracle.com/fr/products/database/options/advanced-compression/overview/index.html">advanced compression</a> option !</p>
]]></content:encoded>
			<wfw:commentRss>http://laurentschneider.com/wordpress/2013/06/rman-backup-compression.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>4</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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property
----&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; --------
KEY_agent12c1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : D:/oracle\core\12.1.0.1.0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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;&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;&nbsp;&nbsp; ORACLE_GROUP_NAME : Oracle - oracle_sysman_oh_12_1_0_1_0_discovery_Home0
KEY_OraClient11g_home1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORACLE_HOME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: D:\oracle\product\11.2.0\client_1
&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; : OraClient11g_home1
&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;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>
	</channel>
</rss>
