立即与支持人员聊天
与支持团队交流

NetVault Plug-in for MySQL 12.0 - User Guide

Introducing NetVault Backup Plug-in for MySQL Installing and removing the plug-in Configuring the plug-in Backing up data Restoring data Working with native MySQL replication Using the plug-in in a Failover Cluster environment Troubleshooting

Full and Differential Backup restore scenarios

The DBA has established a backup policy in which Full Backups are performed every Sunday at 11:00 P.M. and Differential Backups are performed Monday through Saturday, at 11:00 P.M. Because the DBA is performing Differential Backups, the Binary Logs are kept after each form of this backup — which creates a longer backup, but allows for a faster overall restore.

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it sometime early Thursday before the DBA’s arrival at work.

The DBA decides to perform a complete recovery up to the point of the last Differential Backup — the backup performed on Wednesday night.

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2
1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
2
Leave all restore-related Options at their default: None of the options available on the Options tab are used.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.

In the following examples, a Full and Differential Backup scenario is in place, and the DBA wants to recover data to a specific time.

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 8:00 P.M. on Wednesday.

The DBA must perform a recovery that restores the database up to the time right before the developer dropped the table at 8:00 P.M. on Wednesday. Therefore, the following phases would be performed:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2
1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to specify PIT Recovery and enable all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to specify the Binary Log included in the backup for use.
Time Based PIT: Selected as the type.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Date/Time to “19:59” and “10 Jan 2007,” that is, one minute before 8:00 P.M. on Wednesday.
Method 2: Recovery before and after erroneous statement using restored Binary Logs only

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 8:00 P.M. on Wednesday.

The DBA decides to recover up to the time right before the Drop Table command was issued at 8:00 P.M. The DBA also wants to recover the transactions that occurred to the remaining tables from the time after the Orders table was dropped, and up until the end of the backed-up Binary Logs. This decision ensures that he has recovered as many of the transactions as feasible, in addition to recovering the dropped table. Therefore, the following phases would be performed:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2
1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to specify PIT Recovery and enable all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to specify the Binary Log included in the backup for use.
Time Based PIT: Selected as the type.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Date/Time to “19:59” and “10 Jan 2007,” that is, one minute before 8:00 P.M. on Wednesday.
Enable Recovery After Erroneous/Bad SQL Statements: Selected to recover transactions that occurred after the Order table was dropped, entered a later time and date in the Start Date/Time. Finally, because the recovery is to be performed to the end of the restored Binary Log, the None option was selected for the Stop Date/Time.
Method 3: Recovery before erroneous statement using restored and current Binary Logs

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 6:00 A.M. on Thursday.

The DBA must perform a recovery that restores the database up to the time right before the developer dropped the table at 6:00 A.M. on Thursday.

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2
1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to specify PIT Recovery and enable all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to indicate that the Binary Log included in the backup is to be used.
Include Current Binary Logs: Selected to use the current Binary Logs to apply entries that occurred between the time the backup was completed on Wednesday, and the issuance of the Drop Table command.
Time Based PIT: Selected as the type.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Date/Time to “05:59” and “11 Jan 2007,” that is, one minute before 6:00 A.M. on Thursday.
Method 4: Recovery before and after erroneous statement using restored and current Binary Logs

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 6:00 A.M. on Thursday.

The DBA decides to recover up to the time right before the Drop Table command was issued. The DBA also wants to recover the transactions that occurred to the remaining tables from the time after the Orders table was dropped, and up until the end of the current Binary Logs. This decision ensures that he has recovered as many of the transactions as feasible, in addition to recovering the dropped table. Therefore, the following phases would be performed:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2
1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to specify PIT Recovery and enable all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to indicate that the Binary Log included in the backup is to be used.
Include Current Binary Logs: Selected to use the current Binary Logs to apply entries that occurred between the time the backup was completed on Wednesday, and the issuance of the Drop Table command.
Time Based PIT: Selected as the type.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Date/Time to “05:59” and “11 Jan 2007,” that is, one minute before 6:00 A.M. on Thursday.
Enable Recovery After Erroneous/Bad SQL Statements: Selected to recover transactions that occurred after the Order table was dropped, entered a later time and date in the Start Date/Time. Finally, because the recovery is to be performed to the end of the current Binary Log, the None option was selected for the Stop Date/Time.

