詳解oracle事務(wù)隔離級(jí)別
oracle事務(wù)隔離級(jí)別是學(xué)習(xí)oracle數(shù)據(jù)庫過程中不能不提到的,下面就為您詳細(xì)介紹oracle事務(wù)隔離級(jí)別方面的知識(shí),供您參考。
隔離級(jí)別(isolation level)
oracle事務(wù)隔離級(jí)別定義了事務(wù)與事務(wù)之間的隔離程度。
oracle事務(wù)隔離級(jí)別與并發(fā)性是互為矛盾的:隔離程度越高,數(shù)據(jù)庫的并發(fā)性越差;隔離程度越低,數(shù)據(jù)庫的并發(fā)性越好。
ANSI/ISO SQL92標(biāo)準(zhǔn)定義了一些數(shù)據(jù)庫操作的隔離級(jí)別:
未提交讀(read uncommitted)
提交讀(read committed)
重復(fù)讀(repeatable read)
序列化(serializable)
通過一些現(xiàn)象,可以反映出隔離級(jí)別的效果。這些現(xiàn)象有:
更新丟失(lost update):當(dāng)系統(tǒng)允許兩個(gè)事務(wù)同時(shí)更新同一數(shù)據(jù)是,發(fā)生更新丟失。
臟讀(dirty read):當(dāng)一個(gè)事務(wù)讀取另一個(gè)事務(wù)尚未提交的修改時(shí),產(chǎn)生臟讀。
非重復(fù)讀(nonrepeatable read):同一查詢?cè)谕皇聞?wù)中多次進(jìn)行,由于其他提交事務(wù)所做的修改或刪除,每次返回不同的結(jié)果集,此時(shí)發(fā)生非重復(fù)讀。(A transaction rereads data it has previously read and finds that another committed transaction has modified or deleted the data. )
幻像(phantom read):同一查詢?cè)谕皇聞?wù)中多次進(jìn)行,由于其他提交事務(wù)所做的插入操作,每次返回不同的結(jié)果集,此時(shí)發(fā)生幻像讀。(A transaction reexecutes a query returning a set of rows that satisfies a search condition and finds that another committed transaction has inserted additional rows that satisfy the condition. )
【編輯推薦】
刪除oracle服務(wù)項(xiàng)中不用的服務(wù)