Before completing a backup, review the information in the following topics:
If you intend to use the MySQL Standard/Community option, review the following guidelines and information:
• |
If the database name contains hyphens, MyISAM tables are backed up if the MyISAM Backup Method is set to the Mysqldump option introduced in version 4.2. Performance of backups and restores might be negatively affected. |
• |
If the MyISAM Backup Method is set to use the default Lock & Copy Table Files option and the database name contains hyphens, MyISAM tables are not backed up. Backups are not generated because the plug-in bypasses MySQL commands and tries to copy the table files directly. The plug-in logs an error message indicating that the table file cannot be located, and then fails the backup job without creating a saveset. |
MySQL does not enforce the use of the USE statement when the MIXED Binary Logging Format is used. Therefore, Quest recommends that all database users and programs ensure that tables that are modified are in the database selected by USE, and that no cross-database updates are issued. If this guideline is not suitable for your environment, Quest recommends that you do not use the MIXED Binary Logging Format.
IMPORTANT: Incremental and Differential Backup jobs complete with a warning if the MIXED Binary Logging Format is used. |
If your environment uses the MIXED Binary Logging Format, it might prevent Binary Log entries from being replayed during a PIT Recovery. During recovery, the plug-in uses mysqlbinlog with the “‑‑database” option to replay only the entries related to the databases that you selected for the restore job. If “--database” is not used, all entries are replayed, which affects all databases. When the MIXED Binary Logging Format is used, entries are written in a way that might prevent mysqlbinlog with the “‑‑database” option from replaying some, or all, entries. For more information, see https://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog.html#option_mysqlbinlog_database.
To ensure that the MIXED Binary Logging Format works correctly with the “--database” option, all transactions for specific updates to a database have to be issued under a USE statement that selects the database.
This same situation occurs if the Incremental or Differential Backups are not restored and mysqlbinlog applies the current Binary Log from the MySQL Server. This situation occurs because of how the Binary Log is written, not because of how the Binary Log is stored in the backup.
IMPORTANT: Ensuring that tables that you modify belong to the database specified in the USE statement applies to transactions that are generated through the MySQL command prompt. It also applies to transactions that are generated by scripts, programs, and other applications that interact with the MySQL Server databases. |
The following examples demonstrate different ways in which MIXED affects recovery behavior.
• |
Example 1: In this example, a row of data is inserted into my_table of my_database. There is no USE statement, so the database in use is the default database, for example, mysql database. If binlog_format is set to MIXED, the following transaction is not replayed when mysqlbinlog applies the “‑-database my_database” option to the Binary Log. |
• |
Example 2: In this example, a row of data is inserted into my_table of my_database. There is a USE statement, but a different database is specified; that is, my_database is not selected in the USE statement. If binlog_format is set to MIXED, the following transaction is not replayed when mysqlbinlog applies the “‑-database my_database” option to the Binary Log. |
• |
Example 3: In this example, a row of data is inserted into my_table of my_database, and my_database is selected in a USE statement. If binlog_format is set to MIXED, the following transaction is replayed when mysqlbinlog applies the “‑-database my_database” option to the Binary Log. |
• |
Example 4: In this example, there are two insert queries. The first insert is done for my_database, which is different than the database selected in the USE statement. The second insert is done under the scope of a USE statement that selects my_database. If binlog_format is set to MIXED, the first insert is not replayed because my_database is not specified in the USE statement, but the second insert is replayed because my_database is specified in the USE statement. |
If you intend to use the MySQL Enterprise Backup option, review the following guidelines and information:
• |
In MySQL 5.6 and later, the innodb_file_per_table configuration option is enabled by default. Any InnoDB tables that are created with the innodb_file_per_table option disabled are stored in the InnoDB system tablespace; they cannot be omitted from the backup. If you must place an InnoDB table outside the tablespace, create it while the innodb_file_per_table option is enabled in MySQL. Each .ibd file contains the data and indexes of only one table. |
When defining a MySQL backup strategy, answer the following questions:
• |
Do I want to use the MySQL Standard/Community or MySQL Enterprise Backup option? Even if you have both versions implemented in your environment, you can only use one strategy with the plug-in. Use either the MEB-based method or the mysqldump-based method; you cannot use a mixture of the two. |
If you use the MySQL Standard/Community option, the plug-in uses mysqldump to provide the following types of backup:
In a Full Backup for the MySQL Standard/Community option, the plug-in uses the mysqldump utility to back up every database included in the instance. Full Backups are the foundation of any backup strategy because they provide the starting point for almost every restore scenario. Full Backups generated with the plug-in can be used to restore an entire instance, individual or multiple databases, and individual or multiple tables.
The Purge Binary Logs after Full or Incremental Backup option ensures that Binary Logs are purged after a Full or Incremental Backup. This option is enabled by default when the plug-in is used with a standard MySQL Server configuration, Enable MySQL Replication is disabled, and Enable Point-In-Time Recovery is enabled. It is disabled when the plug-in is connected to a cluster; you must manage the purging of the Binary Logs outside of the plug-in.
IMPORTANT: In a mixed environment, where a NetVault Backup Server manages both clustered and standard MySQL Servers, do not reuse a Backup Options Set — created for a standard MySQL Server — for a MySQL-based cluster. |
If you do not select the Purge Binary Logs… option, the plug-in tracks the Last Log Backed Up in its configuration file; you can manually purge Binary Logs at your discretion. For example, if you are using a MySQL replication environment where you do not want to purge Binary Logs from the Master Instance until they have been replicated to the Slave Instance, you are responsible for manually purging the Binary Logs.
MySQL Incremental Backups require that you start the MySQL Instance with the “‑log-bin” option, which enables the Binary Log. This procedure is outlined in Enabling the Binary Log on the MySQL Server (Standard/Community option only). For more information, see the Binary Log section in the MySQL Reference Guide.
As described earlier, the Purge Binary Logs after Full or Incremental Backup option ensures that Binary Logs are purged after a Full or Incremental Backup. If you do not use this option, the plug-in tracks the Last Log Backed Up in its configuration file, and you can manually purge Binary Logs at your discretion.
A Differential Backup backs up the transaction logs that were generated since the last Full or Incremental Backup. However, the Binary Logs are not purged at the completion of the backup. Therefore, subsequent Differential Backups increase in size and in duration. The size and duration increase because each backup of this type includes the Binary Logs that were also included in the previous Differential Backup and the Binary Logs that have been generated since the previous Differential Backup. For example, if a Full Backup was taken on Sunday with Differential Backups scheduled Monday through Saturday, Monday’s Differential includes the Binary Logs generated since the Full Backup on Sunday, while Tuesday’s Differential includes the Binary Logs generated on Monday and those logs generated on Tuesday. Wednesday’s Differential includes the Binary Logs for Monday, Tuesday, and Wednesday, and so on.
Similar to an Incremental Backup, a Differential can also be used to reduce data loss after a media failure or data corruption, with the ability to restore to a time before and after the failure or corruption. Unlike a Full Backup, a Differential does not require read-only access during the backup.
Differential Backups require that you start the MySQL Instance with the “‑log-bin” option, which enables the Binary Log. This procedure is outlined in Enabling the Binary Log on the MySQL Server (Standard/Community option only). For more information, see the Binary Log section in the MySQL Reference Guide.
Sometimes a backup must be taken for a special purpose and should not affect the overall backup and restore procedures for a complete database. For example, backups can be a source for a test environment or as an initial synchronization for a replication slave instance. Individual Database/Table Copy Only Backups are designed for these special purposes, in that they allow you to “copy” a MySQL environment. “Copy Only” backups are independent of an established sequence of backups and do not affect the recoverability of Full, Incremental, or Differential Backups. However, they cannot be used as a replacement for a Full Backup.
As described for Individual Database/Table Copy Only Backups, the Entire Databases Copy Backup option is used only for special purposes as it creates a copy of the selected MySQL databases, including all the corresponding InnoDB tables of the selected databases. “Copy” backups are independent of an established sequence of backups and do not affect the recoverability of Full, Incremental, or Differential Backups. However, they cannot be used as a replacement for a Full Backup.
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center