首页 > 解决方案 > Rolling back Oracle Transction if not committed within certain minutes

问题描述

We've had problems on production where some developers have not committed the transactions which resulted in locks. Is there a way for me rollback a transaction if it complete and not committed within certain number of minutes?

标签: oraclelockingrollback

解决方案


您可以创建新的或更改当前数据库配置文件以限制用户空闲时间:

Create Profile Idle_Time_Out limit idle_time 30;

然后将用户分配给该配置文件:

Alter User some_user Profile Idle_Time_Out;

上述配置文件将 some_user 限制为 30 分钟不活动,此时他们的会话将断开连接,并且任何未提交的事务都将回滚。


推荐阅读