In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In daily work, we often encounter the migration of large historical tables from the main database to the backup machine to free up the main database space. If you directly drop table, it may cause database jitter, increase in the number of connections and other problems, thus affecting the business.
Then with a little trick, you can easily and smoothly delete the history table from the main library.
1. Create a hard link, and the "spoof" MySQL has been deleted when the drop table table is in progress.
Ln test.ibd test.ibd.hdlk
2. Do not rm test.ibd.hdlk directly at this time, which will cause the disk IO speed to rise and the MySQL performance jitter.
Here we write a script that cycles 1G at a time and hibernates for 2 seconds until it is deleted.
1) move test.ibd.hdlk to the / data/bak/ directory first
Mv test.ibd.hdlk / data/bak/
2) execute the following script:
#! / bin/bashTRUNCATE=/usr/bin/truncatefor I in `Get100-10` # decrease 1G at a time starting from 100g, and finally make the file 0do sleep 2 echo "$TRUNCATE-s ${I} G / data/bak/test.ibd.hdlk" $TRUNCATE-s ${I} G / data/bak/test.ibd.hdlkdone
Note: first ll-h test.ibd.hdlk to see how many gigabytes are in the file, and then enter seq, the above example is 100g.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.