当前位置:网站首页>MySQL blocking monitoring script
MySQL blocking monitoring script
2022-07-28 02:33:00 【Oriental phantom】
#!/bin/sh
while :
do
mysql -uroot -p'12wsxCDE#' -e "select now();show full processlist\g;select b.trx_mysql_thread_id AS ' Blocked thread ',b.trx_query AS ' Blocked SQL',c.trx_mysql_thread_id AS ' Blocking threads ',(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(c.trx_started)) AS ' Blocking time '
from information_schema.INNODB_LOCK_WAITS a
join information_schema.INNODB_TRX b on a.requesting_trx_id =b.trx_id
join information_schema.INNODB_TRX c on a.blocking_trx_id=c.trx_id
where (UNIX_TIMESTAMP()-UNIX_TIMESTAMP(c.trx_started))>60;"
ps aux --sort=-%cpu | head -20
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
sleep 15;
done
边栏推荐
- MySQL高可用和主从同步
- 组原必备知识点
- [Yugong series] use of tabby integrated terminal in July 2022
- MySQL high availability and master-slave synchronization
- [Yugong series] July 2022 go teaching course 019 - for circular structure
- MYSQL解决死锁之路 - 常见 SQL 语句的加锁分析
- 了解加密行业的“下一个大趋势”——Ventures DAO
- This operation may not be worth money, but it is worth learning | [batch cutting of pictures]
- cn+dt
- Lock mechanism in MySQL database InnoDB storage engine (glory Collection Edition)
猜你喜欢

小程序毕设作品之微信校园浴室预约小程序毕业设计成品(1)开发概要

探究flex-basis
![This operation may not be worth money, but it is worth learning | [batch cutting of pictures]](/img/e8/a34e471b0089f8085b140c74b5c01f.jpg)
This operation may not be worth money, but it is worth learning | [batch cutting of pictures]

【ROS进阶篇】第十讲 基于Gazebo的URDF集成仿真流程及实例

Wechat campus bathroom reservation applet graduation design finished product (3) background function

Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance

Deep Residual Learning for Image Recognition浅读与实现

QGIS mapping: vector data mapping process and export

软考 --- 数据库(2)关系模型

Three core issues of concurrent programming (glory Collection Edition)
随机推荐
组原必备知识点
Aike AI frontier promotion (7.14)
作业7.27 IO进程
Promise from introduction to mastery (Chapter 1 Introduction and basic use of promise)
借助Elephant Swap打造的ePLATO,背后的高溢价解析
Which database is the fastest to query data only?
0动态规划中等 LeetCode873. 最长的斐波那契子序列的长度
关于Sqli-labs单引号不报错的问题
[Star Project] small hat aircraft War (V)
Four common post data submission methods
【HCIP】路由策略、策略路由
Flask1.1.4 werkzeug1.0.1 source code analysis: Blueprint
LeetCode 热题 HOT 100 -> 2.两数相加
探究flex-basis
了解加密行业的“下一个大趋势”——Ventures DAO
Chapter 3 business function development (batch export of market activities, Apache POI)
[hcip] routing strategy, strategic routing
软件产品第三方测试费用为什么没有统一的报价?
What is eplato cast by Plato farm on elephant swap?
Understand the "next big trend" in the encryption industry - ventures Dao