select * from  INFORMATION_SCHEMA.INNODB_TRX\G 

The INNODB_TRX table contains information about every transaction (excluding read-only transactions) currently executing inside InnoDB, 

including whether the transaction is waiting for a lock, when the transaction started, and the SQL statement the transaction is executing, if any.

INNODB_TRX 表包含 信息关于每个事务(排除只读事务)当前执行的在InnoDB中,

包含事务是否是等待一个锁, 当事务启动时

1. 开始事务,运行一个短查询:

开启一个事务 运行一个查询:
mysql> select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 2 |
+-----------------+
1 row in set (0.00 sec) mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> select * from t200;
ERROR 1046 (3D000): No database selected
mysql> select * from zjzc.t200;
+-----+---------+-------------+--------+
| sn | phoneNo | channelType | status |
+-----+---------+-------------+--------+
| 1 | 1 | 2 | 1 |
| 2 | 2 | 2 | 2 |
| 3 | 3 | 2 | 3 |
| 4 | 4 | 2 | 4 |
| 5 | 5 | 2 | 5 |
| 6 | 6 | 2 | 6 |
| 7 | 7 | 2 | 7 |
| 8 | 8 | 2 | 8 |
| 9 | 9 | 2 | 9 |
| 10 | 10 | 2 | 10 |
| 11 | 11 | 2 | 11 |
| 12 | 12 | 2 | 12 |
| 13 | 13 | 2 | 13 |
| 14 | 14 | 2 | 14 |
| 15 | 15 | 2 | 15 |
| 16 | 16 | 2 | 16 |
| 17 | 17 | 2 | 17 |
| 18 | 18 | 2 | 18 |
| 19 | 19 | 2 | 19 |
| 20 | 20 | 2 | 20 |
| 21 | 21 | 2 | 21 |
| 22 | 22 | 2 | 22 |
| 23 | 23 | 2 | 23 |
| 24 | 24 | 2 | 24 |
| 25 | 25 | 2 | 25 |
| 26 | 26 | 2 | 26 |
| 27 | 27 | 2 | 27 |
| 28 | 28 | 2 | 28 |
| 29 | 29 | 2 | 29 |
| 30 | 30 | 2 | 30 |
| 31 | 31 | 4 | 31 |
| 34 | 34 | 3 | 34 |
| 39 | 39 | 3 | 39 |
| 41 | 41 | 1 | 41 |
| 46 | 46 | 1 | 46 |
| 100 | 1 | 1 | 1 |
| 101 | 1 | 1 | 1 |
+-----+---------+-------------+--------+
37 rows in set (0.00 sec) 此时会出现事务: mysql> select * from INFORMATION_SCHEMA.INNODB_TRX\G;
*************************** 1. row ***************************
trx_id: 389256466
trx_state: RUNNING
trx_started: 2016-12-19 12:39:40
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 0
trx_mysql_thread_id: 2
trx_query: NULL
trx_operation_state: NULL
trx_tables_in_use: 0
trx_tables_locked: 0
trx_lock_structs: 0
trx_lock_memory_bytes: 360
trx_rows_locked: 0
trx_rows_modified: 0
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
1 row in set (0.00 sec) ERROR:
No query specified zabbix:/root/mysql# sh ./mon_mysql_all.sh
,,,,,
2016-12-19 12:43:00,200,2,root,localhost,
mysql[192.168.11.187] processid[2] root@localhost in db[] hold transaction time 200 会出现事务 2.不开启事务,直接运行大的查询 mysql> select * from ClientActionTrack20151125;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 3
Current database: zjzc mysql> select * from INFORMATION_SCHEMA.INNODB_TRX\G;
*************************** 1. row ***************************
trx_id: 389259097
trx_state: RUNNING
trx_started: 2016-12-19 12:50:55
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 0
trx_mysql_thread_id: 3
trx_query: select * from ClientActionTrack20151125
trx_operation_state: fetching rows
trx_tables_in_use: 1
trx_tables_locked: 0
trx_lock_structs: 0
trx_lock_memory_bytes: 360
trx_rows_locked: 0
trx_rows_modified: 0
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 1
trx_autocommit_non_locking: 1
1 row in set (0.11 sec) ERROR:
No query specified

