mysql InnoDB Monitors 4种监控

监控monitors

  • The standard InnoDB Monitor 标准监控
  • The InnoDB Lock Monitor 锁监控,用于排查事务间锁问题
  • The InnoDB Tablespace Monitor 表空间监控
  • The InnoDB Table Monitor 表监控

触发条件

  • To enable the standard InnoDB Monitor for periodic output, create a table named innodb_monitor .
  • The InnoDB Lock Monitor prints additional lock information as part of the standard InnoDB Monitor output. To enable the InnoDB Lock Monitor, create a table named innodb_lock_monitor.
  • The InnoDB Tablespace Monitor prints a list of file segments in the shared tablespace and validates the tablespace allocation data structures. To enable this Monitor for periodic output, create a table named innodb_tablespace_monitor .
  • The InnoDB Table Monitor prints the contents of the InnoDB internal data dictionary. To enable this Monitor for periodic output, create a table named innodb_table_monitor .

To enable an InnoDB Monitor for periodic output, use a CREATE TABLE statement to create the table associated with the Monitor. For example, to enable the standard InnoDB Monitor, create the innodb_monitor table:

CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;

To stop the Monitor, drop the table:

DROP TABLE innodb_monitor;

打开锁监控后,可以使用show engine innodb status来触发打印监控输出;

举例

三个事务,分别是t1,t2,t3

Transaction 1 Transaction 2 Transaction
set autocommit=0; set autocommit=0; set autocommit=0;
set session tx_isolation=’repeatable-read’; set session tx_isolation=’repeatable-read’; set session tx_isolation=’repeatable-read’;
select * from tran_t1 where a = 59 for update
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值