昨天晚上洗澡时新想到一个可以有效测试index rebuild online的方式, 也就是同时使用10046与10704 的trace event再配合lock阻塞的机制来测试index rebuild online的过程.
测试的过程如下.
–1. 构造一个500w条记录的表. 并创建需要rebuild online的索引.
–表的数量设置到这么大,,主要是为了给后续的操作留出手工运行的时间.
create table james_t as
select rownum id,dbms_random.string(‘l’,20) user_name
from dual
connect by level
http://forums.oracle.com/forums/thread.jspa?messageID=4269655#4269655
In principle (for 10g):
Your rebuild tries to take an exclusive (or possibly share) lock on the table and gets stuck waiting for current transactions on the table to complete.
All current transactions on the table complete, all new ones are stuck behind the rebuild lock
The rebuild gets its lock, prepares the MV log, starts the rebuild [...]
最近评论