如何从此ID中恢复fike基础? MySQL数据恢复

时间:2016-06-20 13:53:11

标签: mysql linux innodb disaster-recovery

我现在真的很困惑,我怎样才能从ibdata1获取当前结果的正确页码。大多数文档,包括和指示这样做:

With this monitor enabled, we had to look at the MySQL error log (/var/log/mysql/error.log) in order to locate the page index of our corrupted table:

TABLE: name database/sp_account, id 0 85, columns 23, indexes 2, appr.rows 220
...
INDEX: name PRIMARY, id 0 215, fields 1/22, uniq 1, type 3
root page 401, appr.key vals 220, leaf pages 3, size pages 4
...
In this output, it shows that we have to look at the page located in the 0-215 subdirectory of our extracted pages (ie pages-1328713071/FIL_PAGE_INDEX/0-215/).

Then, we had to merge the pages files into one:

find pages-1328713071/FIL_PAGE_INDEX/0-215/ -type f -name '*.page' | sort -n | xargs cat > merged_file

但是,我在这里有这个:


TABLE: name db/tablename, id 512, flags 29, columns 16, indexes 9, appr.rows 0
  COLUMNS: id: DATA_INT DATA_BINARY_TYPE DATA_NOT_NULL len 4; createdAt: DATA_FIXBINARY DATA_BINARY_TYPE len 5; updatedAt: DATA_FIXBINARY DATA_BINARY_TYPE len 5; nid: DATA_VARMYSQL len 765; ngroup: DATA_VARMYSQL len 765; tour: DATA_VARMYSQL len 765; value: DATA_VARMYSQL len 765; action: DATA_VARMYSQL len 765; IPAddress: DATA_VARMYSQL len 765; browser: DATA_VARMYSQL len 765; isMonitoring: DATA_INT DATA_BINARY_TYPE len 1; isEmbedded: DATA_INT DATA_BINARY_TYPE len 1; companyId: DATA_INT DATA_BINARY_TYPE len 4; DB_ROW_ID: DATA_SYS prtype 256 len 6; DB_TRX_ID: DATA_SYS prtype 257 len 6; DB_ROLL_PTR: DATA_SYS prtype 258 len 7;
  INDEX: name PRIMARY, id 586, fields 1/15, uniq 1, type 3
   root page 3, appr.key vals 100, leaf pages 1, size pages 1

如果您注意到差异,那么文档中第一个的PRIMARY KEY id值是id 0 215,在我的结果中的结果只有这个id 586。

请帮助我,任何帮助都非常非常感谢。

干杯,

2 个答案:

答案 0 :(得分:0)

为什么FIL_PAGE_INDEX为空?甚至.ibd文件的大小几乎是14GB?

打开文件:/home/data/mysql/mysql-data/nickelled/Tracking.ibd 文件信息:

ID of device containing file:        64770
inode number:                      3932162
protection:                         100640 (regular file)
number of hard links:                    1
user ID of owner:                        0
group ID of owner:                       0
device ID (if special file):             0
blocksize for filesystem I/O:         4096
number of blocks allocated:       28860440

打开文件:/home/data/mysql/mysql-data/nickelled/Tracking.ibd 文件信息:

time of last access:            1466763875 Fri Jun 24 06:24:35 2016
time of last modification:      1465757623 Sun Jun 12 14:53:43 2016
time of last status change:     1466770800 Fri Jun 24 08:20:00 2016
ID of device containing file:        64770
inode number:                      3932162
protection:                         100640 (regular file)
total size, in bytes:          14776532992 (13.762 GiB)

number of hard links:                    1
user ID of owner:                        0
group ID of owner:                       0
device ID (if special file):             0
blocksize for filesystem I/O:         4096
number of blocks allocated:       28860440
Size to process:               14776532992 (13.762 GiB)
time of last access:            1466763875 Fri Jun 24 06:24:35 2016
time of last modification:      1465757623 Sun Jun 12 14:53:43 2016
time of last status change:     1466770800 Fri Jun 24 08:20:00 2016
total size, in bytes:          14776532992 (13.762 GiB)

