Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle read consistency

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Source: Managing Read Consistency

Oracle Version: 11g r1

An important limitation in Oracle distributed databases is read consistency. The problem arises because each system has its own SCN, which acts as an internal timestamp for the database. Oracle Database Services uses SCN to clarify the version number of the query data.

SCNs in distributed transactions synchronize in three ways: 1. at the end of each SQL statement execution;2. at the beginning of each transaction; and 3. at the end of each food. If there is a lot of communication between nodes, especially distributed update operations, this synchronous action will be very frequent. Despite these and other problems, there is virtually no way to guarantee absolute synchronization of SCNs in distributed systems: there will always be cases where one node holds an SCN that precedes another node.

Because of the SCN fetch mechanism, you can query a slightly older snapshot data, so you cannot immediately see the latest changes to the remote database. Based on read consistency, queries can yield consistent and old data. Note that the query results in data based on the old SCN, so if you perform an update transaction locally and update two tables on a remote node, the next time you access those two tables, you get the pre-update data.

One consequence of the SCN fetch mechanism is that two consecutive select statements can get different data, even without DML execution between them. For example, you execute an update statement and then commit the update to a remote database. When you query a view (based on the remote table) with a select statement, the view does not display updated columns. This update appears the next time the select statement is executed.

You can use the following criteria to determine if the SCNs of the first two machines in the query are synchronized:

Because SCN synchronizes after remote queries, there is a virtual remote query before each remote query, for example, select * from dual@remote. Because SCN synchronizes at the beginning of each remote transaction, commits, and rolls back the current transaction, before remote queries.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report