[20190530]DISABLE TABLE LOCK(10g).txt
[20190530]DISABLE TABLE LOCK(10g).txt
--//如果禁止table lock時,一些ddl操作會被禁止.但是我有點吃驚的是增加欄位不受限制.
--//連結:http://blog.itpub.net/267265/viewspace-2645161/=>[20190522]DISABLE TABLE LOCK.txt
--//昨天kerrycode給我反饋,10g和11g某個版本增加1列會遇到ORA-00069錯誤.
--//在http://www.itpub.net/thread-2117203-1-1.html提問,失望竟然沒人解答與測試.
--//今天在10g下重複測試:
1.環境:
SCOTT@test> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx 10.2.0.4.0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
SCOTT@test> create table t as select rownum id from dual ;
Table created.
SCOTT@test> alter table t disable table lock;
Table altered.
2.測試:
SCOTT@test> truncate table t;
truncate table t
*
ERROR at line 1:
ORA-00069: cannot acquire lock -- table locks disabled for T
SCOTT@test> alter table t add v1 varchar2(10);
alter table t add v1 varchar2(10)
*
ERROR at line 1:
ORA-00069: cannot acquire lock -- table locks disabled for T
--//很明顯10g在設定disable table lock的情況下,無法增加1列.在11g下重複看看.
3.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> create table t as select rownum id from dual ;
Table created.
SCOTT@book> alter table t disable table lock;
Table altered.
SCOTT@book> alter table t add v1 varchar2(10);
Table altered.
--//11.2.0.4下確實可以不是我的測試問題.並且在有事務的情況下一樣可以增加欄位.
--//開啟session 2:
SCOTT@book> insert into t values (2,'a');
1 row created.
SCOTT@book> @ viewlock
SID SERIAL# USERNAME OSUSER MACHINE MODULE LOCK_TYPE MODE_HELD MODE_REQUE LOCK_ID1 LOCK_ID2 OWNER OBJECT_TYP OBJECT_NAME BLOCK LOCKWAIT
------ ---------- ---------- ---------- ---------- ------------ --------------- ---------- ---------- ---------- ---------- ------ ---------- ----------- ----- --------
44 4845 SCOTT oracle gxqyydg4 SQL*Plus TX Transaction Exclusive None 655390 5246287 No
--//開啟session 1:
SCOTT@book> alter table t add v2 varchar2(10);
Table altered.
SCOTT@book> @ viewlock
SID SERIAL# USERNAME OSUSER MACHINE MODULE LOCK_TYPE MODE_HELD MODE_REQUE LOCK_ID1 LOCK_ID2 OWNER OBJECT_TYP OBJECT_NAME BLOCK LOCKWAIT
------ ---------- ---------- ---------- ---------- ------------ --------------- ---------- ---------- ---------- ---------- ------ ---------- ----------- ----- --------
44 4845 SCOTT oracle gxqyydg4 SQL*Plus TX Transaction Exclusive None 655390 5246287 No
--//看來這個是一個bug在11.2.0.4,我的測試沒有問題.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2646143/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190522]DISABLE TABLE LOCK.txt
- [20190524]DISABLE TABLE LOCK(12c).txt
- [20190530]sqlplus preliminary connection.txtSQL
- [20190530]oracle Audit檔案管理.txtOracle
- [20190530]ORACLE 18c - ALTER SEQUENCE RESTART.txtOracleREST
- [20190215]那個更快(10g).txt
- GaussDB資料庫SQL系列-LOCK TABLE資料庫SQL
- MySQL DDL Waiting for table metadata lock 解決MySqlAI
- MySQL新增索引偶遇waiting for table metadata lockMySql索引AI
- [20190524]Table Elimination.txt
- [20221222]How to Enable and Disable Database Options in oracle 11g.txtDatabaseOracle
- [20180412]logminer使用問題(10g).txt
- [20201113]測試CURSOR_SPACE_FOR_TIME(10g).txt
- [20190415]10g下那些latch是共享的.txt
- [20221227]a mutating table error without a trigger!.txtError
- [20190401]跟蹤dbms_lock.sleep呼叫.txt
- [20181029]避免表示式在sql語句中(10g).txtSQL
- [20181105]ORA-00600[4000] 模擬故障(10g).txt
- [20190102]關於字串的分配問題(10g).txt字串
- [20210910]table scan相關統計.txt
- [20181226]簡單探究cluster table.txt
- [20201116]測試CURSOR_SPACE_FOR_TIME(10g)(補充).txt
- [20180625]10g下查詢條件rownum = 0.txt
- [20180828]關於引數cursor_space_for_time(10g).txt
- [20220610][轉載]Is my table marked for archive.txtHive
- [20191129]ALTER TABLE MINIMIZE RECORDS_PER_BLOCK.txtBloC
- [20180627]truncate table的另類恢復.txt
- [20230327]19c sqlnet.ora disable_oob引數 ora-12637.txtSQL
- [20181030]避免表示式在sql語句中(10g)(補充).txtSQL
- local_irq_disable和disable_irq的區別
- [20191203]enq: ZA - add std audit table partition.txtENQ
- [20211111]18c index (re)build lock or pin object.txtIndexUIObject
- bypass disable_functionFunction
- disable Nouveau kernel driver
- [20180129]簡單探究cluster table(補充)4.txt
- [20181203]drop table後如何獲得表結構.txt
- [20181229]簡單探究cluster table(補充)3.txt
- [20181227]簡單探究cluster table(補充)2.txt