开发者

export a large db with terabytes of data

what's the best way to dump a large(terabytes) db? are there other faster/efficient way besides mysqldump? this is intended to be zipped, unzipped, and then reimported into another mysql d开发者_Go百科b on another server.


If it's possible for you to stop the database server, the best way is probably for you to:

  • Stop the database
  • Do a file copy of the files (including appropriate transaction logs, etc) to a new file system.
  • Restart the database.

Then move the copied files to the new server and bring up the database on top of the files. It's a bit complicated to do this, but it's by far the fastest way.

I used to be a DBA for a terabyte+ database in MySQL and this is one of the ways we'd do nightly backups of the database. mysqldump would've never worked for data that large. We'd stop the database each night and file copy the underlying files.


Since your intent seems to be having two copies of the DB, why not set up replication to do this?

That will ensure that both copies of the DB remain in an identical state (in terms of data anyway).

And, if you want a snapshot to be exported, you can:

  • wait for a quiet time.
  • disable replication.
  • back up the slave copy.
  • re-enable replication.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