About database nature of read consistency,

Hi All,
can anybody explain me what is consistent read, logical read and physical read?

Hi,
A consistent read is when a database must read a cloned block that has been recently changed. This is a core concept of Oracle database that allows data to be changed and read at the same time. A User must be able to read all relevant data to the transaction at the time it started.
For instance, let's assume I start doing a full table scan of a large table by noon. Another user comes by at 12:05 and deletes a few records of the same table. Oracle preserves the before-image of the table by the time I started doing my full table scan so that I don't get some results from noon and some results from 12:05. This is called read consistency. A Consistent read is that a session does to achieve this through the UNDO tablespaces.
Logical read is a read from memory. For example a row that has been recently read and is now stored in the database buffer cache. The second time a query wants that row, oracle will detect it's in the cache and won't fetch from the disk again. This is a logical read, also called a consistent get.
A Physical read is when the database will fetch the required blocks from the disk.

Similar Messages

  • About read consistency

    Dear Guys
    i m getting confused in read consistent image of oracle
    please clear a little
    suppose if i fired a query that takes 20 min to retrieve data...now its in processing when a B user update some of the rows and fired commit in between..suppose after 5 mins when A fired query
    Now please tel A after 20 mins would get the updated rows or same image as it was when started query means old rows data

    user11221081 wrote:
    Dear Guys
    i m getting confused in read consistent image of oracle
    please clear a little
    suppose if i fired a query that takes 20 min to retrieve data...now its in processing when a B user update some of the rows and fired commit in between..suppose after 5 mins when A fired query
    Now please tel A after 20 mins would get the updated rows or same image as it was when started query means old rows dataYou should tell us that what should happen? Always remember that the databases work following the ACID properties where C stands for consistency. This means, that you must not ever see what is called a dirty read . It means that there must not be the case that you should see two different set of results in a single fetch. If a situation happens like this, the database must ensure that your data must be able to show that image of the data which is consistent to the time from when your query started. This is why you need the read consistent image and your database must follow some way of transaction isloation level which in Oracle database is read committed . This means that never ever a reader won't worry about writer and writer won't worry about reader (the word is wait but I changed it to worry to make the point clear).
    If this doesn't make the things clear to you, read the link that Srini has given to you already.
    HTH
    Aman....

  • Change DB_NAME failed with NID-00133: Database should have only consistent.

    I have created two testing database for active data guard with Oracle 11g on Linux. I created standby DB by using rman backup from primary database. Now I want to change DB_NAME of standby database. I used DBNEWID utility
    %> nid TARGET=SYS DBNAME=newname SETNAME=YES
    It generated the error like this
    NID-00133: Database should have only consistent datafiles
    Change of database name failed during validation - database is intact
    Many datafiles even system datafiles are not consistent. I shutdown DB and startup mount again and tried again. It all failed with the same errors. I searched solutions on Oracle Support web and other twchincal web and couldn't find
    answers. Please help me to get the solutions. Thanks.

    Thank each of you so much for your inputs.
    Yes, based on oracle document, primary and standby shouid use the same name. But they can have different db_unique_name or instance_name. I created standby by using Grid Control. It automatically assign the same DB_NAME.
    I modified db_unique_name. However, our PeopleSoft admin needs to connect to two databases to do testing. PeopleSoft version only support the different DB Name and DB Name cannot be over 8 characters. This is why I tried to
    change DB_NAME to meet PeopleSoft Admin's requirement. I think, in the real world for data guard configuration, primary and standby should have the same db_name.

  • Read consistency in query with pl/sql functions

    Not sure if this is a bug or feature, but a query containing a user-defined pl/sql function does not include tables accessed within the pl/sql function in the read consistent view of data, eg
    select myfunc from tableA
    myfunc is a stored function that queries tableB and returns a value
    If a change to tableB is committed in another session during fetch phase of select statement, then fetched rows reflect the changes. The database does not recognise tables accessed in the plsql function as being part of the query.
    This happens in 7.3.4 and 8.1.6. Don't have 9i so can't tell.
    Anyone know if this is a bug or feature?
    Aside: you can also drop the plsql function whilst the fetch is running. It will kill the fetch. No DDL lock taken on the plsql function whilst select is running! Seems wrong.

    I don't know Forms but I know SQL*Plus and Oracle database. Normally PL/SQL running on the database can only access files on the host where the database instance is running even if you start PL/SQL with a SQL*Plus connection from another host.
    PL/SQL runs only the database instance not on the client side even if you start the PL/SQL code from a remote connection with SQL*Plus.

  • SQL 2012 AlwaysOn cluster IP not moving after failover, causing database to be read-only

    SQL Server Cluster Name: SQLDAG01
    SQL Server Cluster IP: 10.0.0.50
    Cluster Listener IP: 10.0.0.60
    Node 1 Name: SQL01
    Node 1 IP: 10.0.0.51
    Node 2 Name: SQL02
    Node 2 IP: 10.0.0.52
    Everything is fine when SQL01 is the primary. When failing over to SQL02, everything looks fine in the dashboard but for some reason the cluster IP, 10.0.0.50, is stuck on node 1. The databases are configured to provide secondary read access. When executing
    a query on SQLDAG01, I get an error that the database is in read-only mode. Connectivity tests verify that SQLDAG01, 10.0.0.50, connects to SQL01 even though SQL02 is now the primary.
    I've been Googling this for the better part of the day with no luck. Any suggestions? Is there a Powershell command force the cluster IP to move to the active node or something? Also I'm performing the failover as recommended, from Management Studio connected
    to the secondary node.

    This was the answer, it had been setup to use the cluster name instead of the application name. Whoever installed Sharepoint connected it to SBTSQLDAG01 instead of SHAREPOINT01. Once we changed Sharepoint to connect to SHAREPOINT01, the failover worked as
    expected. We did have a secondary issue with the ARP cache and had to install the hotfix from http://support.microsoft.com/kb/2582281 to resolve it. One of the Sharepoint app servers was failing to
    ping the SQL node after a failover, the ARP entry was stuck pointing to the previous node. This article actually helped a lot resolving that: http://blog.serverfault.com/2011/05/11/windows-2008-and-broken-arp/
    One thing I did notice is that the SQL failover wizard does not move cluster groups "Available Storage" and "Cluster Group", I had to move those through the command line after using the wizard. I'm going to provide the client with a Powershell script that
    moves all cluster groups when they need to do a manual failover. This also happens to be why the Sharepoint issue started, "Cluster Group" is what responds to the cluster name SBTSQLDAG01. Moving that group over to the node that has the active SQL cluster
    group also made it work properly, but using the application name is the correct method.
    Thanks everyone for all your help. Although the nitpicking about terminology really didn't help, that was a pointless argument and we really could have done without it. Yeah I know 2008 called is "Failover Cluster Manager" and MSCS is the "2003 term" but
    really, they're basically the same thing and we don't really need to derail the conversation because of it. Also, If you look at the screenshot below you can clearly see "AlwaysOn High Availability" in SQL Management Studio. That's what it's called in SQL,
    that's where you do all the work. Trying to tell me it's "not a feature" is wrong, pointless, and asinine, and doesn't get us anywhere.
    Sorry it took so long to get back, I was off the project for a couple weeks while they were resolving some SAN issues that caused the failover to happen in the first place.

  • Where to learn about database tuning from?

    Hello,
    I need to learn more about database tuning - practical aspect. Are there any sites/services that could help me? I can't use production environment of course, I need to prepare my own ones (Oracle DBs on linux and windows too) and workload too. How to simulate workload from many users?
    Thanks in advance for help
    Aliq

    How do you learn to paint? You can read every book on the subject, attend lectures by famous artists on paints and brushes and styles and what not..
    None of this will turn you into an artist that can paint. Theory only goes that far.
    And this is as true in performance tuning as in painting. You need to run into that brick wall called experience over and over again - and each time learn hard lessons that no theory can ever teach.
    If performance tuning was that easy, we would have had fully automated tuning software in operating systems and database systems that could detect and fix all our performance woes on the fly.
    Does not work like that.
    Also, performance tuning is many times seen as an "after the fact" thing. Design the system. Code the software. Implement it. Then tune it.
    Wrong. Also does not work like that.
    Performance tuning begins at the very first workshop when brainstorming the basic design of the system. If performance and scalability are not part of that process, they cannot easily (if at all) be made to be part of the final system as a tuning exercise.
    If I need to pass a single fundamental "uber-alles" principle for performance tuning - when dealing with it after the fact (as many of us do), then it is:
    Identify The Problem
    Do not confuse symptoms as the actual problem.
    PS. Performance tuning is also many time (IMO) a situation where you have lost. Why? Because of if the code was designed and coded correctly, then there would not have been a performance issue. If the Oracle architecture was understood correctly, there would not be a problem. Which makes the advice by the other 2 posters so important. Understand Oracle. Understand how to design and code in Oracle. If done well, what is there left to performance tune?

  • Problem due to read consistency...

    Hi,
    Pls hv look on given scenario...
    Two transactions updating the same row
    Session 2's update waits until Session 1's commit release the row lock.
    In Session 1
    SQL>select color from cust where id=500;
    color
    red
    SQL>update cust set color='blue' where id=500;
    In Session 2
    SQL> select color from cust where id=500;
    color
    red
    SQL>update cust set color=green where id=500;
    (Waiting...)
    In Session 1
    SQL> COMMIT;
    In Session 2
    SQL>select color from cust where id=500;
    color
    green
    SQL>COMMIT;
    Due to read consistency second user never knows that someone had changed color to 'blue'.
    We can use flags etc to trap this.
    Is there any way in Oracle to stop this logical inconsistency ....?

    > I can use select ...for update for the purpose. but there r few reasons for
    not using this...
    We use JAVA with Oracle.
    Not a valid reason. If the language is incapable, or the application server is incapable, then change it.
    You cannot blame the RDBMS for not working when the problem is solely with the language/app server. And you will have the exact same problem with any RDBMS as the lock-row-before-updating is a fundamental RDBMS rule for protecting data integrity and guarding against lost updates.
    > If Java program crashes then the lock not get automatically released from
    Oracle.
    I'm not sure that this is a valid statement. I deal with Java apps from JBoss against my databases and I've yet to see this problem.
    But for the moment, let us assume you are correct - what happens when the Java app crashes after the UPDATE and before the COMMIT? The exact same problem. So how do you solve this? You cannot simply just ignore those locks and pretend that the locks created by the SELECT FOR UPDATE is a problem.
    Also, why are your Java programs crashing so much? If it does not work, fix it or replace it.
    > Any idea ?
    You can use optimistic locking. This is not preferable. It results in a serious performance issue (and data concurrency issues) with any kind of higher volume OLTP system.
    But when dealing with stateless clients (typical 3 tier architecture using web browser clients), there is no choice but to use optimistic locking. E.g.
    SELECT c.* INTO :existing_row FROM cust WHERE id = :0
    .. processing..
    UPDATE cust
    SET colour = :new_colour
    WHERE custid = :0
    AND cust_col1 = :existing_row.cust.col1
    AND cust_col2 = :existing_row.cust.col2
    AND cust_coln = :existing_row.cust.coln
    In other words, the UPDATE checks that the row has not been changed since it was last "seen". If the UPDATE returns a 0 row result, it means that the row has changed. In which case the app needs to handle that exception somehow.

  • Few basic questions about database administration

    Hello,
    I have a few basic questions about database administration.
    1. I switched one of my oracle instances to archivelog mode. I just cannot locate the archive log files on my windows system. The %ora_home%/ora92/database/archive directory is desperately empty...
    2.What is the tools01.dbf datafile used for?
    3.What is the undotbso1.dbf datafile used for?
    Thanks in advance,
    Julien.

    1. The archive log location needs to be specified in your init.ora file. By default, Oracle will place the archive files in either ORACLE_HOME/dbs or ORACLE_HOME/database.
    2. The tools01.dbf file belongs to the tools tablespace which should be set as the default tablespace for system. It primary purpose is to hold Oracle Forms and Reports database objects, however, it should also be used for holding other non sys database objects such as the perfstat (statspack) or other third party database schemas e.g. quests sqllab.
    3. undotbs01.dbf file belongs to the undo tablespace.

  • Dbsql version of the database how to read noSQL

    dbsql version of the database how to read noSQL?
    Is there a way to achieve?

    Your question is extremely difficult to understand. However, because you are asking about dbsql, I think you are in the wrong forum. This is the BDB JE forum, and BDB JE does not support sql. The BDB (C-based) product does support sql. Please post your questions to the BDB forum:
    Berkeley DB
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need for Read Consistency

    Dear Members :
    [1] In later versions of Oracle (10g/11) the error "ora-01555 snapshot-too-old" almost never occurs - is this true ?
    [2] Why in the first place need for read-consistency, if that's misleading ?
    This is just to convince myself - although I never encountered.
    Thanks in advance.
    Atanu

    user11184124 wrote:
    Dear Members :
    [1] In later versions of Oracle (10g/11) the error "ora-01555 snapshot-too-old" almost never occurs - is this true ? The important word here is almost which comes along with many things. If you have a sufficiently sized Undo tablespace and a properly configured Undo Retention period, its possible that you won't hit the 1555 error any time soon but that doesn't mean its gone for good. Its very much there and can definitely hit you.
    [2] Why in the first place need for read-consistency, if that's misleading ?
    This is just to convince myself - although I never encountered.
    I have given a reply for this in the below thread which also asked the same question. Have a read,
    about read consistency
    HTH
    Aman....

  • Industrial engineer study about Database System

    Hello, i'm Industrial engineering student now. I want to ask all of you. Is valuabel if i learn about Database System in my major?

    oppusunggu wrote:
    Oh i'm sorry about that. Now i'm studying Industrial Engineering in scholar Program. I live in Indonesia. As employee, Industrial engineer can improve efficiency in many aspect in the enterprise. So, is there any chance that i can improve efficiency Database System? Coz, in semester 5 i had study about Information System.On one contracting job, my boss had been an industrial engineer, so then he was a project lead. We became good friends, even though he introduced me to my wife :-) (wife's stepfather and he had worked together at an aerospace company previously). Certainly his background helped in project implementation.
    As to improving database system efficiency, it is yes and no. No, you aren't likely to get into internals and compete against people with CS doctorates, but yes because applications do need an eye towards efficiency, and applications are where the money goes. As with so many things, it's the combination of technical ability and another kind of analytical ability that make you valuable to business. Business analysis goes through cycles and fads, what was once called business process reengineering will be called something else and have its gurus (just this morning I got an email about how BPM can improve my business). Just don't fall for any pie-in-the-sky internet entrepreneurs who promise to have the next SAP, go mainstream first, with at least what we in the US call a Masters degree.

  • When I click on a yahoo news story, about 30 seconds into reading it, the page changes to one that says the page I requested can't be found, and it has a list of search results.

    I just upgraded to firefox 4 this morning. My homepage is yahoo.com. Sometimes when I click a news story, about 30 seconds into reading it, the page changes to a search result page with the heading that the page I requested can't be found. If I click the back button, it goes back to the page I was on. It doesn't happen on every one, and I haven't seen a pattern to which sites it happens on. It also happened when I was trying to make a payment on ebay.

    To revert to Google as your preferred search engine, please do the following.<br><br>
    * In the location bar, type '''about:config''' and hit Enter.<br><br>
    * In the filter at the top, type: '''keyword.URL'''<br><br>
    * Double click it and remove whatever's in there (probably Yahoo) and replace it with http://www.google.com/search?q=<br>
    The URL to add in "keyword.URL" becomes a link in this post, so right click it and choose "Copy Link Location" to copy it to the Windows clipboard. Then hit CTRL+V to paste it. Saves you having to type the whole thing.
    '''To reset your home page, do the following'''.<br><br>
    * Go to the site you want to set as your homepage.<br><br>
    * Click the orange Firefox button and go to '''Options '''| '''Options '''| '''General'''.<br><br>
    * Make sure it says "''Show My Homepage''" in the first dropdown menu.<br><br>
    * Click the button called "'''Use Current Pages'''" to set the homepage to the one you have on the screen.<br>

  • Can we run application services when physical stand by database is in read

    can we run application services when physical stand by database is in read only mode
    i Want to up the EBS application services and check login when phyiscal standby database is in read only mode.
    Is it possible? for checking dataguard database application as well.

    but i just want to know that can i start EBS application services and nagivate the application.Without distrubing my primary database and application.You should not do as the moment you open the standby database it becomes invalid.
    Thanks,
    Hussein

  • Db Export when database is in read only mode

    Hi All,
    I have to perform a full database export when database is in read only mode. My db version is 9i.
    Kindly let me know whether that export file is valid enough to do full import in new database and make database oprational.
    Thanks.

    rajaryan wrote:
    Hi All,
    I have to perform a full database export when database is in read only mode. My db version is 9i.
    Kindly let me know whether that export file is valid enough to do full import in new database and make database oprational.
    Thanks.Check the log file, if you haven't got any error, then it's valid
    BTW - Why you've taken full export of the database? Why not using RMAN?
    See the following video tutorial:
    http://kamranagayev.wordpress.com/2010/03/29/rman-video-tutorial-series-performing-disaster-recovery-with-rman/

  • I updated Itunes today to the latest version. Windows 7 64bit. None of my drivers work and get an error when itunes starts, about registry setting for reading and writing dvds and cds missing. Anyone else have the same issue. I downloaded itunes again, re

    I updated Itunes today to the latest version. Windows 7 64bit. None of my drivers work and get an error when itunes starts, about registry setting for reading and writing dvds and cds missing. Anyone else have the same issue. I downloaded itunes again, reinstalled still have same issue.

    I'd start with the following document, with one modification. At step 12 after typing GEARAspiWDM press the Enter/Return key once prior to clicking OK. (Pressing Return adds a carriage return in the field and is important.)
    iTunes for Windows: "Registry settings" warning when opening iTunes

Maybe you are looking for

  • Adobe Reader XI and SharePoint Online

    We are mapping SharePoint sites as drives for our users, which utilizes WebDav.  When users are opening documents that are digital signature enabled, it is prompting them to check in/check out or open, as expected.  However, despite which option is c

  • BPM :: n To 1 Collected Payload Pattern issue

    Hi I am working on following scenario --> Web Page --> HTTP Adapter --> XI with BPM ( Using n To 1 Payload Pattern ) --> RFC Adapter --> SAP R/3 --> XI With BPM --> File Adapter --> Legacy System with Response from RFC Now everything is configured &

  • Missing background colour in image rollover in IE

    Just noticed I have a missing image background colour on a rollover link - it's fine in firefox and safari, but awol in IE(6). link here The CSS looks like : a:link img { padding: 5px; border: 1px solid #999999; a:visited img { padding: 5px; border:

  • Mountain Lion Setup doesn't start after reboot

    I have a curious problem: I wanted to upgrade my MBP to ML, but it doesn't work. I start the installation script, accept the licence agreement and choose the SSD as the installation target. The installation script prepares the installation (Install O

  • Synchronization npt working for large table

    we are trying to synchronize Sql on premise  table to Sql Azure but each time it gets failed for different reasons.this time we encountered this exception. Sync failed with the exception "GetStatus failed with exception: SqlException Error Code: -214