473,890 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 40301
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.

"Serializab le"
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*********@db forums.com> wrote in message news:<34******* *********@dbfor ums.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*********@db forums.com> wrote in message
news:34******** ********@dbforu ms.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.562 792$Oz4.523703@ rwcrnsc54>...
"francis70" <me*********@db forums.com> wrote in message
news:34******** ********@dbforu ms.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******@hotma il.com> wrote in message
news:7f******** *************** ***@posting.goo gle.com...
"Jim Kennedy" <ke************ *************** *@attbi.net> wrote in message

news:<rjbjb.562 792$Oz4.523703@ rwcrnsc54>...
"francis70" <me*********@db forums.com> wrote in message
news:34******** ********@dbforu ms.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
13378
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 = self.rfile.read() The self.rfile.read() will hang on the
1
1353
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 performance when multiple request arrived? (multiple pages read the cached data) 2.Instead of caching the data inside the Application dictionary can I use a
3
3246
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 integer it returns the 8bit integer values. I can convert these to hex and they match up with what I am seeing in the data file. I guess what I need to do somehow buffer these inputs and then read them as floats, but I am not sure how to do...
3
4336
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 Channel udhay
7
13261
by: Igor | last post by:
1. In this topic http://groups.google.com/group/comp.databases.ms-sqlserver/browse_thread/thread/b4a07b516f4a2fcd/cb21516252b65e7c?lnk=gst&q=SET+TRANSACTION+ISOLATION+LEVEL+READ+UNCOMMITTED&rnum=10#cb21516252b65e7c, someone wrote: "I've implemented SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED at the beginning of a number of stored procedures and, then SET TRANSACTION ISOLATION LEVEL READ COMMITTED at the end to minimize the disruption...
6
2947
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 as a paameter to a function. I have most f the cde wrote, except that I can't get my readData function to work. I can't figure out hwto get it to read from the file and into an array. Here is the partial code #include <iostream> #include <fstream> ...
10
2975
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 display a small photo and other information to scroll in a box on the web page. The marquee's info is a table with data that I now insert manually. I would like to be able to insert the data into it from a mysql database. The marquee works by...
4
557
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 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
0
1606
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 commited(default behaviour) could any body advise me to set this parameter in database level
0
9976
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9814
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10801
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10903
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10449
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9616
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8006
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4659
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.