Giter VIP home page Giter VIP logo

Comments (5)

ddcw avatar ddcw commented on August 31, 2024

5.6只测试过最新版的, 低版本如果确认存在死循环的话, 可以强制解析ibd文件,(一页一页的解析,就不存在死循环问题了). 可参考如下shell:

filename="/tmp/ddcw_alltype_table.ibd" # 要解析的ibd文件名
# python3 main.py ${filename} --ddl # 获取表结构信息
filesize=`stat -c %s ${filename}`
maxpagecount=$[ ${filesize} / 16384 ]
current_page=1
while [ ${current_page} -le ${maxpagecount} ];do
        echo "-- ${filename} PAGE NO: ${current_page}";
        current_page=$[ ${current_page} + 1 ]
        python3 main.py ${filename} --sql --page-start ${current_page} --page-count 1 --sdi-table=xxx.ibd --mysql5  2>/dev/null ;
done

from ibd2sql.

hhkens avatar hhkens commented on August 31, 2024

大佬 调用 shell 强制解析 来执行 python 对性能的影响是否会比较大呢
我有一个 40G 的 ibd 文件 解析了好几天都没有完成,后来用 shell 分段解析的, 但是对于 CPU 核心较少的机器 可能需要解析很久
有没有可能将这个功能写进项目中,这样直接用 python 是不是会快一点

from ibd2sql.

ddcw avatar ddcw commented on August 31, 2024
  1. 调用shell强制解析对IO压力比较大(很多重复读).
  2. 搭配shell可以实现并发解析. 但对于CPU较少的机器不友好.
  3. 下个大版本会加入并发功能(更好的利用IO),并移除部分调试功能(已经没有存在的必要了).
  4. 做好备份, 优先使用备份做恢复.

大佬 调用 shell 强制解析 来执行 python 对性能的影响是否会比较大呢 我有一个 40G 的 ibd 文件 解析了好几天都没有完成,后来用 shell 分段解析的, 但是对于 CPU 核心较少的机器 可能需要解析很久 有没有可能将这个功能写进项目中,这样直接用 python 是不是会快一点

from ibd2sql.

hhkens avatar hhkens commented on August 31, 2024

在一个,对于正常的表来讲,可以使用 dbsake + 释放表空间的方式导入表
只有坏表才会使用工具来解析 SQL
我建议开发的重点应该放在 针对 mysql 5/8 的针对坏表的数据提取上
加强对于 5.7 的支持 毕竟生产还是 5.7 比较多

from ibd2sql.

ddcw avatar ddcw commented on August 31, 2024
  1. 要检查坏块的话, 可使用如下代码得到坏块信息.
import os
filename = "/data/mysql_3314/mysqldata/db1/t20240605.ibd"
with open(filename,'rb') as f:
	for pageno in range(int(os.stat(filename).st_size/16384)):
		data = f.read(16384)
		if data[:4] != data[-8:-4]:
			print('坏块:',pageno)
  1. 5.7的场景还可以使用undrop-for-innodb
  2. 坏块能解析多少数据得看运气...(存在坏块的ibd的正常页肯定是能解析的). 解析指定页的功能也会保留.

在一个,对于正常的表来讲,可以使用 dbsake + 释放表空间的方式导入表 只有坏表才会使用工具来解析 SQL 我建议开发的重点应该放在 针对 mysql 5/8 的针对坏表的修复上 加强对于 5.7 的支持 毕竟生产还是 5.7 比较多

from ibd2sql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.