Chinaunix首页 | 论坛 | 博客
  • 博客访问: 373111
  • 博文数量: 55
  • 博客积分: 3195
  • 博客等级: 中校
  • 技术积分: 712
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 18:45
文章分类

全部博文(55)

文章存档

2011年(14)

2010年(41)

分类: Mysql/postgreSQL

2010-10-08 16:29:59

show innodb status 在以后的mysql版本将会被show engine innodb status所替代。

总所周知show engine innodb status是用来查看当前的mysql数据库中innodb表的相关状态。

1:show engine innodb status。

-----------------------------------+
| Type | Name | Status |
+-----------------------------------------------------------------------
| InnoDB | |
=====================================
101006 5:35:16 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 41 seconds
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 5, signal count 5
Mutex spin waits 0, rounds 40, OS waits 0
RW-shared spins 10, OS waits 5; RW-excl spins 0, OS waits 0
------------
TRANSACTIONS
------------
Trx id counter 0 840967
Purge done for trx's n:o < 0 840966 undo n:o < 0 0
History list length 11
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, process no 3574, OS thread id 2982812560
MySQL thread id 2, query id 13 localhost root
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
37 OS file reads, 45 OS file writes, 30 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2,
0 inserts, 0 merged recs, 0 merges
Hash table size 17393, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 0 451016813
Log flushed up to 0 451016813
Last checkpoint at 0 451016813
0 pending log writes, 0 pending chkp writes
19 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 13429750; in additional pool allocated 183680
Dictionary memory allocated 22888
Buffer pool size 256
Free buffers 235
Database pages 20
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 24, created 4, written 37
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 3574, id 2937031568, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT

2:我们可以创建一个innodb_monitor的表,将每隔15s的innodb状态写入到日志文件中。

create table innodb_monitor(a int)engine=innodb;

当我们不需要写入到日志文件中的时候,直接drop table innodb_monitor即可。

这中方法它是每隔15s搜集一次相关状态。


再次只对如何查看mysqlstatus做出批注,

显示的状态信息中有很多有用的东西,自己可以慢慢研究,网上也有很多详细的说明!再次不做赘诉。

阅读(6012) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~