mysql rr 查询出现的事务情况的更多相关文章

  1. MySQL高级查询 & 事务机制

    1.基础查询where 高级条件查询Where子句 SELECT empno,ename,sal,hiredate FROM t_tmp WHERE deptno=10 AND (sal+IFNULL ...

  2. [高性能MYSQL 读后随笔] 关于事务的隔离级别(一)

    一.锁的种类 MySQL中锁的种类很多,有常见的表锁和行锁,也有新加入的Metadata Lock等等,表锁是对一整张表加锁,虽然可分为读锁和写锁,但毕竟是锁住整张表,会导致并发能力下降,一般是做dd ...

  3. MySQL隔离性及Spring事务

    一.数据库事务ACID特性 必须要掌握事务的4个特性,其中事务的隔离性之于MySQL,对应4级隔离级别. 原子性(Atomicity): 事务中的所有原子操作,要么都能成功完成,要么都不完成,不能停滞 ...

  4. mysql死锁(锁与事务)

    线上某服务时不时报出如下异常(大约一天二十多次):“Deadlock found when trying to get lock;”. Oh, My God! 是死锁问题.尽管报错不多,对性能目前看来 ...

  5. Mysql --09 Innodb核心特性——事务

    目录 Innodb核心特性--事务 1.什么是事务 2.事务的通俗理解 3.事务ACID特性 4.事务流程举例 5.事务的控制语句 6.事务隐式提交情况 7.事务日志redo基本功能 8.redo数据 ...

  6. mysql(3):锁和事务

    MySQL锁的介绍 锁是数据库系统区别于文件系统的一个关键特性.锁机制用于管理对共享资源的并发访问. 表级锁 例如MyISAM引擎,其锁是表锁设计.并发情况下的读没有问题,但是并发插入时的性能要差一些 ...

  7. MySQL全面瓦解14:事务

    关于事务 我们在数据库中需要执行一个系列的操作的时候,要保证这个系列执行的连续性和完整性,要么整个系列的执行都成功,要么就全部失败(只要有一个步骤失败,其他均回滚到之前的状态), 保证不会存在一部分成 ...

  8. 「MySQL高级篇」MySQL之MVCC实现原理&&事务隔离级别的实现

    大家好,我是melo,一名大三后台练习生,死去的MVCC突然开始拷打我! 引言 MVCC,非常顺口的一个词,翻译起来却不是特别顺口:多版本并发控制. 其中多版本是指什么呢?一条记录的多个版本. 并发控 ...

  9. mysql死锁-查询锁表进程-分析锁表原因【转】

    查询锁表进程: 1.查询是否锁表 show OPEN TABLES where In_use > 0;   2.查询进程     show processlist   查询到相对应的进程===然 ...

随机推荐

  1. link方式安装Eclispe插件:greenUML

    用Link方式安装Eclipse插件有几点好处: (1)把自己的插件和Eclipse自带的插件分离 (2)可以通过修改link文件来决定是否加载该插件 (3)重新安装Eclipse的时候,直接拷贝自己 ...

  2. C#基础(八)——C#数据类型的转换

    C#数据类型的转换主要有以下几种方式: 1.强制转换 注意:char类型不能强制转换成int,如果使用强制转化,得到的是原整数的ASCII码值. 2.class.parse(string类型的变量), ...

  3. 一个不错的图片滑动展示插件 anythingslider

    一个不错的图片http://css-tricks.com/anythingslider-jquery-plugin/ DEMO演示: http://css-tricks.github.io/Anyth ...

  4. Spark Streaming揭秘 Day19 架构设计和运行机制

    Spark Streaming揭秘 Day19 架构设计和运行机制 今天主要讨论一些SparkStreaming设计的关键点,也算做个小结. DStream设计 首先我们可以进行一个简单的理解:DSt ...

  5. CodeBlocks去掉拼写检查

    打开: 选择Compiler... 将红框里面的勾都点掉即可!

  6. 用JS给浏览器的关闭按钮添加事件

    以下是指在js中实现,而非 <body onunload="close()"> 这种方法! 因为这样是在unload掉body的时候触发,而无论任何浏览器,都会在关闭的 ...

  7. EXTJS 4.2 资料 控件之textfield文本框加事件的用法

    { xtype: "textfield", width: 100, id: "txtGroupName", name: "txtGroupName&q ...

  8. The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine. (System.Data)

    When you try to import Excel 2007 or later “.xlsx” files into an SQL Server 2008 database you may ge ...

  9. Sugarcrm Email Integration

    Introdurce http://www.sugarcrm.com/feature/email-integration Tutor http://www.youtube.com/watch?v=BQ ...

  10. mysql日志详细解析 [转]

    原文出处:http://pangge.blog.51cto.com/6013757/1319304 MySQL日志: 主要包含:错误日志.查询日志.慢查询日志.事务日志.二进制日志: 日志是mysql ...