In the following examples, a Full and Incremental Backup scenario is in place, and the DBA wants to recover data to a specific time, but use a more definitive method to define the time. This process is done using identified “position values” that exist in the MySQL Binary Logs.

Method 1: Recovery before erroneous statement using restored Binary Logs only

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 8:00 P.M. on Wednesday.

The DBA decides to recover up to the time right before the Drop Table command was issued. Furthermore, the DBA wants a more precise recovery, so he decides to use a position-based recovery. The following phases illustrate this process:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2

In this phase, only the Binary Logs recorded in Wednesday night’s Differential Backup are restored to a temporary location. This process lets the DBA locate the specific position in the log that marks when the Orders table was dropped.

1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Restore Logs to Temporary Directory to Identify Time or Position: Selected to restore only the Binary Logs included in Wednesday night’s Differential Backup.
Time Based PIT: Selected as the type, but left all options in the Time Based PIT Details section cleared.

Use the mysqlbinlog utility against the restored Binary Logs: This step is performed outside of NetVault Backup to identify the position of the Drop Table command that the DBA does not want to restore. (For information about this utility and process, see the MySQL Reference Guide.) In this process, the DBA identified the Drop Table command as log position “805” in the “MYSQLSVR-bin.000009” Binary Log that was restored to the temporary location on the MySQL Server, and both values were noted.

With the position identified from the restored Binary Log, a PIT restore is then performed using Wednesday’s Differential Backup.

1
Select the Differential Backup performed Wednesday night: The DBA again selects the backup saveset on the Create Restore Job — Choose Saveset page that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Apply Binary Logs from Temporary Directory: Selected to target the Binary Logs that were restored to the temporary location in the last phase of this procedure. Because the restored Binary Log was used to identify the specific position that the Drop Table command occupied, this option is selected to tell the plug-in to use this same Binary Log.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Position to “804,” the position in the Binary Logs that exists before the Drop Table command position identified using mysqlbinlog. The Binary Log Containing Stop Position option was used to select the Binary Log, “MYSQLSVR-bin.000009,” that was restored to the temporary directory.
Method 2: Recovery before and after erroneous statement using restored Binary Logs only

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors on the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 8:00 P.M. on Wednesday.

The DBA decides to recover up to the time right before the Drop Table command was issued. The DBA also wants to recover the transactions that occurred to the remaining tables from the time after the Orders table was dropped, and up until the end of the backed-up Binary Logs. Furthermore, the DBA wants a more precise recovery, so he decides to use a position-based recovery. The following phases illustrate this process:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2

In this phase, only the Binary Logs recorded in Wednesday night’s Incremental Backup are restored to a temporary location. This process lets the DBA locate the specific position in the log that marks when the Orders table was dropped.

1
Select the Differential Backup performed Wednesday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Wednesday’s Differential Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Restore Logs to Temporary Directory to Identify Time or Position: Selected to restore only the Binary Logs included in Wednesday night’s Differential Backup.
Time Based PIT: Selected as the type, but left all options in the Time Based PIT Details section cleared.

Use the mysqlbinlog utility against the restored Binary Logs: This step is performed outside of NetVault Backup to identify the position of the Drop Table command that the DBA does not want to restore. (For information about this utility and process, see the MySQL Reference Guide.) In this process, the DBA identified the Drop Table command as log position “805” in the “MYSQLSVR-bin.000009” Binary Log that was restored to the temporary location on the MySQL Server, and both values were noted.

With the position identified from the restored Binary Logs, the PIT restore is then performed using Wednesday’s Incremental Backup.

