ibd2sdi的英文一个用于从表空间文件中提取序列化字典搜索信息(SDI) 的实用程序 InnoDB
。SDI存在数据于所有持久InnoDB
表空间文件中。
ibd2sdi可以在 每个文件的表 空间文件(*.ibd
文件), 一般表空间文件(*.ibd
文件), 系统表空间 文件(ibdata*
文件)和数据字典表空间(mysql.ibd
)中运行。它不支持用于临时表空间或撤消表空间。
ibd2sdi可以在运行时或服务器脱机时使用。在 与SDI相关的 DDL 操作, 操作和撤消日志清除操作期间,当 ibd2sdi 无法读取存储在表空间中的SDI数据时,可能会有很短的时间间隔。ROLLBACK
ibd2sdi从指定的制表符空间执行未提交的SDI读取。重做日志和撤消日志不被访问。
这样像 调用ibd2sdi工具:
shell> ibd2sdi [options] file_name1 [file_name2 file_name3 ...]
ibd2sdi请立即获取iTunes像文件InnoDB
系统-表空间这样的多文件表空间,但它不能一次在多个表空间上运行。对于多文件表空间,请指定每个文件:
shell> ibd2sdi ibdata1 ibdata2
多文件表空间的文件必须按照升序页码的顺序指定。如果两个连续的文件具有相同的空间ID,则后面的文件必须以前一个文件的最后一个页码+ 1开始。
ibd2sdi格式输出SDI(包含id,类型和数据字段)。JSON
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.3节“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)中检索字段值,并仅检索作为SDI记录主键的字段值id
和type
字段值。shell> ibd2sdi --skip-data ../data/test/t1.ibd ["ibd2sdi" , { "type": 1, "id": 330 } , { "type": 2, "id": 7 } ]
--id=
,#
-i
#
检索与指定的表或表空间对象ID匹配的序列化字典信息(SDI)。对象ID对于对象类型是唯一的。表和表空间对象ID是在还发现
id
了列mysql.tables
和mysql.tablespace
数据字典表。有关数据字典表的信息,请参见 第14.1节“数据字典模式”。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)。SDI是为表(type = 1)和表空间(type = 2)对象提供的。
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
指定一个严格的校验和算法来验证读取的页面的校验和。选项包括
innodb
,crc32
,和none
。在这个例子中,指定了严格的
innodb
校验和算法:shell> ibd2sdi --strict-check=innodb ../data/test/t1.ibd
在这个例子中,
crc32
指定了严格的 校验和算法:shell> ibd2sdi -c crc32 ../data/test/t1.ibd
如果不指定
--strict-check
选项,验证对不严格执行innodb
,crc32
并none
校验。--no-check
,-n
跳过读取页面的校验和验证。
shell> ibd2sdi --no-check ../data/test/t1.ibd
--pretty
,-p
以JSON漂亮打印格式输出SDI数据。默认启用。如果禁用,SDI不是人类可读的,但尺寸较小。使用
--skip-pretty
禁用。在MySQL 8.0.11中添加。本文由学什么技术好网翻译shell> ibd2sdi --skip-pretty ../data/test/t1.ibd