网站首页 > 技术文章 正文
概述
github:https://github.com/jeremycole/innodb_ruby
今天主要介绍一个比较有趣的解析器,也是对 InooDB 格式文件的解析器,用于 Ruby 语言,下面一起来看看吧~
1、Installing using RubyGems
sudo gem install innodb_ruby
2、测试运行
innodb_space ...
3、基础用法
Basics of using innodb_space from the command line. There are two ways to start innodb_space.
Against a single space file (ibdata or .ibd):
Against a system tablespace which will auto-load file-per-table tablespace files:
4、Space File Structure
4.1、system-spaces
List all tablespaces available from the system, including some basic stats. This is basically a list of tables:
innodb_space -s ibdata1 system-spaces
4.2、space-indexes
List all indexes available from the space (system space or file-per-table space):
innodb_space -s /var/lib/mysql/ibdata1 -T jumpserver/assets_asset space-indexes
4.3、space-page-type-regions
Iterate through all pages in a space and print a summary of page types coalesced into “regions” of same-type pages:
innodb_space -s /var/lib/mysql/ibdata1 -T jumpserver/assets_asset space-page-type-regions
4.4、space-page-type-summary
Iterate through all pages and print a summary of total counts of pages by type:
innodb_space -s ibdata1 -T jumpserver/assets_asset space-page-type-summary
4.5、space-extents-illustrate
Illustrate all pages in all extents in the space, showing a colorized block (colored by index/purpose) for each page, sized based on the amount of data in the page:
innodb_space -s ibdata1 -T jumpserver/assets_asset space-extents-illustrate
4.6、space-lsn-age-illustrate
Illustrate all pages in all extents in the space, showing a colorized block (colored by the age of the modification LSN for the page):
innodb_space -s ibdata1 -T jumpserver/assets_asset space-lsn-age-illustrate
5、Page Structure
5.1、page-account
Given any page number, explain what the page is used for (for most structures):
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 3 page-account
5.2、page-dump
Intelligently dump the contents of a page including a representation of most structures that innodb_ruby understands:
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 3 page-dump
5.3、page-records
Summarize all records within the page:
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 3 page-records
5.4、page-directory-summary
Dump the contents of the page directory for a page
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 7 page-directory-summary
5.5、page-illustrate
Illustrate the content of a page:
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 7 page-illustrate
6、Index Structure
6.1、index-recurse
Recurse an index (perform a full index scan) by following the entire B+Tree (scanning all pages by recursion, not just the leaf pages by list):
innodb_space -s ibdata1 -T jumpserver/assets_asset -I PRIMARY index-recurse
6.2、index-record-offsets
Recurse an index as index-recurse does, but print the offset of each record within the index pages:
innodb_space -s ibdata1 -T jumpserver/assets_asset -I PRIMARY index-record-offsets
6.3、index-level-summary
Print a summary of all index pages at a given level:
innodb_space -s ibdata1 -T jumpserver/assets_asset -I PRIMARY -l 0 index-level-summary
7、Record Structure
7.1、record-dump
Given a record offset, dump a detailed description of a record and the data it contains:
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 7 -R 128 record-dump
8、Record History
8.1、record-history
Summarize the history (undo logs) of a record:
innodb_space -s ibdata1 -T jumpserver/assets_asset -p 7 -R 128 record-history
9、Additional exploration
9.1、space-lists
Show a summary of the lists (free, free_frag, full_frag, free_inodes, and full_inodes) for the space, including the list length and the list node information of the first and last pages in the list:
innodb_space -s ibdata1 space-lists
9.2、space-list-iterate
Iterate through all extents in a list and show the extents or inodes in the list:
innodb_space -s ibdata1 space-list-iterate -L free_frag
9.3、space-inodes-summary
Print summary information for each inode in the space:
innodb_space -s ibdata1 space-inodes-summary
9.4、undo-history-summary
Print a summary of all records in the history list (undo logs):
innodb_space -s ibdata1 undo-history-summary
9.5、undo-record-dump
Print a detailed description of an undo record and the data it contains:
innodb_space -s ibdata1 -p page -R offset undo-record-dump
觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~
猜你喜欢
- 2024-10-02 掌控你的MySQL语句执行方案(如何让mysql执行脚本?)
- 2024-10-02 我爱Julia之入门-075(字符串05)
- 2024-10-02 Java入门超经典教程-数组的操作(java数组视频教学)
- 2024-10-02 AdaBoost算法(手稿+代码)(adaboost算法详解)
- 2024-10-02 有了for循环 为什么还要forEach?(为什么用for循环)
- 2024-10-02 UFS深入浅出 第二章 UFS结构 第三节 UFS分区
- 2024-10-02 Ruby 最常用指令和函数(备忘查询)
- 2024-10-02 MYSQL优化有理有据全分析(面试必备)
- 2024-10-02 最小优先队列 Index min priority queue
- 2024-10-02 mysql explain用法(mysql游标的定义与使用)
- 最近发表
- 标签列表
-
- cmd/c (64)
- c++中::是什么意思 (83)
- 标签用于 (65)
- 主键只能有一个吗 (66)
- c#console.writeline不显示 (75)
- js判断是否空对象 (63)
- pythoncase语句 (81)
- es6includes (73)
- sqlset (64)
- phprequire_once (61)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- & (66)
- java (73)
- org.redisson (64)
- cannotinstantiatethetype (62)
- js数组插入 (83)
- gormwherein (64)
- linux删除一个文件夹 (65)
- mac安装java (72)
- outofmemoryerror是什么意思 (64)
- flask文件上传 (63)
- eacces (67)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)