Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!newsfeed1!bredband!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews1.google.com!not-for-mail
From: jbradshaw777@yahoo.com (John)
Newsgroups: comp.databases.oracle.server
Subject: Re: ORA-01555; does update/select sequence matter?
Date: 11 Nov 2003 21:38:33 -0800
Organization: http://groups.google.com
Lines: 42
Message-ID: <f2f59d82.0311112138.2963b04e@posting.google.com>
References: <f2f59d82.0311111519.5c73b65@posting.google.com> <3fb1704b$0$20185$afc38c87@news.optusnet.com.au>
NNTP-Posting-Host: 64.172.46.85
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1068615513 3999 127.0.0.1 (12 Nov 2003 05:38:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 12 Nov 2003 05:38:33 +0000 (UTC)
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:247498

"Howard J. Rogers" <hjr@dizwell.com> wrote in message news:<3fb1704b$0$20185

> > 2. It does not matter whether update or select comes first, ORA-01555
> > can potentially happen, rihgt?
> 
> Not sure what the question means. 1555s generally happen because an
> update/insert/delete over-writes the rollback that a select elsewhere is
> going to need to generate it's read-consistent image of the data. If the DML
> happened first (and was committed), and then the select was fired off,
> there'd be no problem (because the select would be able to read the modified
> blocks directly. So the situation only really arises because one select
> starts, and is still running when DML happens. But it's a bit difficult to
> draw tidy timelines like that when you have multi-user simultaneous access.
> 
> Regards
> HJR

Thanks, Howard. A bit sloppy on my side. I was thinking about the case
of 2 sessions concurrent access to the same table. One session doing
DML, the other doing query - on the same table. Would you agree that
it does not matter which session starts first, ORA-01555 can happen to
the session running the query?

If DML session starts first, query reads from rollback(for the data
blocks in question). If DML session ends before query session does,
rollback can be overwritten and ORA-01555 results.

If query session starts first, DML session follows and modifies the
data that was visited by query session, the data will be copied to
rollback. If DML session ends before query session, the data on
rollback can be overwritten. If the query session revisit the data
blocks again, you get ORA-01555.

I think it is all a matter of the timing between:
first select from a db block, DML on that block, 2nd visit to that
block(if 2nd visit is indeed necessary).

I used to think I know this stuff inside out. Now I think I need to
take a 2nd look and ask for confirmation just to be sure...


John
