发表于:2006.06.21 14:20
分类: 数据库
出处:http://rchsh.itpub.net/post/8010/123945
---------------------------------------------------------------
alter table t1 disable table lock;
可以禁止表锁定,也就是说可以防止session 对表进行DDL ,即禁止session 获得表lock
alter table t1 enable table lock;
session 可以在表上面获得锁
测试:
我先前在winxp + 9.2.0.1上测试没有任何问题
代码:
SQL> create table test(no int);
表已创建。
SQL> alter table test disable table lock;
表已更改。
SQL> insert into test select rownum from tabs;
已创建13行。
SQL> commit;
提交完成。
SQL> rename test to test_mid ; rename test to test_mid * ERROR 位于第 1 行: ORA-00069: 无法获得锁定 -- TEST禁用了表锁定
SQL> alter table test enable table lock;
表已更改。
SQL> rename test to test_mid;
表已重命名。
SQL>
生产库就不能随便测试了,我在测试库aix 5.2+ Oracle 9.2.0.6上测试的时候,缺遇到了这样的问题
代码:[oracle@res2] /oracle> sqlplus tomsrep
SQL*Plus: Release 9.2.0.6.0 - Production on Wed Jun 21 13:57:11 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter password:
Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.6.0 - Production
SQL> create table test_lock(no int);
Table created.
SQL> alter table test_lock disable table lock;
Table altered.
SQL> insert into test_lock select rownum from tabs;
7 rows created.
SQL> commit;
Commit complete.
SQL> rename test_lock to test_lock_mid; rename test_lock to test_lock_mid * ERROR at line 1: ORA-00069: cannot acquire lock -- table locks disabled for TEST_LOCK
SQL> alter table test_lock enable table lock; alter table test_lock enable table lock * ERROR at line 1: ORA-00603: ORACLE server session terminated by fatal error
SQL>
在alert中也报告了ora-00600的错误信息如下:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [kcbgcur_9], [4219439], [1], [4294967250], [524288], [], [], [] ORA-00054: resource busy and acquire with






