查看锁等信息,包括锁信息:
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;

mysql查看锁等信息SQL的更多相关文章

  1. Mysql查看锁等信息SQL语句

    查看锁等信息,包括锁信息: select "HOLD:",ph.id h_processid,trh.trx_id h_trx_id,trh.trx_started h_start ...

  2. [转]MySQL查看数据库相关信息

    原文链接:MySQL查看数据库相关信息 使用MySQL时,需要了解当前数据库的情况,例如当前的数据库大小.字符集.用户等等.下面总结了一些查看数据库相关信息的命令 1:查看显示所有数据库 mysql& ...

  3. 两种方式:mysql查看正在执行的sql语句

    mysql查看正在执行的sql语句 2015年08月21日 17:32:59 阅读数:15398   有2个方法: 1.使用processlist,但是有个弊端,就是只能查看正在执行的sql语句,对应 ...

  4. Mysql查看连接数相关信息

    MySQL查看连接数相关信息在 数据库:INFORMATION_SCHEMA 表:PROCESSLIST 表结构如下: mysql> desc PROCESSLIST; +---------+- ...

  5. 查看锁表进程SQL语句

    查看锁表进程SQL语句   set pagesize 999 set line180 col ORACLE_USERNAME for a18 col OS_USER_NAME for a18 col ...

  6. mysql查看锁查看

    关键词:mysql锁争用,mysql锁查看 --------------------- 作者:边城cn 来源:CSDN 原文:https://blog.csdn.net/miyatang/articl ...

  7. MySQL查看数据库相关信息

    使用MySQL时,需要了解当前数据库的情况,例如当前的数据库大小.字符集.用户等等.下面总结了一些查看数据库相关信息的命令   1:查看显示所有数据库 mysql> show databases ...

  8. mysql查看正在执行的sql语句

    有2个方法: 1.使用processlist,但是有个弊端,就是只能查看正在执行的sql语句,对应历史记录,查看不到.好处是不用设置,不会保存. -- use information_schema; ...

  9. mysql查看锁表与解锁

    查看锁表语句 show OPEN TABLES where In_use > 0; 找到锁表的进程 show processlist;  删除锁表进程 kill 51045123;

随机推荐

  1. ArcGIS图框生成和批量打印工具 5.2支持国家2000坐标系,支持ArcGIS10.1、ArcGIS10.2,输出图片可以是TIF和JPG

    主要两个功能有:生成图框.批量输出MXD和JPG http://files.cnblogs.com/gisoracle/ScalePrint.rar 1.        批量生成标准分幅图或行政区划, ...

  2. spring security基于数据库表进行认证

    我们从研究org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.class的源码开始 public class JdbcDaoI ...

  3. spark学习地址

    http://blog.sina.com.cn/s/blog_64d9a6ef0101ghvs.html http://blog.sina.com.cn/s/blog_49cd89710102v3b1 ...

  4. win10与子系统ubuntu之间互访文件

    在window10的store里面 搜索ubuntu,下载,可以安装 注意: 初次打开有许多软件都没安装,可以新进行 sudo apt-get update,之后在进行其他的操作 1.下载的子系统ub ...

  5. sqlserver ceiling函数用法

    ceiling函数返回大于或等于所给数字表达式的最小整数. floor函数返回小于或等于所给数字表达式的最大整数. eg: select ceiling(4.42) ---5select CEILIN ...

  6. ZooKeeper 典型应用场景-负载均衡

    负载均衡(Load Balance)是一种相当常见的计算机网络技术,用来对多个计算机(计算机集群).网络连接.CPU.硬盘驱动器或其他资源进行分配负载,以达到优化资源使用.最大化吞吐率.最小化响应时间 ...

  7. 使用sqlloader向oracle导入文本数据

    文本文件如下,注意文件名必须有后缀,文本行首也需要|分隔符:[oracle@ycr test]$ more person.txt|aaa|123|m|aaa|123|m|aaa|123|m|aaa|1 ...

  8. 字段处理rtrim去掉结尾的特殊字符和空格

    SQL> create table ycrtest2 (name varchar2(50)); Table created. SQL> insert into ycrtest2 value ...

  9. 如何读写json文件

    代码如下: import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io. ...

  10. 如何处理错误信息 Pricing procedure could not be determined

    当给一个SAP CRM Quotation文档的行项目维护一个产品时,遇到如下错误信息:Pricing procedure could not be determined 通过调试得知错误消息在fun ...