gpt4 book ai didi

database - 如何检查隔离级别?

转载 作者:行者123 更新时间:2023-12-05 05:28:25 25 4
gpt4 key购买 nike

如何检查在我的 Oracle 数据库中设置了什么 IL。我该如何改变它?非常感谢。

最佳答案

设置隔离级别

For Read only Transaction isolation level

隔离级别可以设置为对于交易级别:

SET TRANSACTION ISOLATION LEVEL READONLY;

对于 session 级别:

ALTER SESSION SET ISOLATION_LEVEL READONLY;

For Serializable Transaction isolation level

交易级别:

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

session 级别:

ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE;

For Read Committed Transaction isolation level

交易级别:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

session 级别:

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;

关于database - 如何检查隔离级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10711204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com