473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to read UNCOMMITED data in Oracle?


Hi,

I have these 2 problem? Is there a way in Oracle to read UNCOMMITED
data. i.e. in Oracle the normal behaviour is that a user's updates to a
table are visible to other users ONLY when the user commits. But in
Informix there is this thing called ISOLATION LEVELS. For example by
setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data,
i.e. the last uncommited updated value of a field by some other user. Is
this possible in Oracle by setting some parameter, say in the INIT file?

Also WHAT IS THE DEFAULT LOCKING BEHAVIOUR IN ORACLE? I mean if I want
Oracle to automatically issue a READ LOCK (so that nobody can update a
record, but view only) everytime a table (or row) is read, and for this
to be made effective for the ENTIER DATABASE, how can we achive this? Is
there a parameter to change in some INIT file???

Thanks & Regards,

Channa.
--
Posted via http://dbforums.com
Jul 19 '05 #1
4 40192
Hi,

extracted from "Oracle 9i Concepts":

(1) UNCOMMITTED DATA
###
Oracle provides these transaction isolation levels.

"Read committed"
This is the default transaction isolation level. Each query executed
by a transaction sees only data that was committed before the query
(not the transaction) began. An Oracle query never reads dirty
(uncommitted) data.

Because Oracle does not prevent other transactions from modifying the
data read by a query, that data can be changed by other transactions
between two executions of the query. Thus, a transaction that executes
a given query twice can experience both nonrepeatable read and
phantoms.

"Serializable"
Serializable transactions see only those changes that were committed
at the time the transaction began, plus those changes made by the
transaction itself through INSERT, UPDATE, and DELETE statements.
Serializable transactions do not experience nonrepeatable reads or
phantoms.

"Read-only"
Read-only transactions see only those changes that were committed at
the time the transaction began and do not allow INSERT, UPDATE, and
DELETE statements.
###

Thus, you can't read uncommitted data.

(2) DEFAULT LOCKING
###
Default Locking for INSERT, UPDATE, DELETE, and SELECT ... FOR UPDATE

The transaction that contains a DML statement acquires exclusive row
locks on the rows modified by the statement. Other transactions cannot
update or delete the locked rows until the locking transaction either
commits or rolls back.

The transaction that contains a DML statement does not need to acquire
row locks on any rows selected by a subquery or an implicit query,
such as a query in a WHERE clause. A subquery or implicit query in a
DML statement is guaranteed to be consistent as of the start of the
query and does not see the effects of the DML statement it is part of.

A query in a transaction can see the changes made by previous DML
statements in the same transaction, but cannot see the changes of
other transactions begun after its own transaction.

In addition to the necessary exclusive row locks, a transaction that
contains a DML statement acquires at least a row exclusive table lock
on the table that contains the affected rows. If the containing
transaction already holds a share, share row exclusive, or exclusive
table lock for that table, the row exclusive table lock is not
acquired. If the containing transaction already holds a row share
table lock, Oracle automatically converts this lock to a row exclusive
table lock.

Oracle's automatic locking can be overridden at the transaction level
or the session level.

----

At the transaction level, transactions that include the following SQL
statements override Oracle's default locking:

The SET TRANSACTION ISOLATION LEVEL statement
The LOCK TABLE statement (which locks either a table or, when used
with views, the underlying base tables)
The SELECT ... FOR UPDATE statement
Locks acquired by these statements are released after the transaction
commits or rolls back.

At the session level, a session can set the required transaction
isolation level with the ALTER SESSION statement.
###

Bye

francis70 <me*********@dbforums.com> wrote in message news:<34****************@dbforums.com>...
Hi,

I have these 2 problem? Is there a way in Oracle to read UNCOMMITED
data. i.e. in Oracle the normal behaviour is that a user's updates to a
table are visible to other users ONLY when the user commits. But in
Informix there is this thing called ISOLATION LEVELS. For example by
setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data,
i.e. the last uncommited updated value of a field by some other user. Is
this possible in Oracle by setting some parameter, say in the INIT file?

Also WHAT IS THE DEFAULT LOCKING BEHAVIOUR IN ORACLE? I mean if I want
Oracle to automatically issue a READ LOCK (so that nobody can update a
record, but view only) everytime a table (or row) is read, and for this
to be made effective for the ENTIER DATABASE, how can we achive this? Is
there a parameter to change in some INIT file???

