How to query the isolation level in oracle: 1. Use the "declare trans_id... begin trans_id :=...;end;" statement to put the current session in a transaction; 2. Use "SELECT s. sid, s.serial#,CASE...WHEN 0 THEN '....'ELSE '...' END AS..." statement to query the isolation level.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
How to view the Oracle transaction isolation level
Oracle is more troublesome, execute the following statement
1): Let The current session is in a transaction
declare trans_id Varchar2(100); begin trans_id := dbms_transaction.local_transaction_id( TRUE ); end;
2): Query the isolation level
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');
Notes:
1): If v$transaction does not exist, first consider whether the user permissions are sufficient;
2): If an empty error is reported when executing the second sentence, it is because the transaction has not been created yet (so execute the second sentence first) One sentence is executing the second sentence);
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to query oracle isolation level. For more information, please follow other related articles on the PHP Chinese website!