1
Select the Differential Backup performed Wednesday night: The DBA again selects the backup saveset on the Create Restore Job — Choose Saveset page that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Apply Binary Logs from Temporary Directory: Selected to target the Binary Logs that were restored to the temporary location in the last phase of this procedure. Because the restored Binary Log was used to identify the specific position that the Drop Table command occupied, this option is selected to tell the plug-in to use this same Binary Log.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Position to “804,” the position in the Binary Logs that exists before the Drop Table command position identified using mysqlbinlog. The Binary Log Containing Stop Position option was used to select the Binary Log, “MYSQLSVR-bin.000009,” that was restored to the temporary directory.
Enable Recovery After to Erroneous/Bad SQL Statement(s): Selected this option, and set the Start Position to “806,” the position in the Binary Logs that exists after the Drop Table command position identified using mysqlbinlog. The Binary Log Containing Stop Position option was used to select the Binary Log, “MYSQLSVR-bin.000009,” that was restored to the temporary directory. Finally, because the recovery is to be performed to the end of the named Binary Log, the None option was selected for the Stop Position.
IMPORTANT: Stop and Start positions must be actual positions listed in a Binary Log, not arbitrary numbers that are greater than the position of the unwanted transaction.
Method 3: Recovery before erroneous statement using restored and current Binary Logs

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors for the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 6:00 A.M. on Thursday.

The DBA must perform a recovery that restores the database up to the time right before the developer dropped the table at 6:00 A.M. on Thursday. Furthermore, the DBA wants a more precise recovery, so he decides to use a position-based recovery. The following phases illustrate this process:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2

Use the mysqlbinlog utility against the current Binary Logs: This step is performed outside of NetVault Backup to identify the position of the Drop Table command that the DBA does not want to restore. (For information about this utility and process, see the MySQL Reference Guide.) In this process, the DBA identified the Drop Table command as log position “805” in the current Binary Log, “MYSQLSVR-bin.000009”.

With the position identified from the restored Binary Logs, the PIT restore is then performed using Wednesday’s Differential Backup.

1
Select the Differential Backup performed Wednesday night: The DBA again selects the backup saveset on the Create Restore Job — Choose Saveset page that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday night’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to tell the plug-in to use the Binary Log that was included in the backup.
Include Current Binary Logs: Selected to tell NetVault Backup to use the current Binary Logs to apply all database transactions that occurred after Wednesday night’s Differential Backup. This step recovers all transactions that occurred between the completion of the Differential Backup on Wednesday night, and the time the Drop Table command was issued.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Position to “804,” the position in the current Binary Log that exists before the Drop Table command position identified using mysqlbinlog. Set Binary Log Containing Stop Position to OTHER FILE, and entered the name of the current binary file in the text box, for example, “MYSQLSVR-bin.000009.”
Method 4: Recovery before and after erroneous statement using restored and current Binary Logs

On Thursday at 9:00 A.M., the DBA learns that users are encountering “table not found” errors for the Orders table. The DBA then learns that the table no longer exists because a developer unknowingly dropped it at 6:00 A.M. on Thursday.

The DBA decides to recover up to the time right before the Drop Table command was issued. The DBA also wants to recover the transactions that occurred to the remaining tables from the time after the Orders table was dropped, and up until the end of the current Binary Log. Furthermore, the DBA wants a more precise recovery, so he decides to use a position-based recovery. The following phases illustrate this process:

1
Select the Full Backup performed Sunday night: On the Create Restore Job — Choose Saveset page, the DBA selects the backup saveset that corresponds to Sunday’s Full Backup.
2

Use the mysqlbinlog utility against the current Binary Logs: This step is performed outside of NetVault Backup to identify the position of the Drop Table command that the DBA does not want to restore. (For information about this utility and process, see the MySQL Reference Guide.) In this process, the DBA identified the Drop Table command as log position “805” in the current Binary Log, “MYSQLSVR-bin.000009.”

With the position identified from the restored Binary Logs, the PIT restore is then performed using Wednesday’s Differential Backup.

