mysql查看锁等信息SQL
2024-10-19 11:59:23
查看锁等信息,包括锁信息:
select "HOLD:",ph.id h_processid,trh.trx_id h_trx_id,trh.trx_started h_started,trh.trx_state h_state,lsh.lock_table h_table,lsh.lock_index h_index,lsh.lock_mode as h_lock_mode,lsh.lock_type h_lock_type,ph.user h_user,ph.host h_host,ph.command p_command,ph.info p_info,"WAIT:",pw.id w_processid,trw.trx_id w_trx_id,trw.trx_started w_started,trw.trx_state w_state,lsw.lock_table w_table,lsw.lock_index w_index,lsw.lock_mode w_lock_mode,lsw.lock_type w_lock_type,pw.user w_user,pw.host w_host,pw.command w_command,pw.info w_info from information_schema.INNODB_LOCK_WAITS lw inner join information_schema.INNODB_TRX trh on trh.trx_id=lw.blocking_trx_id inner join information_schema.PROCESSLIST ph on trh.trx_mysql_thread_id=ph.id left join information_schema.INNODB_LOCKS lsh on lsh.lock_trx_id=trh.trx_id inner join information_schema.INNODB_TRX trw on trw.trx_id=lw.requesting_trx_id inner join information_schema.PROCESSLIST pw on trw.trx_mysql_thread_id=pw.id left join information_schema.INNODB_LOCKS lsw on lsw.lock_trx_id=trw.trx_id ;
查找当前进程的执行状态:
SELECT a.trx_id, trx_state, trx_started, b.id AS thread_id, b.info, b.user, b.host, b.db, b.command, b.state FROM information_schema.`INNODB_TRX` a, information_schema.`PROCESSLIST` b WHERE a.trx_mysql_thread_id = b.id ORDER BY a.trx_started;
最新文章
- 笔记本双系统XP与Ubuntu,重装XP后如何恢复grup引导,另附操作系统启动过程
- windows系统IIS环境下如何部署MVC项目
- python ABC
- 天气预报API(四):全国城市代码列表(“新编码”)
- The Parallel Challenge Ballgame[HDU1101]
- Atitit.现实生活中最好使用的排序方法-----ati排序法总结
- HDU 1698 Just a Hook(线段树区间替换)
- jquery加载页面的方法(页面加载完成就执行)
- 同样的一句SQL语句在pl/sql 代码块中count 没有数据,但是直接用SQl 执行却可以count 得到结果
- bzoj 1056 [HAOI2008]排名系统(1862 [Zjoi2006]GameZ游戏排名系统)
- 第一章 工欲善其事 必先利其器—Android SDK工具(3)
- UIPasteboard 粘贴板
- 使用php完成常见的";文件上传";功能
- ignite服务中的bean注入为空
- C#--深入理解类型
- [Swift]LeetCode316. 去除重复字母 | Remove Duplicate Letters
- Javascript 3.2
- Alpha(2/10)
- Spring Boot 1.5.10 发布:修复重要安全漏洞!!!
- mysql 取整数或小数或精确位数