ttbulkcp锁表问题解决办法
时间:2010-07-29 来源:tristan0720
我们使用ttbulkcp -i加载数据时会产生table级锁,降低了并发性。特别是生产系统上,很可能会造成其他事物锁等待超时。解决办法是加上 -notblLock参数不产生表级锁,只产生行锁,以此来提高并发性能。
但要记得加-xp参数,-xp默认是1000条提交一次,-xp参数也不要设置太大,否则为了存放锁,临时空间可能不够用。
下面是验证的过程:
-xp 0 0表示整个加载完成后再提交 ,其他事物请求锁会超时
$ ttXactAdmin -tbl tmp_test -connstr DSN=gejie
2010-07-28 18:03:02.624
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table (表级锁) 736856 15402 0x60000000000379f0 7.7795551 W
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table (表级锁) 736856 15402 0x60000000000379f0 7.7795551 W
-xp 1000 (1000条提交时,有表锁,但其他事物不会请求锁超时)
$ ttXactAdmin -tbl tmp_test -connstr DSN=gejie
2010-07-28 18:04:45.964
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table(表级锁) 736856 15539 0x60000000000379f0 7.7795750 W
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table(表级锁) 736856 15539 0x60000000000379f0 7.7795750 W
-xp 1000 -notblLock
$ ttXactAdmin -tbl tmp_test -connstr DSN=gejie
2010-07-28 18:01:32.386
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table 736856 15358 0x60000000000379f0 7.7792131 IXn Row (行锁) 0x0000000069bcc158 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc148 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc138 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc128 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc118 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc108 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc0f8 15358 0x60000000000379f0 7.7792131 Xn ………………………………
TimesTen Release 7.0.5.2.0 Outstanding locks on table GEJIE.TMP_TEST Resource ResourceID PID Context TransactId Mode Table 736856 15358 0x60000000000379f0 7.7792131 IXn Row (行锁) 0x0000000069bcc158 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc148 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc138 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc128 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc118 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc108 15358 0x60000000000379f0 7.7792131 Xn Row 0x0000000069bcc0f8 15358 0x60000000000379f0 7.7792131 Xn ………………………………
相关阅读 更多 +