Size to process:               14776532992 (13.762 GiB)
Worker(0): 1.70% done. 2016-06-24 08:31:14 ETA(in 00:01:01). Processing speed: 111.781 MiB/sec
Worker(1): 1.93% done. 2016-06-24 08:31:07 ETA(in 00:00:54). Processing speed: 127.750 MiB/sec
Worker(0): 3.63% done. 2016-06-24 08:31:04 ETA(in 00:00:50). Processing speed: 135.734 MiB/sec
Worker(1): 4.08% done. 2016-06-24 08:30:58 ETA(in 00:00:44). Processing speed: 151.703 MiB/sec
Worker(1): 6.12% done. 2016-06-24 08:31:01 ETA(in 00:00:46). Processing speed: 143.719 MiB/sec
Worker(0): 5.67% done. 2016-06-24 08:31:01 ETA(in 00:00:46). Processing speed: 143.719 MiB/sec
Worker(1): 7.93% done. 2016-06-24 08:31:06 ETA(in 00:00:50). Processing speed: 127.750 MiB/sec
Worker(0): 7.71% done. 2016-06-24 08:31:01 ETA(in 00:00:45). Processing speed: 143.719 MiB/sec
Worker(1): 10.66% done. 2016-06-24 08:30:49 ETA(in 00:00:32). Processing speed: 191.844 MiB/sec
Worker(0): 9.75% done. 2016-06-24 08:31:01 ETA(in 00:00:44). Processing speed: 143.719 MiB/sec
Worker(1): 13.38% done. 2016-06-24 08:30:49 ETA(in 00:00:31). Processing speed: 192.000 MiB/sec
Worker(0): 11.67% done. 2016-06-24 08:31:03 ETA(in 00:00:45). Processing speed: 135.734 MiB/sec
Worker(1): 16.33% done. 2016-06-24 08:30:47 ETA(in 00:00:28). Processing speed: 208.000 MiB/sec
Worker(0): 13.49% done. 2016-06-24 08:31:06 ETA(in 00:00:47). Processing speed: 127.750 MiB/sec
Worker(1): 19.51% done. 2016-06-24 08:30:45 ETA(in 00:00:25). Processing speed: 224.000 MiB/sec
Worker(0): 15.41% done. 2016-06-24 08:31:03 ETA(in 00:00:43). Processing speed: 135.734 MiB/sec
Worker(1): 22.69% done. 2016-06-24 08:30:45 ETA(in 00:00:24). Processing speed: 224.000 MiB/sec
Worker(0): 17.34% done. 2016-06-24 08:31:03 ETA(in 00:00:42). Processing speed: 135.734 MiB/sec
Worker(1): 25.64% done. 2016-06-24 08:30:47 ETA(in 00:00:25). Processing speed: 208.000 MiB/sec
Worker(0): 19.26% done. 2016-06-24 08:31:03 ETA(in 00:00:41). Processing speed: 135.734 MiB/sec
Worker(0): 21.08% done. 2016-06-24 08:31:06 ETA(in 00:00:43). Processing speed: 127.750 MiB/sec
Worker(1): 28.71% done. 2016-06-24 08:30:46 ETA(in 00:00:23). Processing speed: 216.000 MiB/sec
Worker(1): 31.55% done. 2016-06-24 08:30:48 ETA(in 00:00:24). Processing speed: 200.000 MiB/sec
Worker(0): 23.00% done. 2016-06-24 08:31:03 ETA(in 00:00:39). Processing speed: 135.734 MiB/sec
Worker(0): 24.82% done. 2016-06-24 08:31:06 ETA(in 00:00:41). Processing speed: 127.750 MiB/sec
Worker(1): 34.50% done. 2016-06-24 08:30:47 ETA(in 00:00:22). Processing speed: 208.000 MiB/sec
Worker(1): 37.45% done. 2016-06-24 08:30:47 ETA(in 00:00:21). Processing speed: 208.000 MiB/sec
Worker(0): 26.86% done. 2016-06-24 08:31:01 ETA(in 00:00:35). Processing speed: 143.719 MiB/sec
Worker(1): 40.40% done. 2016-06-24 08:30:47 ETA(in 00:00:20). Processing speed: 208.000 MiB/sec
Worker(0): 28.78% done. 2016-06-24 08:31:03 ETA(in 00:00:36). Processing speed: 135.734 MiB/sec
Worker(1): 44.15% done. 2016-06-24 08:30:42 ETA(in 00:00:14). Processing speed: 264.000 MiB/sec
Worker(0): 30.82% done. 2016-06-24 08:31:01 ETA(in 00:00:33). Processing speed: 143.719 MiB/sec
Worker(0): 32.64% done. 2016-06-24 08:31:06 ETA(in 00:00:37). Processing speed: 127.750 MiB/sec
Worker(1): 47.21% done. 2016-06-24 08:30:46 ETA(in 00:00:17). Processing speed: 216.000 MiB/sec
Worker(0): 34.56% done. 2016-06-24 08:31:03 ETA(in 00:00:33). Processing speed: 135.734 MiB/sec
Worker(1): 50.28% done. 2016-06-24 08:30:46 ETA(in 00:00:16). Processing speed: 216.000 MiB/sec
Worker(1): 53.57% done. 2016-06-24 08:30:45 ETA(in 00:00:14). Processing speed: 232.000 MiB/sec
Worker(0): 36.49% done. 2016-06-24 08:31:03 ETA(in 00:00:32). Processing speed: 135.734 MiB/sec
Worker(0): 38.30% done. 2016-06-24 08:31:06 ETA(in 00:00:34). Processing speed: 127.750 MiB/sec
Worker(1): 56.75% done. 2016-06-24 08:30:45 ETA(in 00:00:13). Processing speed: 224.000 MiB/sec
Worker(1): 59.59% done. 2016-06-24 08:30:47 ETA(in 00:00:14). Processing speed: 200.000 MiB/sec
Worker(0): 40.23% done. 2016-06-24 08:31:04 ETA(in 00:00:31). Processing speed: 135.734 MiB/sec
Worker(1): 62.43% done. 2016-06-24 08:30:47 ETA(in 00:00:13). Processing speed: 200.000 MiB/sec
Worker(0): 42.04% done. 2016-06-24 08:31:05 ETA(in 00:00:31). Processing speed: 127.750 MiB/sec
Worker(0): 43.97% done. 2016-06-24 08:31:04 ETA(in 00:00:29). Processing speed: 135.734 MiB/sec
Worker(1): 65.27% done. 2016-06-24 08:30:47 ETA(in 00:00:12). Processing speed: 200.000 MiB/sec
Worker(1): 68.45% done. 2016-06-24 08:30:45 ETA(in 00:00:09). Processing speed: 224.000 MiB/sec
Worker(0): 46.46% done. 2016-06-24 08:30:57 ETA(in 00:00:21). Processing speed: 175.656 MiB/sec
Worker(0): 48.84% done. 2016-06-24 08:30:58 ETA(in 00:00:21). Processing speed: 167.672 MiB/sec
Worker(1): 71.51% done. 2016-06-24 08:30:46 ETA(in 00:00:09). Processing speed: 216.000 MiB/sec
Worker(1): 74.46% done. 2016-06-24 08:30:46 ETA(in 00:00:08). Processing speed: 208.000 MiB/sec
Worker(0): 51.33% done. 2016-06-24 08:30:57 ETA(in 00:00:19). Processing speed: 175.656 MiB/sec
Worker(1): 77.53% done. 2016-06-24 08:30:46 ETA(in 00:00:07). Processing speed: 216.000 MiB/sec
Worker(0): 53.94% done. 2016-06-24 08:30:56 ETA(in 00:00:17). Processing speed: 183.641 MiB/sec
Worker(1): 80.60% done. 2016-06-24 08:30:46 ETA(in 00:00:06). Processing speed: 216.000 MiB/sec
Worker(0): 56.21% done. 2016-06-24 08:30:59 ETA(in 00:00:19). Processing speed: 159.718 MiB/sec
Worker(1): 83.77% done. 2016-06-24 08:30:46 ETA(in 00:00:05). Processing speed: 224.000 MiB/sec
Worker(0): 58.70% done. 2016-06-24 08:30:57 ETA(in 00:00:16). Processing speed: 175.703 MiB/sec
Worker(0): 60.85% done. 2016-06-24 08:31:00 ETA(in 00:00:18). Processing speed: 151.703 MiB/sec
Worker(1): 87.64% done. 2016-06-24 08:30:45 ETA(in 00:00:03). Processing speed: 272.000 MiB/sec
Worker(1): 90.47% done. 2016-06-24 08:30:46 ETA(in 00:00:03). Processing speed: 200.000 MiB/sec
Worker(0): 62.89% done. 2016-06-24 08:31:01 ETA(in 00:00:18). Processing speed: 143.719 MiB/sec
Worker(1): 93.65% done. 2016-06-24 08:30:45 ETA(in 00:00:01). Processing speed: 224.000 MiB/sec
Worker(0): 65.16% done. 2016-06-24 08:30:59 ETA(in 00:00:15). Processing speed: 159.688 MiB/sec
Worker(1): 96.60% done. 2016-06-24 08:30:46 ETA(in 00:00:01). Processing speed: 208.000 MiB/sec
Worker(0): 67.31% done. 2016-06-24 08:31:00 ETA(in 00:00:15). Processing speed: 151.703 MiB/sec
Worker(1): 99.67% done. 2016-06-24 08:30:46 ETA(in 00:00:00). Processing speed: 216.000 MiB/sec
Worker(0): 69.35% done. 2016-06-24 08:31:01 ETA(in 00:00:15). Processing speed: 143.719 MiB/sec
Worker(0): 72.41% done. 2016-06-24 08:30:56 ETA(in 00:00:09). Processing speed: 215.578 MiB/sec
Worker(0): 76.38% done. 2016-06-24 08:30:53 ETA(in 00:00:05). Processing speed: 279.453 MiB/sec
Worker(0): 80.91% done. 2016-06-24 08:30:53 ETA(in 00:00:04). Processing speed: 319.375 MiB/sec
Worker(0): 84.20% done. 2016-06-24 08:30:54 ETA(in 00:00:04). Processing speed: 231.547 MiB/sec
Worker(0): 87.03% done. 2016-06-24 08:30:55 ETA(in 00:00:04). Processing speed: 199.609 MiB/sec
Worker(0): 90.66% done. 2016-06-24 08:30:54 ETA(in 00:00:02). Processing speed: 255.500 MiB/sec
Worker(0): 94.51% done. 2016-06-24 08:30:54 ETA(in 00:00:01). Processing speed: 271.469 MiB/sec
Worker(0): 98.36% done. 2016-06-24 08:30:54 ETA(in 00:00:00). Processing speed: 271.469 MiB/sec

所有工人在42秒内完成

<pre>[root@cos6PXE undrop-for-innodb-master]# cd pages-Tracking.ibd/FIL_PAGE_INDEX/
[root@cos6PXE FIL_PAGE_INDEX]# ll
total 0 <pre/>

我无法使用twindb工具继续恢复数据,因为它完全是空的。

答案 1 :(得分:0)

因为来自undrop-for-innodb的stream_parser不支持压缩表空间。您应该使用https://code.launchpad.net/~akuzminsky/percona-data-recovery-tool-for-innodb/decompress

中的page_parser