Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 17452 invoked from network); 20 Dec 2007 13:33:22 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 20 Dec 2007 13:33:22 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D34947DDAEC;
 Thu, 20 Dec 2007 14:33:22 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 16796-08; Thu, 20 Dec 2007 14:33:22 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4B6187DD66D;
 Thu, 20 Dec 2007 14:33:22 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 20 Dec 2007 13:45:58 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 43D877DB4C4
 for <oracle-l@freelists.org>; Thu, 20 Dec 2007 13:45:58 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 10232-08 for <oracle-l@freelists.org>;
 Thu, 20 Dec 2007 13:45:58 -0500 (EST)
Received: from corrly01.jabil.com (corrly01.jabil.com [198.51.174.16])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id ACB4D7DC425
 for <oracle-l@freelists.org>; Thu, 20 Dec 2007 13:45:57 -0500 (EST)
X-IronPort-AV: E=Sophos;i="4.24,190,1196658000"; 
   d="scan'208,217";a="111244875"
Received: from unknown (HELO CORCON02.corp.jabil.org) ([172.31.10.200])
  by corrly01.jabil.com with ESMTP; 20 Dec 2007 13:45:55 -0500
Received: from ALFCON01.corp.jabil.org ([172.31.10.199]) by CORCON02.corp.jabil.org with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 20 Dec 2007 13:45:55 -0500
Received: from ALFARSCON01.corp.jabil.org ([172.31.12.56]) by ALFCON01.corp.jabil.org with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 20 Dec 2007 13:45:55 -0500
Received: from alfarsmsg07.corp.jabil.org ([172.31.12.53]) by ALFARSCON01.corp.jabil.org with Microsoft SMTPSVC(6.0.3790.1830);
	 Thu, 20 Dec 2007 13:45:55 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C84338.8DCC3D9E"
Subject: RE: Do selects block truncates?
Date: Thu, 20 Dec 2007 13:45:54 -0500
Message-ID: <C6594C4B5C99CF4E9F536C038021F82B06A3B0BD@alfarsmsg07.corp.jabil.org>
In-Reply-To: <bf46380712201015l14c7e2f1saf9e2c587f62f967@mail.gmail.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Do selects block truncates?
References: <607D6181D9919041BE792D70EF2AEC482434DC@LIMENS.sivsa.int> <OF51C7C2C5.357B046A-ON862573B7.00611597-862573B7.00615E1B@discover.com> <bf46380712201015l14c7e2f1saf9e2c587f62f967@mail.gmail.com>
From: "Tony Aponte" <Tony_Aponte@Jabil.com>
To: "oracle-l" <oracle-l@freelists.org>
X-OriginalArrivalTime: 20 Dec 2007 18:45:55.0745 (UTC) FILETIME=[8DDE6110:01C84338]
X-archive-position: 4051
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Tony_Aponte@Jabil.com
Precedence: normal
Reply-to: Tony_Aponte@Jabil.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------_=_NextPart_001_01C84338.8DCC3D9E
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Could it be that the reader is part of an XA transaction?  I think I
remember a paper or presentation by one of the Wise Men detailing how a
reader that's part of a distributed transaction can block others simply
by executing a Select.

=20

Tony Aponte

=20

________________________________

From: oracle-l-bounce@freelists.org
[mailto:oracle-l-bounce@freelists.org] On Behalf Of Jared Still
Sent: Thursday, December 20, 2007 1:15 PM
To: genegurevich@discover.com
Cc: oracle-l
Subject: Re: Do selects block truncates?

=20

On Dec 20, 2007 9:43 AM, <genegurevich@discover.com> wrote:

=09
	I am running oracle 10.2.0.2 and I see two sessions running
truncate
	commands being stuck. It looks like they are
	waiting on another session which is currently running a long
select. That=20
	select accesses both of the tables that
	the other two sessions are trying to truncate. I was not aware
that a
	select can block a truncate. Is that the case
	or is there something else here which I am missing?


I don't believe that the SELECT is blocking the truncate.

