参考mysql8.0官方文档 https://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html

ibd2sdi是一个实用程序,用于从表空间文件中提取 序列化的字典信息(SDI) InnoDB。SDI数据存在于所有持久性InnoDB表空间文件中。

ibd2sdi可以在 每个 表文件空间文件(*.ibd文件), 常规表空间文件(*.ibd文件), 系统表空间 文件(ibdata*文件)和数据字典表空间(mysql.ibd)上运行。不支持将其与临时表空间或撤消表空间一起使用。

ibd2sdi可以在运行时或服务器离线时使用。在 与SDI相关的DDL 操作, ROLLBACK操作和撤消日志清除操作期间, ibd2sdi 无法读取存储在表空间中的SDI数据的时间间隔可能很短。

ibd2sdi从指定的表空间执行未提交的SDI读取。无法访问重做日志和撤消日志。

像这样 调用ibd2sdi实用程序:

shell> ibd2sdi [options] file_name1 [file_name2 file_name3 ...]

ibd2sdi支持像InnoDB系统表空间这样的多文件表空间,但是不能一次在多个表空间上运行。对于多文件表空间,请指定每个文件:

shell> ibd2sdi ibdata1 ibdata2

多文件表空间的文件必须按照升序页码的顺序指定。如果两个连续的文件具有相同的空间ID,则后一个文件必须以前一个文件的最后一页编号+ 1开头。

ibd2sdiJSON格式输出SDI(包含id,type和data字段)。

ibd2sdi选项

