ibd2sdi is a utility for extracting serialized dictionary information (SDI) from ibd2sdi是一个从InnoDB
tablespace files. InnoDB
表空间文件中提取序列化字典信息(SDI)的实用程序。SDI data is present all persistent SDI数据存在于所有持久的InnoDB
tablespace files.InnoDB
表空间文件中。
ibd2sdi can be run on file-per-table tablespace files (ibd2sdi可以在每个表的文件表空间文件(*.ibd
files), general tablespace files (*.ibd
files), system tablespace files (ibdata*
files), and the data dictionary tablespace (mysql.ibd
). *.ibd
文件)、通用表空间文件、系统表空间文件(ibdata*
文件)和数据字典表空间(mysql.ibd
)上运行。It is not supported for use with temporary tablespaces or undo tablespaces.它不支持与临时表空间或撤消表空间一起使用。
ibd2sdi can be used at runtime or while the server is offline. ibd2sdi可以在运行时或服务器脱机时使用。During DDL operations, 在ROLLBACK
operations, and undo log purge operations related to SDI, there may be a short interval of time when ibd2sdi fails to read SDI data stored in the tablespace.DDL
操作、ROLLBACK
操作和撤消与SDI
相关的日志清除操作期间,ibd2sdi可能会在短时间内无法读取存储在表空间中的SDI数据。
ibd2sdi performs an uncommitted read of SDI from the specified tablespace. Redo logs and undo logs are not accessed.ibd2sdi从指定的表空间执行SDI的未提交读取。无法访问恢复日志和撤消日志。
Invoke the ibd2sdi utility like this:按如下方式调用ibd2sdi实用程序:
ibd2sdi [options
]file_name1
[file_name2 file_name3 ...
]
ibd2sdi supports multi-file tablespaces like the ibd2sdi支持多文件表空间,如InnoDB
system tablespace, but it cannot be run on more than one tablespace at a time. For multi-file tablespaces, specify each file:InnoDB
系统表空间,但一次不能在多个表空间上运行。对于多文件表空间,指定每个文件:
ibd2sdi ibdata1 ibdata2
The files of a multi-file tablespace must be specified in order of the ascending page number. If two successive files have the same space ID, the later file must start with the last page number of the previous file + 1.必须按页码升序指定多文件表空间的文件。如果两个连续的文件具有相同的空间ID,则后一个文件必须从前一个文件的最后一个页码+1开始。
ibd2sdi outputs SDI (containing id, type, and data fields) in ibd2sdi以JSON
format.JSON
格式输出SDI(包含id、类型和数据字段)。
ibd2sdi supports the following options:ibd2sdi支持以下选项:
--help
, -h
Display a help message and exit. For example:显示帮助消息并退出。例如:
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
Display version information and exit. For example:显示版本信息并退出。例如:
ibd2sdi Ver 8.0.3-dmr for Linux on x86_64 (Source distribution)
--debug[=
, debug_options
]-# [
debug_options
]
Prints a debug log. For debug options, refer to Section 5.9.4, “The DBUG Package”.打印调试日志。有关调试选项,请参阅第5.9.4节,“DBUG包”。
ibd2sdi --debug=d:t /tmp/ibd2sdi.trace
This option is available only if MySQL was built using 仅当MySQL使用WITH_DEBUG
. MySQL release binaries provided by Oracle are not built using this option.WITH_DEBUG
构建时,此选项才可用。Oracle提供的MySQL发布二进制文件不是使用此选项构建的。
--dump-file=
, -d
Dumps serialized dictionary information (SDI) into the specified dump file. If a dump file is not specified, the tablespace SDI is dumped to 将序列化词典信息(SDI)转储到指定的转储文件中。如果未指定转储文件,则表空间SDI将转储到stdout
.stdout
。
ibd2sdi --dump-file=file_name
../data/test/t1.ibd
--skip-data
, -s
Skips retrieval of 跳过从序列化字典信息(SDI)中检索data
field values from the serialized dictionary information (SDI) and only retrieves the id
and type
field values, which are primary keys for SDI records.data
字段值,只检索id
和type
字段值,这是SDI记录的主键。
shell> ibd2sdi --skip-data ../data/test/t1.ibd
["ibd2sdi"
,
{
"type": 1,
"id": 330
}
,
{
"type": 2,
"id": 7
}
]
--id=
, #
-i
#
Retrieves serialized dictionary information (SDI) matching the specified table or tablespace object id. 检索与指定表或表空间对象id匹配的序列化词典信息(SDI)。An object id is unique to the object type. 对象id对于对象类型是唯一的。Table and tablespace object IDs are also found in the 表和表空间对象id
column of the mysql.tables
and mysql.tablespace
data dictionary tables. id
也可以在mysql.tables
和mysql.tablespace
数据字典表的id列中找到。For information about data dictionary tables, see Section 14.1, “Data Dictionary Schema”.有关数据字典表的信息,请参阅第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
#
Retrieves serialized dictionary information (SDI) matching the specified object type. SDI is provided for table (type=1) and tablespace (type=2) objects.检索与指定对象类型匹配的序列化词典信息(SDI)。SDI是为表(类型=1)和表空间(类型=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
Specifies a strict checksum algorithm for validating the checksum of pages that are read. Options include 指定严格的校验和算法,用于验证读取的页面的校验和。选项包括innodb
, crc32
, and none
.InnoDB
、crc32
和none
。
In this example, the strict version of the 在这个例子中,指定了innodb
checksum algorithm is specified:InnoDB
校验和算法的严格版本:
ibd2sdi --strict-check=innodb ../data/test/t1.ibd
In this example, the strict version of 在这个例子中,指定了crc32
checksum algorithm is specified:crc32
校验和算法的严格版本:
ibd2sdi -c crc32 ../data/test/t1.ibd
If you do not specify the 如果不指定--strict-check
option, validation is performed against non-strict innodb
, crc32
and none
checksums.--strict-check
选项,则对非严格InnoDB
、crc32
和none
校验和执行验证。
--no-check
, -n
Skips checksum validation for pages that are read.跳过已读取页面的校验和验证。
ibd2sdi --no-check ../data/test/t1.ibd
--pretty
, -p
Outputs SDI data in JSON pretty print format. Enabled by default. If disabled, SDI is not human readable but is smaller in size. Use 以JSON格式输出SDI数据。默认情况下启用。如果禁用,SDI不是人类可读的,但尺寸较小。使用--skip-pretty
to disable.--skip-pretty
禁用。
ibd2sdi --skip-pretty ../data/test/t1.ibd