1
Select the Differential Backup performed Wednesday night: The DBA again selects the backup saveset on the Create Restore Job — Choose Saveset page that corresponds to Wednesday’s Differential Backup.
IMPORTANT: The DBA does not have to restore Monday and Tuesday night’s Differential Backups. By choosing to perform Differential Backups, each night’s backup is cumulative, back to Sunday’s Full Backup; that is, Wednesday night’s backup includes all the Binary Logs that were generated on Monday, Tuesday, and Wednesday — back to Sunday’s Full Backup.
2
Set specific options on the restore-related Options tab: The DBA sets the following options:
Perform PIT Recovery: Selected to enable this form of restore and all associated options.
Restore and Apply Binary Logs (Used when Time or Position is already known): Selected to tell the plug-in to use the Binary Log that was included in the backup.
Include Current Binary Logs: Selected to tell NetVault Backup to use the current Binary Logs to apply all database transactions that occurred after Wednesday night’s Differential Backup. This step recovers all transactions that occurred between the completion of the Differential Backup on Wednesday night, and the time the Drop Table command was issued.
Enable Recovery Prior to Erroneous/Bad SQL Statement(s): Selected this option, and set the Stop Position to “804,” the position in the current Binary Logs that exists before the Drop Table command position identified using mysqlbinlog. Set Binary Log Containing Stop Position to OTHER FILE, and entered the name of the current binary file in the text box, for example, “MYSQLSVR-bin.000009.”
Enable Recovery After to Erroneous/Bad SQL Statement(s): Selected this option, and set the Start Position to “806,” the position in the current Binary Log that exists after the Drop Table command position that was identified using mysqlbinlog. Set Binary Log Containing Stop Position to OTHER FILE, and entered the name of the current binary file in the text box, for example, “MYSQLSVR-bin.000009.” Finally, because the recovery is to be performed to the end of the current Binary Log, the None option was selected for the Stop Position.
IMPORTANT: Stop and Start positions must be actual positions listed in a Binary Log, not arbitrary numbers that are greater than the position of the unwanted transaction.

PIT restore when the MIXED Binary Logging Format is used and cross-database updates are issued

PIT restore when the MIXED Binary Logging Format is used and cross-database updates are issued
IMPORTANT: If your site uses the MIXED Binary Logging Format, and all database users and programs follow the best practice of ensuring that tables that are modified are in the database selected by USE, and no cross-database updates are issued, this topic does not apply to your site. (For more information, see Using the MIXED Binary Logging Format.) You can run PIT restore jobs and the Binary Log is replayed to the specified point for the databases selected in the job.

As stated previously, if users and programs in your environment modify tables in databases that are not selected by USE and they issue cross-database updates, transactions might not be replayed to the specified time when you run a PIT restore job. Quest recommends that all database users and programs ensure that modified tables 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: The following procedure uses mysqlbinlog without the “--database” option. Therefore, all the contents of the Binary Log are applied, and all databases might be modified. Consider applying this procedure to an alternate MySQL Server and extract the applicable data from the alternate MySQL Server. If you apply the following procedure to your production MySQL Server, all databases are rolled back to the specified point. Do not apply the procedure in your production environment unless you plan to roll back all your MySQL Server Databases to the specified point.
1
2
On the Create Restore Job — Choose Saveset page, click Table Filtering, and select Edit Filters.
3
From the Plugin Type list, select Plug‑in for MySQL.
5
On the Create Selection Set page, select Binary Logs.
6
On the Create Selection Set page, click Edit Plugin Options.
7
On the Point-in-Time Recovery tab, select the Perform PIT Recovery and Restore Logs to Temporary Directory to Identify Time or Position options.
The Binary Logs are restored to a temporary directory located in: <NetVaultBackupInstallationDirectory>/tmp/mysql/<savesetName>
8
To apply the Binary Logs manually from a mysqlbinlog command prompt, type:
"<NetVaultBackupInstallationDirectory>/tmp/mysql/<savesetName>" |
The different Incremental Backup Savesets are restored to different subdirectories in the <NetVaultBackupInstallationDirectory>/tmp/mysql directory. You can then apply the mysqlbinlog command in each directory, or you can copy or move all the Binary Logs to a common directory and run mysqlbinlog.

Examples of restore scenarios for MySQL Enterprise Backup

To recover from a failure or data corruption, various settings must be made when setting up the job regarding data selected for restore and options available on the Options tab.

Full Backup only restore scenarios

1
相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级