Oracle/Mysq数据库隔离级别设置
程序员文章站
2022-06-10 08:58:17
...
1. Oracle 数据库的事物隔离级别设置
设置一个事物的隔离级别:
SET TRANSACTION ISOLATION LEVEL [READ COMMITED | SERIALIZABLE | READ ONLY];
设置一个会话的隔离级别:
ALTER SESSION SET ISOLATION_LEVEL [READ COMMITTED| SERIALIZABLE];
2. Mysql InnoDB引擎的事物隔离级别:
获取隔离级别:
-- 获取全局隔离级别 SELECT @@global.tx_isolation; --获取会话隔离级别 SELECT @@tx_isolation;
设置隔离级别:
--全局隔离级别设置 SET GLOBAL TRANSACTION ISOLATION LEVEL [ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE]; --会话隔离级别设置 SET SESSION TRANSACTION ISOLATION LEVEL [ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE];