参考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

ibd2sdi — InnoDB表空间SDI提取实用程序的更多相关文章

  1. Innodb 表空间传输迁移数据

    在mysql5.5之前,mysql实例中innodb引擎表的迁移是个头疼的问题,要么使用mysqldump导出,要么使用物理备份的方法,但是在mysql5.6之后的版本中,可以使用一个新特性,方便地迁 ...

  2. MySQL Innodb表空间不足的处理方法

    官方给出的解决方案: 添加和删除 InnoDB 数据和日志文件 这一节描述在InnoDB表空间耗尽空间之时,或者你想要改变日志文件大小之时,你可以做的一些事情. 最简单的,增加InnoDB表空间大小的 ...

  3. 10. InnoDB表空间加密

    10. InnoDB表空间加密 InnoDB支持存储在单独表空间中的表的数据加密 .此功能为物理表空间数据文件提供静态加密. 详细信息见官方文档

  4. MySQL InnoDB表空间加密

    从 MySQL5.7.11开始,MySQL对InnoDB支持存储在单独表空间中的表的数据加密 .此功能为物理表空间数据文件提供静态加密.该加密是在引擎内部数据页级别的加密手段,在数据页写入文件系统时加 ...

  5. Innodb 表空间卸载、迁移、装载

    从MySQL的Innodb特性中我们知道,Inndob的表空间有共享和独享的特点,如果是共享的.则默认会把表空间存放在一个文件中(ibdata1),当开启独享表空间参数Innodb_file_per_ ...

  6. InnoDB表空间、段、区

    1. 表空间是InnoDB存储引擎逻辑结构的最高层,所有的数据都存放在表空间中.默认,InnoDB存储引擎只有一个表空间ibdata1,即所有数据都存放在这个表空间内.如果用户启用了参数innodb_ ...

  7. Innodb表空间

    Innodb有两种管理表空间的方法 独立表空间:每一张表都会生成独立的文件来进行存储,每一张表都有一个.frm表描述文件,和一个.ibd文件.其中ibd文件包括了单独一个表的数据内容和索引内容. 共享 ...

  8. 019:InnoDB 表空间内部组织结构

    一. 表空间内部组织结构 表空间 内部有多个段对象(Segment) 组成 每个段(Segment)由区(Extent) 组成 每个区(Extent)由页(Page)组成 每个页里面报存数据 (或者叫 ...

  9. Innodb表空间迁移过程

    1.大致流程 将a实例的表的数据迁移到b实例上. 1.在目标实例b上创建一个相同的表 2.在目标库b上执行ALTER TABLE t DISCARD TABLESPACE; 3.在源库a上执行FLUS ...

随机推荐

  1. 解决el-input 触发不了键盘事件

    <el-input v-model="form.loginName" placeholder="账号" @keyup.enter="doLogi ...

  2. JSONObject、 JsonObject、阿里fastJson、谷歌gson区别

    JSON:JavaScript Object Notation Java对象表示法 Java中并没有内置的 JSON 解析,需要使用第三方类库.常用的类库如下 一.Gson : 古河开发的JSON 库 ...

  3. WPF TreeGrid Binding 简易实现方式

    在設計TreeView編輯狀況下,希望 TreeItemName 后续的编辑框 复选框 可以整齐排列. 参考微软提供的TREELISTVIEW,发现它是根据层级关系调整Margin 属性. 我这边按照 ...

  4. The property does not exist in XML namespace

    自定义依赖属性,绑定在xaml文件中,无问题. 但是编译失败,报 The property does not exist in XML namespace 错误. 发现如果依赖属性定义在本程序集中,在 ...

  5. php 算法知识 冒泡排序

    function bubble_order($arr){ //得到长度 $count_num=count($arr); for($k=1;$k<$count_num;$k++){ //对长度越来 ...

  6. 循环语句(while语句和do...while语句)

    1.while语句:如果条件成立,就继续循环,直到条件不成立为止.格式如下: while (条件) {               循环体(语句或语句块) } 2.do…while语句:如果条件成立, ...

  7. char、pchar、string互相转换

    1.string转换成pchar 可以使用pchar进行强制类型转换,也可以使用StrPCopy函数 var s:string; p,p1:PChar; begin s:='Hello Delphi' ...

  8. Servlet详细介绍

    <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" ...

  9. MySQL之关键字

    关键字: select * from 表名 where group by having distinct order by limit a,b between * and * 测试数据 # 测试数据 ...

  10. MYSQL 查询指定日期后的15天

    SELECT s.id, s.exhi_id, s.commission, s.order_main_id, s.create_date, s.fen_xiao_id, s.state, s.upda ...