天天看点

使用innodb_ruby 分析innodb物理文件

以CentOS6.8为例,在root目录下执行如下的命令:

yum install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel

innodb_ruby 需要至少1.9.3版本的ruby,yum自带的1.8.X版本太低了,需要我们编译安装ruby

wget https://cache.ruby-china.org/pub/ruby/ruby-1.9.3-p551.tar.gz

tar zxvf ruby-1.9.3-p551.tar.gz

cd ruby-1.9.3-p551

./configure

make && make install

默认安装到/usr/local/bin 目录下。

git clone https://github.com/rubygems/rubygems.git

cd rubygems/bin

./gem install innodb_ruby

工具作者的博文:

<a href="https://blog.jcole.us/2013/01/02/on-learning-innodb-a-journey-to-the-core/" target="_blank">https://blog.jcole.us/2013/01/02/on-learning-innodb-a-journey-to-the-core/</a>

<a href="https://github.com/jeremycole/innodb_diagrams" target="_blank">https://github.com/jeremycole/innodb_diagrams</a>

<a href="https://www.percona.com/live/mysql-conference-2013/sessions/innodb-journey-core" target="_blank">https://www.percona.com/live/mysql-conference-2013/sessions/innodb-journey-core</a>

cd /var/lib/mysql   --&gt; 使用这个工具需要先先换到datadir目录下

查看系统表空间:

  innodb_space -s ibdata1 system-spaces

其他命令可以参看

<a href="http://www.cnblogs.com/cnzeno/p/6322842.html" target="_blank">http://www.cnblogs.com/cnzeno/p/6322842.html</a>

本文转自 lirulei90 51CTO博客,原文链接:http://blog.51cto.com/lee90/1952013,如需转载请自行联系原作者

继续阅读