<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Insert into DUAL</title>
	<atom:link href="http://awads.net/wp/2005/11/08/insert-into-dual/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2005/11/08/insert-into-dual/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Tue, 24 Jan 2012 20:49:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Colin 't Hart</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-51996</link>
		<dc:creator>Colin 't Hart</dc:creator>
		<pubDate>Fri, 22 Feb 2008 11:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-51996</guid>
		<description>&lt;p&gt;One hopes that Oracle have marked dual as read-only in 11g now that we have the facility to make tables read-only!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>One hopes that Oracle have marked dual as read-only in 11g now that we have the facility to make tables read-only!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-50032</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 28 Sep 2006 13:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-50032</guid>
		<description>&lt;p&gt;TOAD shows rows inserted in dual without: 
create table hr_dual asl select * from dual;
But I couldn&#039;t get in in SQLPlus without this statement, not even with rownum &gt; 0 as shown on &lt;a href=&quot;http://asktom.oracle.com&quot; rel=&quot;nofollow&quot;&gt;asktom&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>TOAD shows rows inserted in dual without: 
create table hr_dual asl select * from dual;
But I couldn&#8217;t get in in SQLPlus without this statement, not even with rownum &gt; 0 as shown on <a href="http://asktom.oracle.com" rel="nofollow">asktom</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-2017</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 07 Mar 2006 05:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-2017</guid>
		<description>&lt;p&gt;&lt;i&gt;Wont this impact a serious problem in all the process and applications server which uses dual table&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Yes. So, my advice to you is to never insert/delete/update DUAL.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>Wont this impact a serious problem in all the process and applications server which uses dual table</i></p>

<p>Yes. So, my advice to you is to never insert/delete/update DUAL.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Arun Kumar</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-1994</link>
		<dc:creator>Arun Kumar</dc:creator>
		<pubDate>Mon, 06 Mar 2006 14:34:21 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-1994</guid>
		<description>&lt;p&gt;i have a interesting question...&lt;/p&gt;

&lt;p&gt;say i do&lt;/p&gt;

&lt;p&gt;delete from dual;&lt;/p&gt;

&lt;p&gt;1 row deleted;&lt;/p&gt;

&lt;p&gt;commit;&lt;/p&gt;

&lt;p&gt;commited;&lt;/p&gt;

&lt;p&gt;Now,&lt;/p&gt;

&lt;p&gt;Select *  from dual;&lt;/p&gt;

&lt;p&gt;No rows returned;&lt;/p&gt;

&lt;p&gt;select sysdate from dual;&lt;/p&gt;

&lt;p&gt;No rows returned;&lt;/p&gt;

&lt;p&gt;Wont this impact a serious problem in all the process and applications server which uses dual table for one or other purpose....&lt;/p&gt;

&lt;p&gt;say now if i restart my database... I cant imagine what will happen....&lt;/p&gt;

&lt;p&gt;can anybody say if i&#039;m wrong in any of the things here....&lt;/p&gt;

&lt;p&gt;i havent tried this as i dont want to spoil my server if at all there would be a problem.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>i have a interesting question&#8230;</p>

<p>say i do</p>

<p>delete from dual;</p>

<p>1 row deleted;</p>

<p>commit;</p>

<p>commited;</p>

<p>Now,</p>

<p>Select *  from dual;</p>

<p>No rows returned;</p>

<p>select sysdate from dual;</p>

<p>No rows returned;</p>

<p>Wont this impact a serious problem in all the process and applications server which uses dual table for one or other purpose&#8230;.</p>

<p>say now if i restart my database&#8230; I cant imagine what will happen&#8230;.</p>

<p>can anybody say if i&#8217;m wrong in any of the things here&#8230;.</p>

<p>i havent tried this as i dont want to spoil my server if at all there would be a problem.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: gzhang</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-277</link>
		<dc:creator>gzhang</dc:creator>
		<pubDate>Wed, 09 Nov 2005 16:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-277</guid>
		<description>&lt;p&gt;Yes, dual is magic - see asktom &lt;a href=&quot;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:40476301944675#40756986348091&quot;&gt;article&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, dual is magic &#8211; see asktom <a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:40476301944675#40756986348091">article</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-276</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Wed, 09 Nov 2005 15:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-276</guid>
		<description>&lt;p&gt;Starting with 10g, Oracle does not do a full table scan on DUAL if it does not need to. I have just published &lt;a href=&quot;http://awads.net/wp/2005/11/09/dual-behavior-change/&quot; rel=&quot;nofollow&quot;&gt;a post&lt;/a&gt; about it. &lt;/p&gt;

