Giter Site home page Giter Site logo

parseibd's Introduction

解析ibd文件,方便查看文件结构

ibd管理结构

space:表空间,管理segment和page

segment:段,管理extent

extent:区,管理page

page:页,最小存储单元,默认16KB

前提

parseibd默认page采用16KB大小,可通过变量innodb_page_size查看,并且表空间都是独立文件,可通过变量innodb_file_per_table查看

执行

git clone https://github.com/jemuelmiao/parseibd.git

cd parseibd

./build.sh

cd cmd

./parseibd -h {mysql地址} -u {用户名} -p {密码} -d {数据库名} -t {表名} -f {ibd文件路径}

输出文件说明

结果文件存放在output目录中

btree_xxx:索引btree page关系,可以方便查看btree的层级及page之间的连接关系

extents:全局extent列表,包括:空闲列表、部分使用列表、全部使用列表,由首页page fsp管理

inodes:全局page inode列表,包括:部分使用列表、全部使用列表,由首页page fsp管理

pages:所有page的编号、类型

rec_xxx:索引记录,包括:聚簇索引非叶子记录、聚簇索引叶子记录、二级索引非叶子记录、二级索引叶子记录

segments:所有page inode管理的segment列表及segment管理的extent列表

示例

表结构

image

输出结果文件

  • btree_card_id

image

  • btree_id

image

  • extents

image

  • inodes

image

  • pages

image

  • rec_card_id

image

  • rec_id

image

  • segments

image

TODO

  • 解析数据字典、frm文件,去掉连接mysql读取元数据的依赖
  • 部分不常用的数据类型解析,如point、geometry等
  • 前端可视化展示结果

相关阅读

http://www.miaozhouguang.com/?p=261

parseibd's People

Contributors

jemuelmiao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.