昨天晚上接到一个网络服务请求,由于不小心点击了自己产品软件上面的清空数据功能(这个工具确实需要小心,在Oracle恢复案例中,也有xx企业erp该功能导致数据被删除请求恢复),导致MySQL数据库被直接drop database掉了,之前没有做任何备份,只是发生故障之后,他们立即封存现场,备份出来了ibdata1文件。接到请求之后,通过让其把ibdata1文件发给过来,通过MySQL recovery工具进行分析恢复,经过6个小时的处理,基本上实现核心数据0丢失.
解析ibdata1(innodb文件)
[root@localhost recovery_MySQL]# ./stream_parser -f /tmp/ibdata1
Opening file: /tmp/ibdata1
File information:
ID of device containing file: 2055
inode number: 97257
protection: 100644 (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: 36920
Opening file: /tmp/ibdata1
time of last access: 1440083236 Thu Aug 20 23:07:16 2015
File information:
time of last modification: 1440062236 Thu Aug 20 17:17:16 2015
time of last status change: 1440081904 Thu Aug 20 22:45:04 2015
ID of device containing file: 2055
inode number: 97257
protection: 100644 total size, in bytes: 18874368 (18.000 MiB)
(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: 36920
Size to process: 18874368 (18.000 MiB)
Opening file: /tmp/ibdata1
File information:
ID of device containing file: 2055
inode number: 97257
protection: 100644 (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: 36920
time of last access: 1440083236 Thu Aug 20 23:07:16 2015
time of last modification: 1440062236 Thu Aug 20 17:17:16 2015
time of last status change: 1440081904 Thu Aug 20 22:45:04 2015
total size, in bytes: 18874368 (18.000 MiB)
Opening file: /tmp/ibdata1
File information:
Size to process: 18874368 (18.000 MiB)
ID of device containing file: 2055
inode number: 97257
protection: 100644 (regular file)
time of last access: 1440083236 Thu Aug 20 23:07:16 2015
number of hard links: 1
user ID of owner: 0
time of last modification: 1440062236 Thu Aug 20 17:17:16 2015
group ID of owner: 0
time of last status change: 1440081904 Thu Aug 20 22:45:04 2015
device ID (if special file): 0
blocksize for filesystem I/O: 4096
number of blocks allocated: 36920
total size, in bytes: 18874368 (18.000 MiB)
Size to process: 18874368 (18.000 MiB)
Opening file: /tmp/ibdata1
File information:
ID of device containing file: 2055
inode number: 97257
protection: 100644 (regular file)
number of hard links: 1
user ID of owner: 0
time of last access: 1440083236 Thu Aug 20 23:07:16 2015
group ID of owner: 0
device ID (if special file): 0
time of last modification: 1440062236 Thu Aug 20 17:17:16 2015
blocksize for filesystem I/O: 4096
time of last status change: 1440081904 Thu Aug 20 22:45:04 2015
number of blocks allocated: 36920
Opening file: /tmp/ibdata1
total size, in bytes: 18874368 (18.000 MiB)
File information:
Size to process: 18874368 (18.000 MiB)
ID of device containing file: 2055
inode number: 97257
protection: 100644 (regular file)
number of hard links: 1
user ID of owner: 0
group ID of owner: 0
device ID (if special file): 0
time of last access: 1440083236 Thu Aug 20 23:07:16 2015
blocksize for filesystem I/O: 4096
time of last modification: 1440062236 Thu Aug 20 17:17:16 2015
number of blocks allocated: 36920
time of last status change: 1440081904 Thu Aug 20 22:45:04 2015
Opening file: /tmp/ibdata1
total size, in bytes: 18874368 (18.000 MiB)
File information:
Size to process: 18874368 (18.000 MiB)
ID of device containing file: 2055
inode number: 97257
protection: 100644 (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 fil