This is easy to test.=20

In session 1:

drop table rbg;

create table rbg
as
select *
from
dba_objects=20
/

insert /*+ append */
into rbg
select * from rbg;

commit;

insert /*+ append */
into rbg
select * from rbg;

commit;

insert /*+ append */
into rbg
select * from rbg;=20

commit;

insert /*+ append */
into rbg
select * from rbg;

commit;

In session 2:

select * from rbg;

Back to session 1:
truncate table rbg;

Back to session 2:

PUBLIC     /588bb8e2_ObjectStreamField
30790
SYNONYM             08/14/2006 14:37:42 04/13/2007 17:59:12
2006-08-14:14:37:42 VALID   N N N

ERROR:
ORA-08103: object no longer exists=20

22700 rows selected.

This is on 10.2.0.3


--=20
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist


------_=_NextPart_001_01C84338.8DCC3D9E
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Could it be that the reader is part =
of an
XA transaction? &nbsp;I think I remember a paper or presentation by one =
of the Wise
Men detailing how a reader that&#8217;s part of a distributed =
transaction can
block others simply by executing a Select.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Tony =
Aponte<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> =
oracle-l-bounce@freelists.org
[mailto:oracle-l-bounce@freelists.org] <b><span =
style=3D'font-weight:bold'>On
Behalf Of </span></b>Jared Still<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, December =
20, 2007
1:15 PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
genegurevich@discover.com<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b> oracle-l<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: Do selects =
block
truncates?</span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>On Dec 20, 2007 9:43 AM, &lt;<a =
href=3D"mailto:genegurevich@discover.com">genegurevich@discover.com</a>&g=
t;
wrote:<o:p></o:p></span></font></p>

<div>

<blockquote style=3D'border:none;border-left:solid #CCCCCC =
1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
I am running oracle <a href=3D"http://10.2.0.2" =
target=3D"_blank">10.2.0.2</a> and
I see two sessions running truncate<br>
commands being stuck. It looks like they are<br>
waiting on another session which is currently running a long select. =
That <br>
select accesses both of the tables that<br>
the other two sessions are trying to truncate. I was not aware that =
a<br>
select can block a truncate. Is that the case<br>
or is there something else here which I am =
missing?<o:p></o:p></span></font></p>

</blockquote>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
I don't believe that the SELECT is blocking the truncate.<br>
<br>
This is easy to test. <br>
<br>
In session 1:<br>
<br>
drop table rbg;<br>
<br>
create table rbg<br>
as<br>
select *<br>
from<br>
dba_objects <br>
/<br>
<br>
insert /*+ append */<br>
into rbg<br>
select * from rbg;<br>
<br>
commit;<br>
<br>
insert /*+ append */<br>
into rbg<br>
select * from rbg;<br>
<br>
commit;<br>
<br>
insert /*+ append */<br>
into rbg<br>
select * from rbg; <br>
<br>
commit;<br>
<br>
insert /*+ append */<br>
into rbg<br>
select * from rbg;<br>
<br>
commit;<br>
<br>
In session 2:<br>
<br>
select * from rbg;<br>
<br>
Back to session 1:<br>
truncate table rbg;<br>
<br>
Back to session 2:<br>
<br>
PUBLIC&nbsp;&nbsp;&nbsp;&nbsp;
/588bb8e2_ObjectStreamField&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&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;
30790<br>
SYNONYM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;
08/14/2006 14:37:42 04/13/2007 17:59:12 2006-08-14:14:37:42 =
VALID&nbsp;&nbsp; N
N N<br>
<br>
ERROR:<br>
ORA-08103: object no longer exists <br>
<br>
22700 rows selected.<br>
<br>
This is on <a href=3D"http://10.2.0.3">10.2.0.3</a><br>
<br>
<br>
-- <br>
Jared Still<br>
Certifiable Oracle DBA and Part Time Perl =
Evangelist<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C84338.8DCC3D9E--
--
http://www.freelists.org/webpage/oracle-l


