重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 27|回复: 0
打印 上一主题 下一主题

[Oracle] ORA-00069: Cannot Acquire Lock -- Table Locks Disabled

[复制链接]
跳转到指定楼层
楼主
发表于 8 小时前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现象:

Drop table  generates ora-69 error:



drop table <MYTAB> force

*

ERROR at line 1:

ORA-00069: cannot acquire lock -- table locks disabled for MYTAB

Then when we try to enable the table lock, it hangs:

alter table <MYTAB> enable table lock;

To diagnose:

Run query to get other objects owned by the same schema:

sql>

select object_name, object_id

from dba_objects

where owner='<schema owner of problem table>'

and object_type='TABLE';

Then select any 2 objects other than the problem table to include in the query below:



sql>

select x. object_name,obj#, flags

from sys.tab$,(

select object_name, object_id

from dba_objects

where owner='<ME>'

and object_name

in ('<MYTAB>','<YOURTAB>','<OURTAB>')

and object_type = 'TABLE') x

where obj# = x.object_id;



OBJECT_NAME     OBJ#    FLAGS

------------------------------ ------------ ------------

OURTAB                78348    1073742353

YOURTAB              78350    1073742353

MYTAB                   78535    1073742355

Note:

The other 2 objects selected are just used as a point of reference, so it could be any table owned by same schema.

原因:

Error is caused by inconsistent value in the flag column of the object in tab$.

The flag value of the object MYTAB in tab$ is 1073742355 instead of 1073742353 seen in the other objects.

Note:

The flag value will vary by database, thus the use of the 2 other objects.

处理方法:

To re-enable table locking, all active sessions must complete.  This is best accomplished by:

1] shutdown database gracefully
2] startup restrict
3] alter table <MYTAB> enable table lock;
4] alter system disable restricted session;

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-24 19:44 , Processed in 0.099965 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表