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 查询到相对应的进程===然 ...
随机推荐
- DEDECMS中,channel标签
获取栏目列表标签 dede:channel 标签: {dede:channel type='top' row='8' currentstyle="<li><a href=' ...
- hash桶
#include <stdio.h> #include <stdlib.h> #include "chain.c" //include the chain. ...
- JavaScript jQuery 入门回顾 2
JQuery 滑动 利用jQuery可以在元素上创建滑动效果. slideDown() 向下滑动元素. slideUp() 向上滑动元素. slideToggle() 在 slideDown() 与 ...
- C#获取“所有用户桌面”的路径
想用C#得到The All Users Desktop(Public\Desktop)的路径. 原来以为很简单,然而 Environment.GetFolderPath(Environment.Spe ...
- js 闭包 详解
闭包(closure)是Javascript语言的一个难点,也是它的特色,很多高级应用都要依靠闭包实现. 闭包的特性 闭包有三个特性: 1.函数嵌套函数 2.函数内部可以引用外部的参数和变量 3.参数 ...
- js给数字加三位一逗号间隔的两种方法(面试题)
方法一: <script type= "text/javascript"> //保留三位小数,toLocaleString() 方法可把一个 Number 对象转换 ...
- [SQL Server]树形结构的创建
对于SQL Server来说,构建显示一个树形结构不是一件容易的事情,逻辑构造能力不是它的强项.不过也不是说它没有能力干这个事情,只要换一种思维方式就可以理解它的工作原理. 例如,现在有一张表的内容如 ...
- 009.EscapeRegExChars
类型:function 可见性:public 所在单元:RegularExpressionsCore 父类:TPerlRegEx 把转义字符变成原意字符 例如\d意为0~9某个数字,通过此函数转换后则 ...
- [转]JAVA布局模式:GridBagConstraints终极技巧
最近正在 修改<公交线路查询系统>,做系统的时候都是用NULL布局,由于NULL布局调用windows系统的API,所以生成的程序无法在其他平台上应用,而 且如果控件的数量很多,管理起来也 ...
- Nginx upstream的5种权重分配方式
.轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,后端服务器down掉,能自动剔除 .weight 指定轮询几率,weight和访问比率成正比,用于后端服务器性能不均的情况. upstre ...