Thanks & Regards,

Channa.

Jul 19 '05 #2

"francis70" <me*********@dbforums.com> wrote in message
news:34****************@dbforums.com...

Hi,

I have these 2 problem? Is there a way in Oracle to read UNCOMMITED
data. i.e. in Oracle the normal behaviour is that a user's updates to a
table are visible to other users ONLY when the user commits. But in
Informix there is this thing called ISOLATION LEVELS. For example by
setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data,
i.e. the last uncommited updated value of a field by some other user. Is
this possible in Oracle by setting some parameter, say in the INIT file?

That really isn't a feature; it is a behavior to get around a poor locking
model.
Also WHAT IS THE DEFAULT LOCKING BEHAVIOUR IN ORACLE? I mean if I want
Oracle to automatically issue a READ LOCK (so that nobody can update a
record, but view only) everytime a table (or row) is read, and for this
to be made effective for the ENTIER DATABASE, how can we achive this? Is
there a parameter to change in some INIT file???

So you are going to serialize database usage a lot, ouch! Why do you want
to do this? If most data is read and not changed then this is going to
cause you a lot of headaches.
Jim
Thanks & Regards,

Channa.
--
Posted via http://dbforums.com

Jul 19 '05 #3
"Jim Kennedy" <ke****************************@attbi.net> wrote in message news:<rjbjb.562792$Oz4.523703@rwcrnsc54>...
"francis70" <me*********@dbforums.com> wrote in message
news:34****************@dbforums.com...
I have these 2 problem? Is there a way in Oracle to read UNCOMMITED
data. [snip]


That really isn't a feature; it is a behavior to get around a poor locking
model.


An alternative view would be that this has long been part of the ANSI
SQL standard, virtually all other major DBMS vendors support it, yet
with Oracle we still can't do it.
DG
Jul 19 '05 #4
"Database Guy" <db******@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
"Jim Kennedy" <ke****************************@attbi.net> wrote in message

news:<rjbjb.562792$Oz4.523703@rwcrnsc54>...
"francis70" <me*********@dbforums.com> wrote in message
news:34****************@dbforums.com...
I have these 2 problem? Is there a way in Oracle to read UNCOMMITED
data. [snip]


That really isn't a feature; it is a behavior to get around a poor locking model.


An alternative view would be that this has long been part of the ANSI
SQL standard, virtually all other major DBMS vendors support it, yet
with Oracle we still can't do it.
DG


It is an ANSI standard because a lot of databases have a brain dead
concurrency model. Being a standard makes it a standard, not a feature. So
if most people jumped off the Brooklyn Bridge you would also?

Why do you want to do it in Oracle? So your application isn't ACID?
Jim
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Håkan Persson | last post by:
Hi. I am trying to set up a simple HTTP-server but I have problems reading data that is beeing POSTed. class httpServer(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): input =...
1
by: Julia | last post by:
Hi, I have basic questions regarding ASP.NET site I am going to use Microsoft application configuration block and I wonder 1.does caching read only data in the application can hurt ...
3
by: phwashington | last post by:
I am new to C++ and have a data file I want to read, which was stored in binary. I have looked at the data with a hex editor and it appears to be correct. Whenever I try to read it though as an...
3
by: Udhay | last post by:
Sir, I want to read the data of an audio file in c++ (Windows). What is the API which helps to read the data of an audio file. I want to read BitRate,Audio Sample Size,Audio Sample rate and...
7
by: Igor | last post by:
1. In this topic...
6
by: trl10 | last post by:
Hi Everyone, I'm still trying to learn C++ and this is my final project. We have to read sales data from a file into an array, process data in a partially filled array via functions, pass an array...
10
by: CDFTim | last post by:
O.K. that was a long Title... Can you help / show me how I would......... I am going to long windedly try to paint this picture. Backround: I have an html page that has a marquee function in it to...
4
by: francis70 | last post by:
Hi, I have these 2 problem? Is there a way in Oracle to read UNCOMMITED data. i.e. in Oracle the normal behaviour is that a user's updates to a table are visible to other users ONLY when the...
0
by: prakashgrp | last post by:
Hi, first i am new to sql server: server version is sql server 2000 we used to get lot of blocking session and we thought of use isolation level read uncommited instead of read...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.