2012-05-22 45 views
1

如何檢查我的oracle數據庫中設置了哪些IL。我該如何改變它?提前謝謝了。如何查看isoloation級別?

+1

試試這個:HTTP://計算器.com/questions/3663343/how-can-you-see-what-transaction-isolation-level-an-arbitrary-oracle-session- –

+1

或這樣:http://www.ehow.com/how_1222 7289_check電流隔離級別,oracle.html –

回答

0

要設置隔離級別

對於只讀事務隔離級別

隔離級別可設爲 對於事務級別:

SET TRANSACTION ISOLATION LEVEL READONLY; 

對於會話級別:

ALTER SESSION SET ISOLATION_LEVEL READONLY; 

對於串行事務隔離級別

事務級別:

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; 

會話級別:

ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE; 

對於讀提交的事務隔離級別

事務級:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED; 

會話級:

ALTER SESSION SET ISOLATION_LEVEL READ COMMITTED; 

要查找隔離級別:

當事務正在進行中:

SELECT s.sid, s.serial#, 
    CASE BITAND(t.flag, POWER(2, 28)) 
     WHEN 0 THEN 'READ COMMITTED' 
     ELSE 'SERIALIZABLE' 
    END AS isolation_level 
FROM v$transaction t 
JOIN v$session s ON t.addr = s.taddr AND s.sid = sys_context('USERENV', 'SID'); 

當交易是不是在過程

declare 
    trans_id Varchar2(100); 
begin 
    trans_id := dbms_transaction.local_transaction_id(TRUE); 
end; 
相關問題