10、MySQL 8.0参考手册 4.6.1 ibd2sdi - InnoDB Tablespace SDI抽取实用程序

ibd2sdi的英文一个用于表空间文件中提取序列化字典搜索信息(SDI)  的实用程序  InnoDBSDI存在数据于所有持久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

    指定一个严格的校验和算法来验证读取的页面的校验和。选项包括 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禁用。在MySQL 8.0.11中添加。本文由学什么技术好网翻译

    shell> ibd2sdi --skip-pretty ../data/test/t1.ibd
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
#!/bin/sh #安装插件 cd /root/mysql if test -e ./sharutils-4.6.1-2.x86_64.rpm then echo 'sharutils开始安装...' rpm -ivh sharutils-4.6.1-2.x86_64.rpm echo 'sharutils安装完成...' else echo 'sharutils文件不存在!' exit fi #安装msql8 if test -e ./mysql8.0.19_64-636.sh then if test -e ./mysql8.0.19_64-636.sh.sha256 then echo '准备安装mysql8' sh ./mysql8.0.19_64-636.sh else echo 'mysql8.sha256文件不存在!' exit fi else echo 'mysql8.sh文件不存在!' exit fi if [ $? -eq 0 ]; then echo 'mysql安装完成...' else echo 'mysql安装失败!' exit fi #执行重启不需验证 /topwalk/baseapp/bin/mysqld restart --skip_grant_tables #安装tcl sh ./tcl-install.sh if [ $? -eq 0 ]; then echo 'tcl安装完成...' else echo 'tcl安装失败!' exit fi #安装expect sh ./expect-install.sh if [ $? -eq 0 ]; then echo 'expect安装完成...' else echo 'expect安装失败!' exit fi #创建mysql用户,授权 sh ./initdb.sh if [ $? -eq 0 ]; then echo 'mysql用户创建,授权完成...' else echo 'mysql用户创建,授权失败!' exit fi ln -s /topwalk/baseapp/bin/mysqld /etc/init.d/ sed -i '/MYSQL_HOME/d' /etc/profile echo "export MYSQL_HOME=/topwalk/baseapp/mysql" >>/etc/profile echo 'export PATH=$PATH:$MYSQL_HOME/bin' >>/etc/profile systemctl enable mysqld source /etc/profile service mysqld restart #初始化库 /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 < topsql/CREATE_TOPBASIC.sql /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 < topsql/CREATE_TOPDMS.sql /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 < topsql/CREATE_TOPUIS.sql #初始化表 /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 TOPBASIC < topsql/TOPBASIC.sql /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 TOPDMS < topsql/TOPDMS.sql /topwalk/baseapp/mysql/bin/mysql -udms -ptRstOpwalkroot0823 TOPUIS < topsql/TOPUIS.sql #安装nginx cp -dpRf ./nginx /usr/local/ useradd nginx -m -d /usr/local/nginx/ -s /bin/bash chown -R nginx.nginx /usr/local/ngi
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值