ibd2sdi支持以下选项:

  • --help, -h

    显示命令行帮助。

    shell> ibd2sdi --help
    Usage: ./ibd2sdi [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
    See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
    -h, --help Display this help and exit.
    -v, --version Display version information and exit.
    -#, --debug[=name] Output debug log. See
    http://dev.mysql.com/doc/refman/8.0/en/dbug-package.html
    -d, --dump-file=name
    Dump the tablespace SDI into the file passed by user.
    Without the filename, it will default to stdout
    -s, --skip-data Skip retrieving data from SDI records. Retrieve only id
    and type.
    -i, --id=# Retrieve the SDI record matching the id passed by user.
    -t, --type=# Retrieve the SDI records matching the type passed by
    user.
    -c, --strict-check=name
    Specify the strict checksum algorithm by the user.
    Allowed values are innodb, crc32, none.
    -n, --no-check Ignore the checksum verification.
    -p, --pretty Pretty format the SDI output.If false, SDI would be not
    human readable but it will be of less size
    (Defaults to on; use --skip-pretty to disable.) Variables (--variable-name=value)
    and boolean options {FALSE|TRUE} Value (after reading options)
    --------------------------------- ----------------------------------------
    debug (No default value)
    dump-file (No default value)
    skip-data FALSE
    id 0
    type 0
    strict-check crc32
    no-check FALSE
    pretty TRUE
  • --version, -v

    显示MySQL版本信息。

    shell> ibd2sdi --version
    ibd2sdi Ver 8.0.3-dmr for Linux on x86_64 (Source distribution)
  • --debug[=debug_options], -# [debug_options]

    打印调试日志。有关调试选项,请参见 第29.5.4节“ DBUG软件包”

    shell> ibd2sdi --debug=d:t /tmp/ibd2sdi.trace
  • --dump-file=, -d

    将序列化的字典信息(SDI)转储到指定的转储文件中。如果未指定转储文件,则表空间SDI将转储到stdout

    shell> ibd2sdi --dump-file=file_name ../data/test/t1.ibd
  • --skip-data, -s

    跳过data从序列化字典信息(SDI)中检索字段值的操作,仅检索id和 type字段值,它们是SDI记录的主键。

    shell> ibd2sdi --skip-data ../data/test/t1.ibd
    ["ibd2sdi"
    ,
    {
    "type": 1,
    "id": 330
    }
    ,
    {
    "type": 2,
    "id": 7
    }
    ]
  • --id=#, -i #

    检索与指定表或表空间对象ID匹配的序列化字典信息(SDI)。对象ID对于对象类型是唯一的。表和表空间对象ID也在和 数据字典表的id列中 找到。有关数据字典表的信息,请参见 第14.1节“数据字典架构”。 mysql.tablesmysql.tablespace

    shell> ibd2sdi --id=7 ../data/test/t1.ibd
    ["ibd2sdi"
    ,
    {
    "type": 2,
    "id": 7,
    "object":
    {
    "mysqld_version_id": 80003,
    "dd_version": 80003,
    "sdi_version": 1,
    "dd_object_type": "Tablespace",
    "dd_object": {
    "name": "test/t1",
    "comment": "",
    "options": "",
    "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
    "engine": "InnoDB",
    "files": [
    {
    "ordinal_position": 1,
    "filename": "./test/t1.ibd",
    "se_private_data": "id=2;"
    }
    ]
    }
    }
    }
    ]
  • --type=#, -t #

    检索与指定对象类型匹配的序列化字典信息(SDI)。为表(类型= 1)和表空间(类型= 2)对象提供了SDI。

    shell> ibd2sdi --type=2 ../data/test/t1.ibd
    ["ibd2sdi"
    ,
    {
    "type": 2,
    "id": 7,
    "object":
    {
    "mysqld_version_id": 80003,
    "dd_version": 80003,
    "sdi_version": 1,
    "dd_object_type": "Tablespace",
    "dd_object": {
    "name": "test/t1",
    "comment": "",
    "options": "",
    "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
    "engine": "InnoDB",
    "files": [
    {
    "ordinal_position": 1,
    "filename": "./test/t1.ibd",
    "se_private_data": "id=2;"
    }
    ]
    }
    }
    }
    ]
  • --strict-check, -c

    指定严格的校验和算法,以验证读取的页面的校验和。选项包括 innodbcrc32,和 none

    在此示例中,innodb指定了校验和算法的严格版本 :

    shell> ibd2sdi --strict-check=innodb ../data/test/t1.ibd

    在此示例中,crc32指定了校验和算法的严格版本 :

    shell> ibd2sdi -c crc32 ../data/test/t1.ibd

    如果不指定 --strict-check选项,验证对不严格执行 innodbcrc32并 none校验。

  • --no-check, -n

    跳过读取页面的校验和验证。

    shell> ibd2sdi --no-check ../data/test/t1.ibd
  • --pretty, -p

    以JSON漂亮打印格式输出SDI数据。默认启用。如果禁用,则SDI不可读,但尺寸较小。使用--skip-pretty到禁用。

    shell> ibd2sdi --skip-pretty ../data/test/t1.ibd

最新文章

  1. 动手动脑:Finally
  2. oracle 根据字段分组后,将组内的数据根据字段排序
  3. C# 杂项
  4. CCPC总结
  5. 【BZOJ】【2733】【HNOI2012】永无乡
  6. C# 跨线程调用问题
  7. Matlab:回归分析(2)
  8. oschina插件和扩展
  9. Acitivity创建与配置
  10. 小Q系列故事——电梯里的爱情
  11. JSON - Qt 对 JSON的处理
  12. Struts2中Action配置的三种方式
  13. linux 在jetty中部署web工程
  14. zookeeper 笔记-小结
  15. TensorFlow基础
  16. 一次webapck4 配置文件无效的解决历程
  17. mfc 友元类
  18. hdu 5826 physics 物理题
  19. 朴素贝叶斯-对数似然Python实现-Numpy
  20. [ 原创 ] Java基础8--什么叫做重载

热门文章

  1. python opencv:色彩空间
  2. Kubernetes的pod控制器之DaemonSet
  3. 推荐一款好用的博客离线编辑工具——OpenLiveWriter
  4. Pandas的Categorical Data类型
  5. 操作系统OS - 重装Windows7卡在completing installation
  6. http调用之RestTemplate
  7. 数字统计(0)&lt;P2010_1&gt;
  8. 七 Spring的IOC的注解方式
  9. ElementUI 日期选择器 datepicker 选择范围限制
  10. Java中四种遍历Map对象的方法