innodb 找锁表进程疑惑
表给锁了,如何查?我想查出锁表的进程,并杀掉.以下是show innodb status结果.
*************************** 1. row ***************************
Status:
=====================================
061221 11:50:35 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 23 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 1193306, signal count 1161788
Mutex spin waits 980340920, rounds 649630554, OS waits 179716
RW-shared spins 578518, OS waits 70897; RW-excl spins 629282, OS waits 8872
------------------------
LATEST DETECTED DEADLOCK
------------------------
061216 11:59:51
*** (1) TRANSACTION:
TRANSACTION 0 2715080, ACTIVE 51 sec, process no 32251, OS thread id 4352944 starting index read
mysql tables in use 1, locked 1
LOCK WAIT 48 lock struct(s), heap size 5504
MySQL thread id 15218, query id 11308524 10.0.10.88 manager Sending data
CALL ProcABC(406, 40)
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 6101 n bits 168 index `PRIMARY` of table `DBname/tableA` trx id 0 2715080 lock mode S lo
cks rec but not gap waiting
Record lock, heap no 3 PHYSICAL RECORD: n_fields 28; compact format; info bits 0
0: len 4; hex 000fa492; asc ;; 1: len 6; hex 0000001ff851; asc Q;; 2: len 7; hex 8000001c6e2afa; asc n* ;; 3: len 4; h
ex 00000ca2; asc ;; 4: len 6; hex d5c5d3c0b7e5; asc ;; 5: len 8; hex 3832323134383739; asc 82214879;; 6: len 30; hex b9fab
ccac3b3d2d7d6d0d0c4b4f3cfc3a3a8ceefd2b5bcafcdc5a3a94132; asc A2;...(truncated); 7: len 6; hex 8000000007
00; asc ;; 8: len 8; hex 8000123ed7efd014; asc > ;; 9: len 9; hex 31313a3239d7f3d3d2; asc 11:29 ;; 10: len 4; hex 000
00196; asc ;; 11: len 4; hex 80000001; asc ;; 12: len 4; hex 000fa492; asc ;; 13: len 4; hex 00000e9c; asc ;; 14: le
n 4; hex 00000029; asc );; 15: len 4; hex 80000002; asc ;; 16: len 0; hex ; asc ;; 17: len 4; hex 80000000; asc ;; 18: le
n 8; hex 8000123ed7effb5a; asc > Z;; 19: len 1; hex 81; asc ;; 20: len 0; hex ; asc ;; 21: SQL NULL; 22: SQL NULL; 23: len 13;
hex c9cfbaa3e2c6e2bdc3e6b5ea31; asc 1;; 24: SQL NULL; 25: SQL NULL; 26: SQL NULL; 27: len 4; hex 80000000; asc ;;
*** (2) TRANSACTION:
TRANSACTION 0 2715261, ACTIVE 14 sec, process no 32251, OS thread id 7261104 fetching rows, thread declared inside InnoDB 467
mysql tables in use 2, locked 2
73 lock struct(s), heap size 5504
MySQL thread id 15227, query id 11308513 10.0.10.88 spp preparing
UPDATE tableA SET STATUS = -1 WHERE UserID IN (SELECT AID FROM tableU WHERE Account LIKE "test_%@test.com")
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 0 page no 6101 n bits 168 index `PRIMARY` of table `DBname/table_o` trx id 0 2715261 lock_mode X
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;
Record lock, heap no 3 PHYSICAL RECORD: n_fields 28; compact format; info bits 0
0: len 4; hex 000fa492; asc ;; 1: len 6; hex 0000001ff851; asc Q;; 2: len 7; hex 8000001c6e2afa; asc n* ;; 3: len 4; h
ex 00000ca2; asc ;; 4: len 6; hex d5c5d3c0b7e5; asc ;; 5: len 8; hex 3832323134383739; asc 82214879;; 6: len 30; hex b9fab
ccac3b3d2d7d6d0d0c4b4f3cfc3a3a8ceefd2b5bcafcdc5a3a94132; asc A2;...(truncated); 7: len 6; hex 8000000007
00; asc ;; 8: len 8; hex 8000123ed7efd014; asc > ;; 9: len 9; hex 31313a3239d7f3d3d2; asc 11:29 ;; 10: len 4; hex 000
00196; asc ;; 11: len 4; hex 80000001; asc ;; 12: len 4; hex 000fa492; asc ;; 13: len 4; hex 00000e9c; asc ;; 14: le
n 4; hex 00000029; asc );; 15: len 4; hex 80000002; asc ;; 16: len 0; hex ; asc ;; 17: len 4; hex 80000000; asc ;; 18: le
n 8; hex 8000123ed7effb5a; asc > Z;; 19: len 1; hex 81; asc ;; 20: len 0; hex ; asc ;; 21: SQL NULL; 22: SQL NULL; 23: len 13;
hex c9cfbaa3e2c6e2bdc3e6b5ea31; asc 1;; 24: SQL NULL; 25: SQL NULL; 26: SQL NULL; 27: len 4; hex 80000000; asc ;;
Record lock, heap no 4 PHYSICAL RECORD: n_fields 28; compact format; info bits 0
0: len 4; hex 000fa493; asc ;; 1: len 6; hex 0000001ff851; asc Q;; 2: len 7; hex 8000001c6e2b07; asc n+ ;; 3: len 4; h
ex 00000ca1; asc ;; 4: len 6; hex d7afd0a1bde3; asc ;; 5: len 17; hex 303735352d32353138313038352d383031; asc 0755-2518108
5-801;; 6: len 14; hex bccec0efd6d0d0c432323034cad2; asc 2204 ;; 7: len 6; hex 800000000a00; asc ;; 8: len 8; hex 800
0123ed7efd39a; asc > ;; 9: len 9; hex 31313a3430d7f3d3d2; asc 11:40 ;; 10: len 4; hex 00000186; asc ;; 11: len 4; hex 8
0000001; asc ;; 12: len 4; hex 000fa493; asc ;; 13: len 4; hex 00000e9b; asc ;; 14: len 4; hex 00000024; asc $;; 15:
len 4; hex 7fffffff; asc ;; 16: len 6; hex b4f8b7a2c6b1; asc ;; 17: len 4; hex 80000000; asc ;; 18: len 8; hex 8000123
ed7f004b0; asc > ;; 19: len 1; hex 81; asc ;; 20: len 20; hex b2cbbcdbb8dfc1bdd4aaa1a3d3c3bba7c8a1cffb; asc
;; 21: SQL NULL; 22: SQL NULL; 23: len 12; hex d4c2c1c1cde5b2e8b2cdccfc; asc ;; 24: SQL NULL; 25: SQL NULL; 26: SQL N
ULL; 27: len 4; hex 80000000; asc ;;
......<剩下的都是Record lock, heap no 4 PHYSICAL RECORD:这样的信息,非常多.行锁,估计是记录集记录多.>
show processlist结果;
| 11764 | app | XX.XX.XX.112:3837 | DBname | Sleep | 4 | NULL | NULL |
| 11765 | app | XX.XX.XX.112:3838 | DBname | Sleep | 0 | NULL | NULL |
| 11766 | app | XX.XX.XX.112:3839 | DBname | Sleep | 79 | NULL | NULL |
| 17211 | spp | 10.0.10.23:1164 | DBname | Sleep | 4013 | NULL | NULL |
| 17241 | wpp | 10.0.10.85:42571 | DBname | Sleep | 1 | NULL | NULL |
| 17245 | cpp | 10.0.10.15:2870 | DBname | Sleep | 4197 | NULL | NULL |
| 17252 | wpp | 10.0.10.91:45660 | DBname | Sleep | 419 | NULL | NULL |
| 17296 | wpp | 10.0.10.91:46189 | DBname | Sleep | 885 | NULL | NULL |
| 17344 | mpp | 10.0.10.88:4200 | DBname | Sleep | 30 | NULL | NULL |
| 17346 | mpp | 10.0.10.88:4204 | DBname | Sleep | 165 | NULL | NULL |
| 17347 | mpp | 10.0.10.88:4206 | DBname | Sleep | 3 | NULL | NULL |
| 17348 | mpp | 10.0.10.88:4208 | DBname | Sleep | 17 | NULL | NULL |
| 17349 | mpp | 10.0.10.88:4210 | DBname | Sleep | 0 | NULL | NULL |
| 17352 | mpp | 10.0.10.88:4214 | DBname | Sleep | 3 | NULL | NULL |
| 17354 | wpp | 10.0.10.85:45488 | DBname | Sleep | 212 | NULL | NULL |
| 17359 | mpp | 10.0.10.88:4217 | DBname_2 | Sleep | 3387 | NULL | NULL |
| 17360 | mpp | 10.0.10.88:4218 | DBname_2 | Sleep | 3387 | NULL | NULL |
| 17369 | wpp | 10.0.10.87:33782 | DBname | Sleep | 77 | NULL | NULL |
| 17370 | mpp | 10.0.10.88:4224 | DBname | Sleep | 2 | NULL | NULL |
| 17375 | mpp | 10.0.10.88:4230 | DBname | Sleep | 325 | NULL | NULL |
| 17390 | mpp | 10.0.10.88:4241 | DBname | Sleep | 38 | NULL | NULL |
| 17391 | mpp | 10.0.10.88:4243 | DBname | Sleep | 25 | NULL | NULL |
| 17392 | wpp | 10.0.10.85:47382 | DBname | Sleep | 1 | NULL | NULL |
| 17397 | mpp | 10.0.10.88:4244 | DBname | Sleep | 6 | NULL | NULL |
| 17399 | admin | localhost | DBname | Sleep | 317 | NULL | NULL |
| 17403 | wpp | 10.0.10.87:35876 | DBname | Sleep | 0 | NULL | NULL |
| 17405 | wpp | 10.0.10.87:35878 | DBname | Sleep | 24 | NULL | NULL |
| 17408 | mpp | 10.0.10.19:1898 | DBname | Sleep | 734 | NULL | NULL |
| 17409 | wpp | 10.0.10.91:50938 | DBname | Sleep | 213 | NULL | NULL |
| 17410 | wpp | 10.0.10.91:51173 | DBname | Sleep | 3 | NULL | NULL |
| 17411 | admin | 10.0.10.89:59983 | DBname | Sleep | 138 | NULL | NULL |
| 17412 | wpp | 10.0.10.87:38168 | DBname | Sleep | 77 | NULL | NULL |
| 17413 | wpp | 10.0.10.87:38169 | DBname | Sleep | 77 | NULL | NULL |
| 17414 | admin | localhost | NULL | Query | 0 | NULL | show full processlist |
yejr
周四, 2006/12/21 - 13:15
Permalink
应该是这个查询导致
应该是这个查询导致锁超时的:
MySQL 中文网: http://imysql.cn
Google MySQL 中文用户群:http://groups.google.com/group/imysql
给你的祝福,要让你招架不住!