這篇文章主要介紹“oracle不同事務(wù)隔離級別與v$transaction flag列分析”,在日常操作中,相信很多人在oracle不同事務(wù)隔離級別與v$transaction flag列分析問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”oracle不同事務(wù)隔離級別與v$transaction flag列分析”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
武漢ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!oracle可以查詢v$transaction實(shí)時(shí)了解數(shù)據(jù)庫事務(wù)的執(zhí)行情況,v$transaction有個(gè)列flag,引起我的注意,見下:
oracle提供2種事務(wù)隔離級別,read committed及serializable。前者是默認(rèn)值。如果采用不同的事務(wù)隔離級別發(fā)起數(shù)據(jù)庫事務(wù),
v$transaction之flag有何區(qū)別呢。
事務(wù)隔離級別 read committed,各種dml產(chǎn)生的事務(wù) flag全是3587 SQL> set transaction isolation level read committed name 'tran76'; Transaction set. SQL> insert into t_test select 3,3 from dual; 1 row created. SQL> / NAME ADDR FLAG ---------------------------------------- ---------------- ---------- tran76 00000000843521C0 3587 SQL> delete from t_test where a=1; 1 row deleted. SQL> / NAME ADDR FLAG ---------------------------------------- ---------------- ---------- tran76 00000000843521C0 3587 SQL> update t_test set a=11; 2 rows updated. SQL> / NAME ADDR FLAG ---------------------------------------- ---------------- ---------- tran76 00000000843521C0 3587
事務(wù)隔離級別serializable各種dml產(chǎn)生的事務(wù)的flag全是268439043 SQL> set transaction isolation level serializable name 'tran76'; Transaction set. SQL> insert into t_test select 3,3 from dual; 1 row created. SQL> select addr,flag from v$transaction; ADDR FLAG ---------------- ---------- 00000000840B04D8 268439043 SQL> update t_test set a=11 where a=1; 1 row updated. SQL> / NAME ADDR FLAG ---------------------------------------- ---------------- ---------- tran76 00000000843521C0 268439043 SQL> delete from t_test; 2 rows deleted. SQL> / NAME ADDR FLAG ---------------------------------------- ---------------- ---------- tran76 00000000843521C0 268439043 SQL> select addr,flag from v$transaction; ADDR FLAG ---------------- ---------- 00000000840B04D8 268439043
lock table不會產(chǎn)生事務(wù),當(dāng)然也不會產(chǎn)生事務(wù)的flag SQL> lock table t_test in row share mode; Table(s) Locked. SQL> lock table t_test in row exclusive mode; Table(s) Locked. SQL> lock table t_test in share row exclusive mode; Table(s) Locked. SQL> lock table t_test in exclusive mode; Table(s) Locked. SQL> lock table t_test in share mode; Table(s) Locked.
思考
---可以對flag作文章,就可以知道事務(wù)是哪種事務(wù)隔離級別 select name,addr,flag,decode(flag,'268439043','serializable','3587','read committed') from v$transaction where addr=(select taddr from v$session where sid=76) NAME ADDR FLAG DECODE(FLAG,'2 ---------------------------------------- ---------------- ---------- -------------- tran76 00000000843521C0 268439043 serializable
到此,關(guān)于“oracle不同事務(wù)隔離級別與v$transaction flag列分析”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!