py_innodb_page_info.py脚本初体验

最近忙着看《mysql技术内幕 innodb存储引擎》一书,获益良多,也坚定了学好mysql的决心。当看到书本第95页时,作者介绍了一个强大功能的python脚本,用来查看表空间中各页的类型和信息,py_innodb_page_info.py。
于是进code.google.com查找py_innodb_page_info.py,却一直找不到下载文件,在某位网友的留言中看到
http://david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/,
在此感谢那位热心网友。
接下来进入正题
下载 py_innodb_page_info.py
#wget http://david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/py_innodb_page_info.py
运行
# python /root/py_innodb_page_info.py /data/mysql/ibdata1
Traceback (most recent call last):
File "/root/py_innodb_page_info.py", line 3, in <module>
import mylib
ImportError: No module named mylib
提示缺少mylib,其实整个py_innodb_page_info.py要完整运行的话,需要三个.py脚本
1.include.py
2.mylib.py
3.py_innodb_page_info.py
注意:需要将三个脚本放在同一目录下
wget http://david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/mylib.py
wget http://david-mysql-tools.googlecode.com/svn-history/r15/trunk/py_innodb_page_type/include.py
测试下是否成功
[root@localhost ~]# python py_innodb_page_info.py /data/mysql/ibdata1                        
                
Total number of page: 1152:
Insert Buffer Bitmap: 2
System Page: 244
Transaction system Page: 2
Freshly Allocated Page: 870
Undo Log Page: 7
File Segment inode: 4
B-tree Node: 21
File Space Header: 2


你可能感兴趣的:(mysql,python,技术,下载文件,空间)