Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Effective Oracle by Design - p259 - 260 - confused, is there a mistake?

Effective Oracle by Design - p259 - 260 - confused, is there a mistake?

2005-11-02       - By t_adolph@(protected)

Reply:     1     2     3     4  

Hi All,

A question for those of you who have read Effective Oracle by Design by Thomas
Kyte:

Chpt 5, page 259 - 260: Tom is explaining that undo is read for read for read
consistency....

I understood something like this:

Session A:
-- ---- ---- ----
tony@(protected)> select * from t1 where a=1;

        A          B
-- ---- -- -- ---- --
        1          1

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         0  db block gets
         4  consistent gets
         0  physical reads
         0  redo size
       451  bytes sent via SQL*Net to client
       503  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed

tony@(protected)> begin
 2  for i in 1 .. 1000
 3  loop
 4  update t1 set b=b where a=1;
 5  end loop;
 6  end;
 7  /

PL/SQL procedure successfully completed.

No commit in my example.

Session B
-- ---- ---- ----

tony@(protected)> select * from t1 where a=1;

        A          B
-- ---- -- -- ---- --
        1          1

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         0  db block gets
      1005  consistent gets  <---- interesting bit here - 1000 undo's got (as
expected)
         0  physical reads
        52  redo size
       451  bytes sent via SQL*Net to client
       503  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed

Now this makes sense to me as in session A there was no commit.  But in Tom's
pl/sql there's a commit every update.  Shouldn't that throw away the undo
meaning that session B wouldn't be interested in it?  I tried with a commit
every update and confirmed what I'd expected, only 4 gets.  What have I missed
folks?

Tony
PS I thinks its irrelevant here, but Ora 9.2.0.7 on Win2k

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1522" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>A question for&nbsp;those of you who have read
Effective Oracle by Design by Thomas Kyte:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Chpt 5, page 259 - 260: Tom is explaining that
undo
is read&nbsp;for read for read consistency....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I understood something like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Session A:</FONT></DIV>
<DIV><FONT face=Arial size=2>-- ---- ---- ----</FONT></DIV>
<DIV><A href="mailto:tony@(protected)"><FONT face=Arial size=2>tony@(protected)</FONT></A><FONT
face=Arial size=2>&gt; select * from t1 where a=1;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B<BR>-- ---- --
-- ---- --<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial
size=2>Statistics<BR>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp; recursive
calls<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; db
block
gets<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;
consistent gets<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp; physical reads<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;
0&nbsp; redo size<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 451&nbsp; bytes
sent via SQL*Net to client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
503&nbsp; bytes received via SQL*Net from
client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp; SQL
*Net
roundtrips to/from
client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; sorts
(memory)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;
sorts
(disk)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp; rows
processed</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><A href="mailto:tony@(protected)"><FONT
size=2>tony@(protected)</FONT></A><FONT size=2>&gt; begin<BR>&nbsp; 2&nbsp; for i in 1
. 1000<BR>&nbsp; 3&nbsp; loop<BR>&nbsp; 4&nbsp; update t1 set b=b where
a=1;<BR>&nbsp; 5&nbsp; end loop;<BR>&nbsp; 6&nbsp; end;<BR>&nbsp; 7&nbsp;
/</FONT></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>PL/SQL procedure successfully
completed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>No commit in my example.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Session B</FONT></DIV>
<DIV><FONT face=Arial size=2>-- ---- ---- ----</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><A href="mailto:tony@(protected)"><FONT face=Arial size=2>tony@(protected)</FONT></A><FONT
face=Arial size=2>&gt; select * from t1 where a=1;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B<BR>-- ---- --
-- ---- --<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</FONT></DIV>
<DIV><FONT face=Arial><BR><FONT
size=2>Statistics<BR>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp; recursive
calls<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; db
block
gets<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1005&nbsp; consistent gets&nbsp;
&lt;---- interesting bit here - 1000 undo's&nbsp;got&nbsp;(as
expected)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;
physical reads<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 52&nbsp;
redo
size<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 451&nbsp; bytes sent via
SQL*Net to client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 503&nbsp; bytes
received via SQL*Net from
client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp; SQL
*Net
roundtrips to/from
client<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; sorts
(memory)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;
sorts
(disk)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp; rows
processed</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Now this makes sense to me as in session A there
was no commit.&nbsp; But in Tom's pl/sql there's a commit every update.&nbsp;
Shouldn't that throw away the undo meaning that session B wouldn't be
interested
in it?&nbsp; I tried with a commit every update and confirmed what I'd expected
,
only 4 gets.&nbsp; What have I missed folks?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Tony</FONT></DIV>
<DIV><FONT face=Arial size=2>PS I thinks its irrelevant here, but Ora 9.2.0.7
on
Win2k</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>