mysql生成在线数据字典_mysql生成数据字典

git clone https://github.com/twindb/undrop-for-innodb.git

make

2b65ef29a5872cc0e4771c25889edd04.gif

6a087676c59fa8b19d76e6bb55a32902.gif

[[email protected] undrop-for-innodb]# make

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c stream_parser.c

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -pthread -lm stream_parser.o -o stream_parser

flex sql_parser.l

sql_parser.l:66: warning, the character range [-Y] is ambiguous in a case-insensitive scanner

sql_parser.l:66: warning, the character range [a] is ambiguous in a case-insensitive scanner

bison-o sql_parser.c sql_parser.y

sql_parser.y: conflicts:6 shift/reduce

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c sql_parser.c

lex.yy.c:3430: warning: ‘yyunput’ defined but not used

lex.yy.c:3471: warning: ‘input’ defined but not used

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c c_parser.c

./include/ctype-latin1.c:359: warning: ‘my_mb_wc_latin1’ defined but not used

./include/ctype-latin1.c:372: warning: ‘my_wc_mb_latin1’ defined but not used

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c tables_dict.c

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c print_data.c

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -c check_data.c

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include sql_parser.o c_parser.o tables_dict.o print_data.o check_data.o -o c_parser -pthread -lm

cc-D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -I./include -o innochecksum_changer innochecksum.c

View Code

创建恢复数据库

create database recovery;

抽取数据字典

create database recovery;

./stream_parser -f /data/mysql//ibdata1

mkdir -p dumps/default

./c_parser -6f pages-ibdata1/FIL_PAGE_INDEX/0000000000000001.page -t dictionary/SYS_TABLES.sql > dumps/default/SYS_TABLES 2> dumps/default/SYS_TABLES.sql

./c_parser -6f pages-ibdata1/FIL_PAGE_INDEX/0000000000000003.page -t dictionary/SYS_INDEXES.sql > dumps/default/SYS_INDEXES 2> dumps/default/SYS_INDEXES.sql

加载数据

mysql -u root -p recovery < dictionary/SYS_TABLES.sql

mysql -u root -p recovery < dictionary/SYS_INDEXES.sql

mysql -u root -p recovery < dumps/default/SYS_TABLES.sql

mysql -u root -p recovery < dumps/default/SYS_INDEXES.sql

查看数据信息

mysql> select * from SYS_TABLES where name like ‘%tb%‘;+-------+----+--------+------+--------+---------+--------------+-------+

| NAME | ID | N_COLS | TYPE | MIX_ID | MIX_LEN | CLUSTER_NAME | SPACE |

+-------+----+--------+------+--------+---------+--------------+-------+

| ht/tb | 40 | 2 | 33 | 0 | 80 | | 23 |

+-------+----+--------+------+--------+---------+--------------+-------+

1 row in set (0.00sec)

mysql> select * from SYS_INDEXES where table_id=40;+----------+----+---------+----------+------+-------+---------+

| TABLE_ID | ID | NAME | N_FIELDS | TYPE | SPACE | PAGE_NO |

+----------+----+---------+----------+------+-------+---------+

| 40 | 41 | PRIMARY | 1 | 3 | 23 | 3 |

+----------+----+---------+----------+------+-------+---------+

1 row in set (0.00 sec)

原文:https://www.cnblogs.com/omsql/p/9253234.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值