Mysql Enterprise Backup User's Guide (Version 4.1.4) Abstract
Total Page:16
File Type:pdf, Size:1020Kb
MySQL Enterprise Backup User's Guide (Version 4.1.4) Abstract This is the user manual for MySQL Enterprise Backup, a commercially licensed backup utility for MySQL databases. It explains the different kinds of backup and restore that can be performed with MySQL Enterprise Backup, and describes the commands for performing them. Strategies for optimizing backup and restore operations are also discussed. For notes detailing the changes in each release, see the MySQL Enterprise Backup 4.1 Release Notes. For legal information, including licensing information, see the Preface and Legal Notices. For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users. Document generated on: 2021-09-16 (revision: 8346) Table of Contents Preface and Legal Notices ........................................................................................................... ix I Getting Started with MySQL Enterprise Backup ........................................................................... 1 1 Introduction to MySQL Enterprise Backup ........................................................................... 5 1.1 The mysqlbackup Client .......................................................................................... 5 1.2 Overview of Backup Types ...................................................................................... 5 1.3 Files that Are Backed Up ........................................................................................ 7 1.3.1 Types of Files Contained in a Backup ........................................................... 7 1.3.2 Files Backed up for InnoDB Data ................................................................ 19 1.3.3 Files Backed up for Data Stored with MyISAM and Other Storage Engines ..... 19 1.3.4 Files Generated by mysqlbackup ................................................................ 20 2 Installing MySQL Enterprise Backup ................................................................................. 21 3 What's New in MySQL Enterprise Backup 4.1? ................................................................. 23 II Using MySQL Enterprise Backup .............................................................................................. 25 4 Backing Up a Database Server ........................................................................................ 29 4.1 Before the First Backup ......................................................................................... 29 4.1.1 Collect Database Information ...................................................................... 29 4.1.2 Grant MySQL Privileges to Backup Administrator ......................................... 31 4.1.3 Designate a Location for the Backup Directory ............................................. 32 4.2 The Typical Backup / Verify / Restore Cycle ........................................................... 32 4.2.1 OS User for Running mysqlbackup ............................................................. 32 4.2.2 Backing Up an Entire MySQL Instance ........................................................ 33 4.2.3 Verifying a Backup ..................................................................................... 35 4.2.4 Restoring a Database ................................................................................. 36 4.3 Backup Scenarios and Examples ........................................................................... 40 4.3.1 Making a Single-File Backup ....................................................................... 40 4.3.2 Making a Full Backup ................................................................................. 44 4.3.3 Making a Differential or Incremental Backup ................................................ 45 4.3.4 Making a Compressed Backup ................................................................... 50 4.3.5 Making a Partial Backup ............................................................................. 51 4.3.6 Making an Optimistic Backup ...................................................................... 55 4.3.7 Making a Back Up of In-Memory Database Data .......................................... 57 4.3.8 Making Scheduled Backups ........................................................................ 57 4.4 Making Backups with a Distributed File System (DFS) or Storage Access Network (SAN) ......................................................................................................................... 58 5 Recovering or Restoring a Database ................................................................................ 61 5.1 Performing a Restore Operation ............................................................................ 61 5.1.1 Restoring a Compressed Backup ................................................................ 62 5.1.2 Restoring an Encrypted Backup Image ........................................................ 63 5.1.3 Restoring an Incremental Backup ................................................................ 63 5.1.4 Restoring Backups Created with the --use-tts Option .............................. 64 5.1.5 Restoring a Backup from Cloud Storage to a MySQL Server ......................... 65 5.1.6 Restoring External InnoDB Tablespaces to Different Locations ...................... 66 5.1.7 Advanced: Preparing and Restoring a Directory Backup ............................... 66 5.2 Point-in-Time Recovery ......................................................................................... 67 5.3 Restoring a Backup with a Database Upgrade or Downgrade .................................. 68 6 Working with Encrypted InnoDB Tables ............................................................................ 71 7 Using MySQL Enterprise Backup with Replication ............................................................. 75 7.1 Setting Up a New Replica ..................................................................................... 75 7.2 Backing up and Restoring a Replica Database ....................................................... 77 7.3 Restoring a Source Database ................................................................................ 77 8 Using MySQL Enterprise Backup with Group Replication ................................................... 81 9 Encryption for Backups .................................................................................................... 83 10 Using MySQL Enterprise Backup with Media Management Software (MMS) Products ........ 85 10.1 Backing Up to Tape with Oracle Secure Backup ................................................... 85 11 Performance Considerations for MySQL Enterprise Backup ............................................. 89 iii MySQL Enterprise Backup User's Guide (Version 4.1.4) 11.1 Optimizing Backup Performance .......................................................................... 89 11.2 Optimizing Restore Performance .......................................................................... 92 12 Monitoring Backups with MySQL Enterprise Monitor ........................................................ 95 13 Troubleshooting for MySQL Enterprise Backup ................................................................ 97 13.1 Exit codes of MySQL Enterprise Backup .............................................................. 97 13.2 Working Around Corruption Problems .................................................................. 98 13.3 Using the MySQL Enterprise Backup Logs ........................................................... 99 13.4 Using the MySQL Enterprise Backup Manifest .................................................... 100 III mysqlbackup Command Reference ..................................................................................... 103 14 mysqlbackup ............................................................................................................. 107 15 mysqlbackup commands ............................................................................................ 109 15.1 Backup Operations ............................................................................................ 109 15.2 Update Operations ............................................................................................ 110 15.3 Restore Operations ........................................................................................... 111 15.4 Validation Operations ........................................................................................ 113 15.5 Other Single-File Backup Operations .................................................................. 114 15.6 Other Operations ............................................................................................... 116 16 mysqlbackup Command-Line Options ......................................................................... 117 16.1 Standard Options .............................................................................................. 127 16.2 Connection Options ........................................................................................... 128 16.3 Server Repository Options ................................................................................. 130 16.4 Backup Repository Options ................................................................................ 134 16.5 Metadata Options .............................................................................................. 138 16.6 Compression Options .......................................................................................