mysql rr 查询出现的事务情况
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 查询出现的事务情况的更多相关文章
- MySQL高级查询 & 事务机制
1.基础查询where 高级条件查询Where子句 SELECT empno,ename,sal,hiredate FROM t_tmp WHERE deptno=10 AND (sal+IFNULL ...
- [高性能MYSQL 读后随笔] 关于事务的隔离级别(一)
一.锁的种类 MySQL中锁的种类很多,有常见的表锁和行锁,也有新加入的Metadata Lock等等,表锁是对一整张表加锁,虽然可分为读锁和写锁,但毕竟是锁住整张表,会导致并发能力下降,一般是做dd ...
- MySQL隔离性及Spring事务
一.数据库事务ACID特性 必须要掌握事务的4个特性,其中事务的隔离性之于MySQL,对应4级隔离级别. 原子性(Atomicity): 事务中的所有原子操作,要么都能成功完成,要么都不完成,不能停滞 ...
- mysql死锁(锁与事务)
线上某服务时不时报出如下异常(大约一天二十多次):“Deadlock found when trying to get lock;”. Oh, My God! 是死锁问题.尽管报错不多,对性能目前看来 ...
- Mysql --09 Innodb核心特性——事务
目录 Innodb核心特性--事务 1.什么是事务 2.事务的通俗理解 3.事务ACID特性 4.事务流程举例 5.事务的控制语句 6.事务隐式提交情况 7.事务日志redo基本功能 8.redo数据 ...
- mysql(3):锁和事务
MySQL锁的介绍 锁是数据库系统区别于文件系统的一个关键特性.锁机制用于管理对共享资源的并发访问. 表级锁 例如MyISAM引擎,其锁是表锁设计.并发情况下的读没有问题,但是并发插入时的性能要差一些 ...
- MySQL全面瓦解14:事务
关于事务 我们在数据库中需要执行一个系列的操作的时候,要保证这个系列执行的连续性和完整性,要么整个系列的执行都成功,要么就全部失败(只要有一个步骤失败,其他均回滚到之前的状态), 保证不会存在一部分成 ...
- 「MySQL高级篇」MySQL之MVCC实现原理&&事务隔离级别的实现
大家好,我是melo,一名大三后台练习生,死去的MVCC突然开始拷打我! 引言 MVCC,非常顺口的一个词,翻译起来却不是特别顺口:多版本并发控制. 其中多版本是指什么呢?一条记录的多个版本. 并发控 ...
- mysql死锁-查询锁表进程-分析锁表原因【转】
查询锁表进程: 1.查询是否锁表 show OPEN TABLES where In_use > 0; 2.查询进程 show processlist 查询到相对应的进程===然 ...
随机推荐
- HTML5之 WebSockets
------- 新的网络连接技术 - Web-Sockets 持续连接数据流 全双工工作方式 http补充品而非替代品 - 应用场景 聊天室 股票显示 在线游戏(尤为突出) - 2byte的通信 1b ...
- apache重写字段详细说明
用Apache虚拟主机的朋友很多,apache提供的.htaccess模块可以为每个虚拟主机设定rewrite规则,这对网站SEO优化相当有用,同时也改善了用户体验.国内的虚拟机一般不提供.htacc ...
- php框架-yii
安装 修改权限问题:runtime;web/assets(mac上) 配置cookie加密串 config/web.php 修改cookieValidationKey L12 配置数据库 控制器: 默 ...
- php检查漏洞防护补丁-防护XSS,SQL,文件包含等多种高危漏洞
/** * 通用漏洞防护补丁 * 功能说明:防护XSS,SQL,代码执行,文件包含等多种高危漏洞 * Class CheckRequestServer */ class CheckRequestSer ...
- python装饰器总结
一.装饰器是什么 python的装饰器本质上是一个Python函数,它可以让其他函数在不需要做任何代码变动的前提下增加额外功能,装饰器的返回值也是一个函数对象.简单的说装饰器就是一个用来返回函数的函数 ...
- 帝国cms中 内容分页的SEO优化
关于内容页如果存在分页的话,我们想区分第一页和后面数页,当前的通用做法是在标题上加入分页码,帝国cms中如何做到呢.我们可以修改在e/class/functions.php中的源码.找到找到GetHt ...
- DataGrid中取HyperLinkColumn列的值,处理DataGrid中绑定的特殊字符
DataGrid中取HyperLinkColumn列的值. /// <summary> /// 对datagrid中标签进行编码,处理特殊字符 /// </summary> / ...
- easy ui datagrid 动态绑定数据并绑定链接,进行操作
①.绑定datagrid,formatter { field: 'ShopId', title: '操作', width: 200, align: 'left', formatter: showSho ...
- iOS9下修改回HTTP模式进行网络请求
升级为iOS9后,默认请求类型为https,如何使用http进行请求会报错 The resource could not be loaded because the App Transport Sec ...
- UIApplication深入研究
我们偶尔会调用这个类的api来实现一些功能,但是这个类是iOS编程中很重要的一个概念,所以总结以下这个类的信息,不对的地方请留言. UIApplication的核心作用是提供了iOS程序运行期间的控制 ...