1IBD2SDI(1) MySQL Database System IBD2SDI(1)
2
3
4
6 ibd2sdi - InnoDB utility for extracting serialized dictionary
7 information (SDI) from an InnoDB tablespace
8
10 ibd2sdi [options] file_name1 [file_name2 file_name3 ...]
11
13 ibd2sdi is a utility for extracting serialized dictionary information
14 (SDI) from InnoDB tablespace files. SDI data is present in all
15 persistent InnoDB tablespace files.
16
17 ibd2sdi can be run on file-per-table tablespace files (*.ibd files),
18 general tablespace files (*.ibd files), system tablespace files
19 (ibdata* files), and the data dictionary tablespace (mysql.ibd). It is
20 not supported for use with temporary tablespaces or undo tablespaces.
21
22 ibd2sdi can be used at runtime or while the server is offline. During
23 DDL operations, ROLLBACK operations, and undo log purge operations
24 related to SDI, there may be a short interval of time when ibd2sdi
25 fails to read SDI data stored in the tablespace.
26
27 ibd2sdi performs an uncommitted read of SDI from the specified
28 tablespace. Redo logs and undo logs are not accessed.
29
30 Invoke the ibd2sdi utility like this:
31
32 ibd2sdi [options] file_name1 [file_name2 file_name3 ...]
33
34 ibd2sdi supports multi-file tablespaces like the InnoDB system
35 tablespace, but it cannot be run on more than one tablespace at a time.
36 For multi-file tablespaces, specify each file:
37
38 ibd2sdi ibdata1 ibdata2
39
40 The files of a multi-file tablespace must be specified in order of the
41 ascending page number. If two successive files have the same space ID,
42 the later file must start with the last page number of the previous
43 file + 1.
44
45 ibd2sdi outputs SDI (containing id, type, and data fields) in JSON
46 format. ibd2sdi Options
47
48 ibd2sdi supports the following options:
49
50 • --help, -h Display a help message and exit. For example:
51
52 Usage: ./ibd2sdi [-v] [-c <strict-check>] [-d <dump file name>] [-n] filename1 [filenames]
53 See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
54 -h, --help Display this help and exit.
55 -v, --version Display version information and exit.
56 -#, --debug[=name] Output debug log. See
57 http://dev.mysql.com/doc/refman/8.0/en/dbug-package.html
58 -d, --dump-file=name
59 Dump the tablespace SDI into the file passed by user.
60 Without the filename, it will default to stdout
61 -s, --skip-data Skip retrieving data from SDI records. Retrieve only id
62 and type.
63 -i, --id=# Retrieve the SDI record matching the id passed by user.
64 -t, --type=# Retrieve the SDI records matching the type passed by
65 user.
66 -c, --strict-check=name
67 Specify the strict checksum algorithm by the user.
68 Allowed values are innodb, crc32, none.
69 -n, --no-check Ignore the checksum verification.
70 -p, --pretty Pretty format the SDI output.If false, SDI would be not
71 human readable but it will be of less size
72 (Defaults to on; use --skip-pretty to disable.)
73 Variables (--variable-name=value)
74 and boolean options {FALSE|TRUE} Value (after reading options)
75 --------------------------------- ----------------------------------------
76 debug (No default value)
77 dump-file (No default value)
78 skip-data FALSE
79 id 0
80 type 0
81 strict-check crc32
82 no-check FALSE
83 pretty TRUE
84
85 • --version, -v Display version information and exit. For example:
86
87 ibd2sdi Ver 8.0.3-dmr for Linux on x86_64 (Source distribution)
88
89 • --debug[=debug_options], -# [debug_options] Prints a debug log. For
90 debug options, refer to Section 5.9.4, “The DBUG Package”.
91
92 ibd2sdi --debug=d:t /tmp/ibd2sdi.trace
93
94 This option is available only if MySQL was built using WITH_DEBUG.
95 MySQL release binaries provided by Oracle are not built using this
96 option.
97
98 • --dump-file=, -d Dumps serialized dictionary information (SDI) into
99 the specified dump file. If a dump file is not specified, the
100 tablespace SDI is dumped to stdout.
101
102 ibd2sdi --dump-file=file_name ../data/test/t1.ibd
103
104 • --skip-data, -s Skips retrieval of data field values from the
105 serialized dictionary information (SDI) and only retrieves the id
106 and type field values, which are primary keys for SDI records.
107
108 $> ibd2sdi --skip-data ../data/test/t1.ibd
109 ["ibd2sdi"
110 ,
111 {
112 "type": 1,
113 "id": 330
114 }
115 ,
116 {
117 "type": 2,
118 "id": 7
119 }
120 ]
121
122 • --id=#, -i # Retrieves serialized dictionary information (SDI)
123 matching the specified table or tablespace object id. An object id
124 is unique to the object type. Table and tablespace object IDs are
125 also found in the id column of the mysql.tables and
126 mysql.tablespace data dictionary tables. For information about data
127 dictionary tables, see Section 14.1, “Data Dictionary Schema”.
128
129 $> ibd2sdi --id=7 ../data/test/t1.ibd
130 ["ibd2sdi"
131 ,
132 {
133 "type": 2,
134 "id": 7,
135 "object":
136 {
137 "mysqld_version_id": 80003,
138 "dd_version": 80003,
139 "sdi_version": 1,
140 "dd_object_type": "Tablespace",
141 "dd_object": {
142 "name": "test/t1",
143 "comment": "",
144 "options": "",
145 "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
146 "engine": "InnoDB",
147 "files": [
148 {
149 "ordinal_position": 1,
150 "filename": "./test/t1.ibd",
151 "se_private_data": "id=2;"
152 }
153 ]
154 }
155 }
156 }
157 ]
158
159 • --type=#, -t # Retrieves serialized dictionary information (SDI)
160 matching the specified object type. SDI is provided for table
161 (type=1) and tablespace (type=2) objects.
162
163 This example show output for a tablespace ts1 in the test database:
164
165 $> ibd2sdi --type=2 ../data/test/ts1.ibd
166 ["ibd2sdi"
167 ,
168 {
169 "type": 2,
170 "id": 7,
171 "object":
172 {
173 "mysqld_version_id": 80003,
174 "dd_version": 80003,
175 "sdi_version": 1,
176 "dd_object_type": "Tablespace",
177 "dd_object": {
178 "name": "test/ts1",
179 "comment": "",
180 "options": "",
181 "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
182 "engine": "InnoDB",
183 "files": [
184 {
185 "ordinal_position": 1,
186 "filename": "./test/ts1.ibd",
187 "se_private_data": "id=2;"
188 }
189 ]
190 }
191 }
192 }
193 ]
194
195 Due to the way in which InnoDB handles default value metadata, a
196 default value may be present and non-empty in ibd2sdi output for a
197 given table column even if it is not defined using DEFAULT.
198 Consider the two tables created using the following statements, in
199 the database named i:
200
201 CREATE TABLE t1 (c VARCHAR(16) NOT NULL);
202 CREATE TABLE t2 (c VARCHAR(16) NOT NULL DEFAULT "Sakila");
203
204 Using ibd2sdi, we can see that the default_value for column c is
205 nonempty and is in fact padded to length in both tables, like this:
206
207 $> ibd2sdi ../data/i/t1.ibd | grep -m1 '\"default_value\"' | cut -b34- | sed -e s/,//
208 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAA="
209 $> ibd2sdi ../data/i/t2.ibd | grep -m1 '\"default_value\"' | cut -b34- | sed -e s/,//
210 "BlNha2lsYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAA="
211
212 Examination of ibd2sdi output may be easier using a JSON-aware
213 utility like jq[1], as shown here:
214
215 $> ibd2sdi ../data/i/t1.ibd | jq '.[1]["object"]["dd_object"]["columns"][0]["default_value"]'
216 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAA="
217 $> ibd2sdi ../data/i/t2.ibd | jq '.[1]["object"]["dd_object"]["columns"][0]["default_value"]'
218 "BlNha2lsYQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAA="
219
220 For more information, see the MySQL Internals documentation[2].
221
222 • --strict-check, -c Specifies a strict checksum algorithm for
223 validating the checksum of pages that are read. Options include
224 innodb, crc32, and none.
225
226 In this example, the strict version of the innodb checksum
227 algorithm is specified:
228
229 ibd2sdi --strict-check=innodb ../data/test/t1.ibd
230
231 In this example, the strict version of crc32 checksum algorithm is
232 specified:
233
234 ibd2sdi -c crc32 ../data/test/t1.ibd
235
236 If you do not specify the --strict-check option, validation is
237 performed against non-strict innodb, crc32 and none checksums.
238
239 • --no-check, -n Skips checksum validation for pages that are read.
240
241 ibd2sdi --no-check ../data/test/t1.ibd
242
243 • --pretty, -p Outputs SDI data in JSON pretty print format. Enabled
244 by default. If disabled, SDI is not human readable but is smaller
245 in size. Use --skip-pretty to disable.
246
247 ibd2sdi --skip-pretty ../data/test/t1.ibd
248
250 Copyright © 1997, 2023, Oracle and/or its affiliates.
251
252 This documentation is free software; you can redistribute it and/or
253 modify it only under the terms of the GNU General Public License as
254 published by the Free Software Foundation; version 2 of the License.
255
256 This documentation is distributed in the hope that it will be useful,
257 but WITHOUT ANY WARRANTY; without even the implied warranty of
258 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
259 General Public License for more details.
260
261 You should have received a copy of the GNU General Public License along
262 with the program; if not, write to the Free Software Foundation, Inc.,
263 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
264 http://www.gnu.org/licenses/.
265
266
268 1. jq
269 https://stedolan.github.io/jq/
270
271 2. MySQL Internals documentation
272 https://dev.mysql.com/doc/dev/
273
275 For more information, please refer to the MySQL Reference Manual, which
276 may already be installed locally and which is also available online at
277 http://dev.mysql.com/doc/.
278
280 Oracle Corporation (http://dev.mysql.com/).
281
282
283
284MySQL 8.0 08/31/2023 IBD2SDI(1)