2. 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");修改資料庫隔離級別的方法: 設定隔離級別使用 SET TRANSACTION ISOLATION LEVEL [READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SERIALIZABLE]
隔離級別(isolation level),是指事務與事務之間的隔離程度。 顯然,事務隔離程度越高,併發性越差、效能越低;事務隔離程度越低,併發性越強、效能越高。Oracle預設的隔離級別是read committed。檢視資料庫隔離級別的方法:
1. SELECT * FROM dual FOR UPDATE;
2. 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");修改資料庫隔離級別的方法: 設定隔離級別使用 SET TRANSACTION ISOLATION LEVEL [READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SERIALIZABLE]