Oracle 的默认对象锁超时可以更改吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1398685/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:58:10  来源:igfitidea点击:

Can Oracle's default object lock timeout be changed?

oraclelocking

提问by cagcowboy

> ALTER PACKAGE blah COMPILE;
(wait about 10 minutes)
> ORA-04021: timeout occurred while waiting to lock object

I understand why I get the timeout error (the package is in use).

我明白为什么会出现超时错误(包正在使用中)。

Does anyone know if there's a way to change the default 10 minute wait interval? Can this be configured at a database / session / statement level?

有谁知道是否有办法更改默认的 10 分钟等待间隔?这可以在数据库/会话/语句级别配置吗?

Thanks

谢谢

采纳答案by Vincent Malgrat

there is a DDL_LOCK_TIMEOUTparameter since 11gR1 :

DDL_LOCK_TIMEOUT从 11gR1 开始有一个参数:

DDL_LOCK_TIMEOUTspecifies a time limit for how long DDL statements will wait in a DML lock queue. The default value of zero indicates a status of NOWAIT. The maximum value of 1,000,000 seconds will result in the DDL statement waiting forever to acquire a DML lock.

DDL_LOCK_TIMEOUT指定 DDL 语句在 DML 锁队列中等待的时间限制。默认值零表示状态为NOWAIT。最大值 1,000,000 秒将导致 DDL 语句永远等待获取 DML 锁。

I'm not sure you can change the default timeout in the previous releases.

我不确定您是否可以更改以前版本中的默认超时。