MySQL Enterprise Edition Backup Tool MEB

"Workers must first sharpen their tools if they want to do well." Data backup is the daily work of the DBA, and it is also an important work to ensure data security. To complete this work perfectly, you must use an efficient and reliable backup tool. MySQL provides a backup tool in its Enterprise Edition-MySQL Enterprise Backup, referred to as MEB.

MEB is a cross-platform efficient backup tool, it supports a series of mainstream backup functions such as online "hot" backup, incremental backup, differential backup, partial backup, compressed backup, etc. While MySQL Enterprise Backup optimizes InnoDB table backup, it can also back up and restore tables created by various storage engines supported by MySQL. The reading and writing process can be performed by multiple threads independently and in parallel, and different threads can read and write different blocks of a single file, so that the backup and recovery process can be executed quickly. Compared with the logical backup tool mysqldump, it has significant performance Promote.

MySQL Enterprise Edition Backup Tool MEB

Before introducing the details of MEB, let us look at several common database backup methods.

Full backup: A full backup will back up a complete copy of the data. If you do not need to restore to a specific point in time, then only a full backup strategy can meet your needs. For example, if the data does not change frequently or is unimportant, and the loss of several days of data can be tolerated, then users can run full backups every day or even every week.

Full backup + incremental backup: Use incremental backups to supplement full backups, enabling users to run backups more frequently and reducing recovery time to within a few hours. Incremental backup does not require much disk space, so it can reduce storage requirements and costs.

Full backup + incremental backup + log: If you need to restore within a few minutes, or restore to a specific point in time, it is very appropriate to combine full backup and incremental backup with transaction log backup. You can use the backup of the transaction log to apply full backup, incremental backup, and rollforward.

MySQL Enterprise Edition Backup Tool MEB

In addition to the above methods, backup also needs to consider factors such as backup duration, recovery duration, recovery level, storage requirements, and storage limitations. After comprehensive consideration, develop a backup strategy that suits you.

MySQL Enterprise Edition Backup Tool MEB

MEB provides a command line client mysqlbackup through which all functions of MEB are executed. The function of MEB is very powerful, and the following tasks can be carried out through it:

  • Backup database: A complete backup cycle includes backup, verification and recovery. MEB supports the following types of backups:

  • Back up to a single file, support to store it on other servers, tapes, cloud storage

    • Full backup

    • Differential or incremental backup

    • Compressed backup

    • Partial backup

    • Optimistic backup

    • Backup In-memory data

    • Regular backup

    Use the validate command during backup to verify the integrity of the backup result. In addition, you can also verify the success of the backup by restoring the backup data on another server and running mysqld on the new data directory. You can then execute SHOW statements to verify the database and table structure, and execute queries to verify further details of the database. Note: Do not directly start the backup directory as a mysql data directory, it will cause data corruption!

    • Restore the database: MEB can restore the database with the following methods:
  • Restore compressed backup

  • Restore encrypted backup

  • Restore incremental backup

  • Recovery table

  • Restore backups made with -tts

  • Restore cloud storage backup

  • Restore the table space to a different location

  • Prepare/restore the backup directory

    • Backing up encrypted InnoDB tablespace: MEB supports backup and restoration of the tablespace file encryption (TDE) database.

    • Use Redo log archive backup: MEB can use Redo log archive for backup to prevent problems caused by Redo log being overwritten.

    • Master-slave replication uses MEB: Back up the master server through MEB and restore the backup on a new slave server to build master-slave replication without stopping the master server.

    • Group replication uses MEB: Same as backup stand-alone, MEB can also be used to quickly backup and restore group members.

    • Backup encryption: MEB supports the use of AES block encryption (CBC mode) to encrypt backups to enhance security.

    • Media management software uses MEB: MEB supports the use of media management software to save backups to large-capacity storage. For example, you can use software that supports System Backup to Tape (SBT) API to back up data to tape.

    • The container uses MEB: Using the enterprise version of the MySQL container, you can back up mysql in other containers on the same host.

Introduced the function of MEB, then we look at how MEB works.

  1. Back up InnoDB tables.

The backup first compresses and copies InnoDB data files through ibbackup. Files can reach 70%~90% through compression, and the oldest and newest LSN will be marked.

MySQL Enterprise Edition Backup Tool MEB

2. Back up the InnoDB log.

InnoDB log files accumulated during the copying of data files are copied using LSN.
MySQL Enterprise Edition Backup Tool MEB

Copy only the part of the log file that contains redo information, and cover the time from the start of the backup to the end of the backup. Consistency is achieved through this operation.

MySQL Enterprise Edition Backup Tool MEB

3. Back up the MyISAM table.

mysqlbackup is equivalent to encapsulating ibbackup. An easier-to-use interface to back up MyISAM data and InnoDB data, so it can perform consistent recovery. InnoDB tables can be accessed during the backup, but MyISAM tables will have a table lock and cannot be updated.

MySQL Enterprise Edition Backup Tool MEB

4. Restore the database

To restore the database, first extract the InnoDB file to the data directory. MySQL Enterprise Backup recreates InnoDB log files and applies these logs to restore InnoDB files to a consistent state, and then restore MyISAM data.

MySQL Enterprise Edition Backup Tool MEB

Seeing this, I believe that many people care about the comparison between XtraBackup and MEB. In the end, I will introduce the advantages of MEB over PXB.

  • MEB can display the backup process

  • MEB can back up data to tape through Oracle secure backup

  • MEB supports offline backup

  • MEB supports backup log files for point-in-time recovery

  • MEB can change the table name when recovering

The above content is a brief introduction about MEB. For detailed usage of it, please visit " https://dev.mysql.com/doc/mysql-enterprise-backup/3.12/en/meb-getting-started.html ".

Users who have subscribed to MySQL Enterprise Edition can download it directly, and new users can download the 30-day trial version " https://edelivery.oracle.com/ ".

Guess you like

Origin blog.51cto.com/15080016/2642071
Recommended