enq: TX - index contention

看到论坛上有人讨论,研究了下

enq: TX - index contention
     Lock held on an index during a split to prevent other operations on it
--------------------------------------------------------------------------
DROP TABLE test;

CREATE TABLE test(ID CHAR(1000));

CREATE INDEX idx_test ON test(ID);

[oracle10@WESTZQ ~]$ cat run.sh
sqlplus ctais2/oracle <BEGIN
  FOR i IN 1..100000 LOOP
    INSERT INTO test VALUES(to_char(i));
    COMMIT;
  END LOOP;
END;
/
EOF

nohup ./run.sh &
nohup ./run.sh &
nohup ./run.sh &
nohup ./run.sh &
nohup ./run.sh &
nohup ./run.sh &
nohup ./run.sh &

SQL> select event from v$session_wait;

EVENT
----------------------------------------------------------------
SQL*Net message from client
free buffer waits
enq: TX - index contention
SQL*Net message to client
enq: TX - index contention
SQL*Net message from client
enq: TX - index contention
free buffer waits
free buffer waits
free buffer waits
enq: TX - index contention
free buffer waits
SQL*Net message from client
SQL*Net message from client
wait for unread message on broadcast channel
SQL*Net message from client
SQL*Net message from client
SQL*Net message from client
SQL*Net message from client
SQL*Net message from client

EVENT
----------------------------------------------------------------
Streams AQ: qmn slave idle wait
SQL*Net message from client
latch: library cache
SQL*Net message from client
Streams AQ: waiting for messages in the queue
Streams AQ: qmn coordinator idle wait
jobq slave wait
Log archive I/O
rdbms ipc message
SQL*Net message from client
free buffer waits
rdbms ipc message
rdbms ipc message
rdbms ipc message
rdbms ipc message
smon timer
rdbms ipc message
rdbms ipc message
latch: shared pool
rdbms ipc message
rdbms ipc message

EVENT
----------------------------------------------------------------
pmon timer

处理的方法就是反转索引就可以了

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8242091/viewspace-609761/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8242091/viewspace-609761/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值