如何查看任意 oracle 会话使用的事务隔离级别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3663343/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can you see what transaction isolation level an arbitrary oracle session is using
提问by kon5ad
I am trying to find out what isolation level a particular session (not my own) has on an oracle server. Is there a v$.. view to get this?
我试图找出特定会话(不是我自己的)在 oracle 服务器上的隔离级别。是否有 av$.. 视图来获得这个?
回答by Danilo Piazzalunga
You can test bit 28 in the flag
column in v$transaction
[1].
您可以flag
在v$transaction
[1]的列中测试第 28 位。
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, v$session s
WHERE t.addr = s.taddr
AND s.sid = :sid
AND s.serial# = :serial;
Just remember that v$transaction
only lists active transactions[2]; for example, you need to issue an insert/update/delete/merge, or use "for update"[3].
请记住,v$transaction
只列出活动交易[2];例如,您需要发出插入/更新/删除/合并,或使用 "for update" [3]。