ORA-00069:无法获取锁定 -- 表锁定已禁
现象:
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;
诊断:
运行 query 以获取同一 schema 拥有的其他对象:
sql>
select object_name, object_id
from dba_objects
where owner='< schema owner of problem table>'
and object_type='TABLE';
然后选择除问题表之外的任意 2 个对象以包含在下面的查询中:
sql>
select x. object_name,obj#, flags
from sys.tab$,(
select object_name, 从 dba_objects
object_id
where owner='<ME>'
and object_name
in ('<MYTAB>','<YOURTAB>','<OURTAB>')
和 object_type = 'TABLE') x
其中 obj# = x.object_id;
OBJECT_NAME OBJ# 标志
------------------------------ ------------ ------------
OURTAB 78348 1073742353
YOURTAB 78350 1073742353
MYTAB 78535 1073742355
注意:
选定的其他 2 个对象仅用作参考点,因此它可以是同一架构拥有的任何表。
原因:
tab$ 中对象的 flag 列值不一致导致错误。
tab$ 中对象 MYTAB 的标志值为 1073742355,而不是在其他对象中看到的 1073742353。
注意:
标志值会因数据库而异,因此会使用其他 2 个对象。
处理方法:
要重新启用表锁定,必须完成所有活动会话。最好通过以下方式实现:
1] 正常关闭数据库
2] 启动限制
3] 更改表 <MYTAB> 启用表锁定;
4] 更改系统禁用受限会话;