&lt;p&gt;So, following up on Sergio&#039;s comment, it looks like in 10g, when I &quot;select * from DUAL&quot;, the &quot;FAST DUAL&quot; takes over and returns what it wants to return, one row.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Starting with 10g, Oracle does not do a full table scan on DUAL if it does not need to. I have just published <a href="http://awads.net/wp/2005/11/09/dual-behavior-change/" rel="nofollow">a post</a> about it. </p>

<p>So, following up on Sergio&#8217;s comment, it looks like in 10g, when I &#8220;select * from DUAL&#8221;, the &#8220;FAST DUAL&#8221; takes over and returns what it wants to return, one row.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-273</link>
		<dc:creator>Sergio</dc:creator>
		<pubDate>Wed, 09 Nov 2005 14:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-273</guid>
		<description>&lt;p&gt;Eddie,&lt;/p&gt;

&lt;p&gt;I believe the difference is that when you use DUAL in a DDL statement, the &lt;strong&gt;fast dual&lt;/strong&gt; optimizer path is not used.  For example, I inserted an extra row into DUAL as you did.  Then:&lt;/p&gt;

&lt;pre&gt;
SQL&gt; create table bar as select * from dual
  2  ;

Table created.

SQL&gt; select * from bar;

D
-
X
A

&lt;/pre&gt;

&lt;p&gt;Trace output show that the DDL statement resulted in this explain plan:&lt;/p&gt;

&lt;pre&gt;
Rows     Execution Plan
-------  ---------------------------------------------------
      0  CREATE TABLE STATEMENT   MODE: ALL_ROWS
      0   LOAD AS SELECT OF &#039;BAR&#039;
      0    TABLE ACCESS   MODE: ANALYZED (FULL) OF &#039;DUAL&#039; (TABLE)
&lt;/pre&gt;

&lt;p&gt;Note that full access of the regular DUAL table was used.  &quot;Normal&quot; SELECTs against DUAL access use FAST DUAL these days (I believe since 9i):&lt;/p&gt;

&lt;pre&gt;
Rows     Row Source Operation
-------  ---------------------------------------------------
      1  FAST DUAL  (cr=0 pr=0 pw=0 time=10 us)
&lt;/pre&gt;

&lt;p&gt;Sergio&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Eddie,</p>

<p>I believe the difference is that when you use DUAL in a DDL statement, the <strong>fast dual</strong> optimizer path is not used.  For example, I inserted an extra row into DUAL as you did.  Then:</p>

<pre>
SQL&gt; create table bar as select * from dual
  2  ;

Table created.

SQL&gt; select * from bar;

D
-
X
A

</pre>

<p>Trace output show that the DDL statement resulted in this explain plan:</p>

<pre>
Rows     Execution Plan
-------  ---------------------------------------------------
      0  CREATE TABLE STATEMENT   MODE: ALL_ROWS
      0   LOAD AS SELECT OF 'BAR'
      0    TABLE ACCESS   MODE: ANALYZED (FULL) OF 'DUAL' (TABLE)
</pre>

<p>Note that full access of the regular DUAL table was used.  &#8220;Normal&#8221; SELECTs against DUAL access use FAST DUAL these days (I believe since 9i):</p>

<pre>
Rows     Row Source Operation
-------  ---------------------------------------------------
      1  FAST DUAL  (cr=0 pr=0 pw=0 time=10 us)
</pre>

<p>Sergio</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Baillie</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-272</link>
		<dc:creator>Rob Baillie</dc:creator>
		<pubDate>Wed, 09 Nov 2005 13:35:11 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-272</guid>
		<description>&lt;p&gt;Aye, great way to at least temporarily cripple a database:  add rows to dual, or remove all rows from dual.  That and update all the VARCHAR2 columns in the database (including source code) so that: &lt;pre&gt; the letter l is replaced with the number 1&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Aye, great way to at least temporarily cripple a database:  add rows to dual, or remove all rows from dual.  That and update all the VARCHAR2 columns in the database (including source code) so that: <pre> the letter l is replaced with the number 1</pre></p>]]></content:encoded>
	</item>
	<item>
		<title>By: j</title>
		<link>http://awads.net/wp/2005/11/08/insert-into-dual/comment-page-1/#comment-271</link>
		<dc:creator>j</dc:creator>
		<pubDate>Wed, 09 Nov 2005 06:18:21 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=160#comment-271</guid>
		<description>&lt;p&gt;Back in 9i days we got strange exceptions with ejbs in 9i. Finally we got figured it out what was the problem: there were two rows in table dual..&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Back in 9i days we got strange exceptions with ejbs in 9i. Finally we got figured it out what was the problem: there were two rows in table dual..</p>]]></content:encoded>
	</item>
</channel>
</rss>

