Taking Physical Backups for MySQL
Taking Physical Backups for MySQL
In that scenario, you have probably used mysqldump or Percona XtraBackup to accomplish the task – the mysqldump client is a backup app written by Igor Romanenko, it is mostly used to dump a database or a set of databases for backup procedures or transferring into another database server. Percona XtraBackup on the other hand is based on InnoDB’s crash-recovery functionality.
Physical Backups:-
As already mentioned above, physical backups backup data at a system level. In general, physical backups can be taken by following these steps:
- Shut down the MySQL server – make sure to perform a clean shutdown (also known as a slow shutdown) – such a shutdown operation performs additional InnoDB flushing operations before completing. Simply specify the parameter innodb_fast_shutdown=0 in your my.cnf file or run the query SET GLOBAL innodb_fast_shutdown=0; – the value of innodb_fast_shutdown determines whether the backup operation is slow or fast: 0 performs a slow shutdown, 1 performs a fast shutdown. With a value of 2 InnoDB will shut down as if MySQL had crashed – recovery time is often slower when a value of 2 is in use.
- Back up all files related to InnoDB (ibdata, .ibd, .frm, also the ib_logfile* files).
- Back up the contents of your my.cnf configuration file.
Physical backups are typically faster than logical backups because they only involve file copying.
Comments
Post a Comment