-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 5.6.16提取 sql 时 死循环了 #30
Comments
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
|
大佬 调用 shell 强制解析 来执行 python 对性能的影响是否会比较大呢 |
|
在一个,对于正常的表来讲,可以使用 dbsake + 释放表空间的方式导入表 |
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)
|
No description provided.
The text was updated successfully, but these errors were encountered: