Home
MySQL Enterprise Backup User`s Guide (Version 3.11.1)
Contents
1. sleep MS Command Line Format sleep MS Permitted Values Type numeric Default 0 Specify the number in milliseconds to sleep after copying a certain amount of data from InnoDB tables Each block of data is 1024 InnoDB data pages typically totalling 16MB This is to limit the CPU and l O overhead on the database server 94 Performance Scalability Capacity Options Default 0 no voluntary sleeps no locking Disables locking during backup of non InnoDB files even if a connection is available Can be used to copy non InnoDB data with less disruption to normal database processing There could be inconsistencies in non InnoDB data if any changes are made while those files are being backed up page reread time MS Command Line Format page reread t ime MS Permitted Values Type numeric Default 100 Interval in milliseconds that mysq1backup waits before re reading a page that fails a checksum test A busy server could be writing a page at the same moment that mysqlbackup is reading it Can be a floating point number such as 0 05 meaning 50 microseconds Best possible resolution is 1 microsecond but it could be worse on some platforms Default is 100 milliseconds 0 1 seconds page reread count retry_limit Command Line Format page reread count number Permitted Values Type numeric Default 500 Maximum number of re
2. ccceeeeeeeeeeeee ae eaeeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaaaenees 123 10 1 Monitoring Backups with MySQL Enterprise Monitor c cceeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaeaaea 123 10 2 Error codes of MySQL Enterprise Backup 0 cccceceeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeeeeeeeeeees 123 10 3 Working Around Corruption Problems oooocciccnnnncncononccoccnnnnncnnnonncnccnnnnn crono nnan cr nnnncn nn rra 124 10 4 Using the MySQL Enterprise Backup LOgS ccccccccconoccconcnnconcnnnonncnccnnnn nono nnnnancrnnnn nono nnnninos 124 10 5 Using the MySQL Enterprise Backup Manifest ooonconnconcccccncnnccnnnnnnanncncnncononnnnancnncnncnnnnnns 126 11 Frequently Asked Questions for MySQL Enterprise Backup ccseeeeeeeeeeeeeeeeeeeeeeeeeeeaaaaeeeees 129 24 Chapter 3 Backing Up a Database Server Table of Contents 3 1 Before the First BACKUP iii A eee send a dense 25 3 1 1 Collect Database Information ccccceceeeee ee eeeeeeeeeeee tees eee eeeeeeeeeeaaaaaeeeeeeeeeeeaeaaeeneeseeeees 25 3 1 2 Grant MySQL Privileges to Backup Administrator cccceeeeeeeeeeeeaeeeeeeeeeeeeeeeaaeaneeeeeees 27 3 1 3 Designate a Location for Backup Data 0 cccccceceeeeeee eee eeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaaaneeeeeees 28 3 2 The Typical Backup Verify Restore Cycle ccccccccceeeeeeeeee cece eee eeeeeeeeeeeeaeaaeaneeeeeeeeeaeaaeaneneeeees 28 3 2 1 Backing Up an Entire MySQL Instance
3. 0 ceccceee ee eeeeeeeeeeeee seca aa ee eeeeeeeeeeeeaaaaeeeeeeeeeeeaea 28 3 2 2 VerityinG a BACKUP scccisiecccasietekecan taeeecusdeeseena dene cons ERENER EREE ATIRE caved couse REEERE 30 3 2 3 Restoring a Database at its Original Location ooonncdcidnnnnccoconcccconnnnnonononnancnncan cono nn nnanannnnno 31 3 3 Backup Scenarios and Examples 0 ccccccceceeeeeeeeeeeeee ee ee aaeeeeeeeeeeeeseaaaaeeeeeeeeeeeaaaaeeeeeseeeeeeaeaaeaees 31 3 3 1 Making a FullBackup cccc ccccnss is ceececasteteecneteeced ances ad 31 3 3 2 Making an Incremental Backup cece cece eee ee ee eee eee ener e eee eee senate ee sedan eeeeaaeeeeeeaaeeeeeea 32 3 3 3 Making a Compressed Backup ccseceeeeeeeeeeaeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaaaseeeeeeeeeaeaaaaeeeees 35 3 3 4 Making a Partial BACKUP 2000 2 eee eee inet eee ee ee tree entree enter nena esse anne EARNE E ANENE ENKEN RNE 36 3 3 5 Making a Single File Backup seirm naian a aeaiia 41 3 3 6 Making an Optimistic Backup oocccccicccoconoccccnnnononononncnccnnnnncnnnnnnancrnnnnnnnnnnnnancrn rra nnnnnnnnancin 45 3 3 7 Making a Back Up of In Memory Database Data oooocicncncicocococcccnnnnconnnonnoncnncnncnnnnnnnananananos 46 3 3 8 Making Scheduled Backups cocococococcccnccoccnononnonccncnnconononnancnnnnnnnnnnnnnanannnnnnnnnnnnnanancinncininnns 46 This section describes the different kinds of backups that MySQL Enterprise Backup can create and the techniques for producing them
4. See Also compression compression level ibd file ibz file MySQL Enterprise Backup tablespace ibdata file A set of files with names such as ibdatal ibdata2 and so on that make up the InnoDB system tablespace These files contain metadata about InnoDB tables and can contain some or all of the table and index data also depending on whether the file per table option is in effect when each table is created For backward compatibility these files always use the Antelope file format See Also Antelope system tablespace image The file produced as part of a single file backup operation It can be a real file that you store locally or standard output specified as when the backup data is streamed directly to another command or remote server This term is referenced in several mysqlbackup options such as backup dir to image and image to backup arr See Also single file backup streaming include In a partial backup to select a set of tables databases or a combination of both to be backed up Contrast with exclude 173 See Also partial backup incremental backup A backup that captures only data changed since the previous backup It has the potential to be smaller and faster than a full backup The incremental backup data must be merged with the contents of the previous backup before it can be restored See Section 3 3 2 Making an Incremental Backup for usage details Related mysqlbackup options are
5. oooooccccccccccccncocnccncanconcnnnnancncnancnnonnnnnnanccnncnncnnns 50 4 4 Shutting Down and Restoring a Database oooonooccccccnciccnnnocnccncnncnnnnnnnancnncnnco nono nnnann cnn na nn nn nnananncnn 50 4 5 Restoring a Compressed Backup ccccececeeeeeeeeeeeeeee ee ae aa eeeeeeeeeeeeaeaaeaeceeeeeeeeeaaaaeeeeeseeeeeeaeaaeaees 51 4 6 Restoring an Encrypted Backup IMage cccooocccccccnccccononoccnononaccnononnccnonnnncnnnnnnncncnnnnnccnnnnnncinnnnanennns 51 4 7 Restoring an Incremental Backup Image cee eeceeeee cece teeter cette eee nate ee ee anne esse anne ee eeaaneeeeeaaneeeenaa 52 4 8 Restoring Selected Tables from a TTS Backup cccccococconccncnnconcnnnnnncnnnnnnoncnnnnanancnnnnnnnnnnnananccnncancnnns 52 4 9 Restoring a Single file Backup from Cloud Storage to a MySQL Server cccecseeeeeeeseeeeeeeaeeeees 52 5 1 Simple Backup with Connection Parameters from Default Configuration File ooo ooooninncnnnnnnncnc 65 5 2 Basic Incremental Backup serorari irere i ena vta cada atada 65 5 3 Apply Log t Full Backup woo ica ies 66 5 4 Incremental Backup sireci annatod aaa are dei hee ede ede ener a eed 83 5 5 Example baekupamy Git TNC sica ira liada died 106 9 1 Sample mysqlbackup Commands Using MySQL Enterprise Backup with Oracle Secure Backup vii viii Preface and Legal Notices This is the User Manual for the MySQL Enterprise Backup product For license information see the Lega
6. Verify Restore Cycle cccceceeeeeeeee eee eeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaa 28 3 2 1 Backing Up an Entire MySQL Instance ooooooiccccccncccnconncocinnnnccnnnonnancnnnancnnnnnnnan os 28 3 2 2 Verifying a Backup issii erence AA E A T Ne AES 30 3 2 3 Restoring a Database at its Original Location oooodndnnnnnnnconncncinnnnccnnnnnncncnnnancnnno 31 3 3 Backup Scenarios and Examples ooooccccococococonccnconononnonccncnncononnnnannnncnnnannnnnnanancrnnnnnnnnns 31 3 3 1 Making a Full Backup cccoconcccccnoncccnonnnnccnnnnanccnnnnnnccnnnnnncrnnnnnnrrnnnnnnrrnnnnnncrnnnnnners 31 3 3 2 Making an Incremental Backup ooocccccoccccccnoccnnnnnnccnnnnnncnnnnnnnncnnnnnncrnnnnnnrrnnn nano 32 3 3 3 Making a Compressed Backup ccceeeeeeeeeeeeceaeeeeeeeeeeeeeaeaaeaeeeeeeeeeeeeanaaeeeees 35 3 3 4 Making a Partial BACKUP soseri a aiea e ANAA 36 3 3 5 Making a Single File Backup oooooooococncccccnccccnnnonncoccnnnnnnnnnnnancnnnnncnnnnnnnancancancnnns 41 3 3 6 Making an Optimistic Backup ooooccccccncccccononnccnconcononnnnnncnncnnnononnnnanannrnncnnnnnnnnns 45 3 3 7 Making a Back Up of In Memory Database Data ooonccccnnniciccconccnccnnnnnnncnnnnannnnns 46 3 3 8 Making Scheduled Backups ccccoccccccococococcnocononononncncnnnnnnonnnonnancnnnan nono nnnnananananes 46 4 Recovering or Restoring a Database 2000 0 cece centr eee e ener tesa ee eeeeee tees eeaeeeeeeeaeeeeeaaaeeeeeaaaees 49 4 1 Preparing the Backup to be Re
7. write threads option Depending on your operating system you can measure resource utilization using commands such as top iostat sar dtrace or a graphical performance monitor Do not increase the number of read or write threads iowait once the system iowait value reaches approximately 20 118 Chapter 8 Encryption for Backups In order to enhance security for backed up data since version 3 10 MySQL Enterprise Backup provides encryption for single file backups The encryption can also be applied when creating a partial compressed or incremental single file backups and for streaming backup data to another device or server The encryption is performed with Advanced Encryption Standard AES block cipher in CBC mode with a key string of 64 hexadecimal digits supplied by the user Decryption is performed using the same key The key can be created manually just by putting together 64 random hexadecimal bytes or it can be generated by shasun or similar programs for hash calculations that work on your platform by supplying it with a keyphrase echo n my secret passphrase shasum a 256 a7e845b0854294da92a743b807cb67b19647c1195ea8120369f3d12c70468f29 Note that the at the end is not part of the key and should be ignored Supply the key to mysqlbackup with the key option or paste the key into a key file and supply the file s pathname to mysqlbackup with the key file option To generate a key randomly you can
8. 7 Performance Considerations for MySQL Enterprise Backup cceeeeeeeeeaeeeeeeeeeeeeeeeaeaaes 113 7 1 Optimizing Backup Performance 0 cccceceeeeeeeeeee ee ae ea eeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaeaneeeeees 113 7 2 Optimizing Restore Performance c ccceeeeeneeeeeeeeeeeeeeaeeaeeeeeeeeeeeaeaaaaneeeeeeeeeaeaaea 116 BS Encryption TON Backups xi ii dE 119 9 Using MySQL Enterprise Backup with Media Management Software MMS Products 121 9 1 Backing Up to Tape with Oracle Secure Backup cccccoooccnnconoccnnnonaccnnnnnnccnnonnnccnnnnnanons 121 10 Troubleshooting for MySQL Enterprise Backup oooooocccccccnccccnonocnconcnnconnnnnnancnnnancnnnnnnnancnnnanos 123 10 1 Monitoring Backups with MySQL Enterprise Monitor 0 cceeeeeeeeeeeeeeeeeeeeeaeaaeeees 123 10 2 Error codes of MySQL Enterprise Backup ceeeeeeeaeeeeeeeeeeeeeeeaeaaeateeeeeeeeeaeaaea 123 10 3 Working Around Corruption Problems ccccccceeeceeeeeeeeeeeeeeeaaeeeeeeeeeeeeeeaaaaeeeeeeeeeees 124 10 4 Using the MySQL Enterprise Backup LOgS occccccccccconococincnnconononnnnconcnncononnnnancnnnancnnns 124 10 5 Using the MySQL Enterprise Backup Manifest cceceeeeeeeeeaeeeeeeeeeeeeeeeaaeaeenees 126 11 Frequently Asked Questions for MySQL Enterprise Backup ccceeeeceeeeeeeeeeeeeeeeaeeaeenees 129 WN APPEAR ads 131 A MySQL Enterprise Backup Limitations oooococinncicnconnccconnnnnonnnonannc
9. Always be aware how much time it takes to restore the data during planned maintenance or when disaster strikes For example here are factors to consider for some of the key MySQL Enterprise Backup features e Parallel backups are the default in MySQL Enterprise Backup 3 8 a major performance improvement over earlier MySQL Enterprise Backup releases The read process and write are the primary sub operations of all MEB operations For example in a backup operation MySQL Enterprise Backup first reads the data from the disk then processes this data writes the data to disk and reads the data again for verification MySQL Enterprise Backup ensures that these sub operations are independent of each other and run in parallel to gain performance improvement Read process and write sub operations are performed in parallel using multiple threads of the same kind multiple read threads multiple process threads and multiple write threads resulting in better performance The performance improvement is typically greater when RAID arrays are used as both source and target devices and for compressed backups which can use more CPU cycles in parallel Parallel backup employs block level parallelism using blocks of 16MB Different threads can read process and write different 16MB chunks within a single file Parallel backup improves the performance of operations whether the instance contains a single huge system tablespace or many smaller tablespaces repre
10. B 2 Compatibility with MySQL Versions ooococncnnnnononnccccnncnncnnnnncnccnnnnnnnnnnnnnncrnn cnn non rra rre nnnn nn nn nnanncin 139 B 3 Compatibility with Older MySQL Enterprise Backup oooooocccccccncccnnonccoconcnnconononnnncancancononnnnncnnnanos 139 B 4 Compatibility Notes for Specific MySQL Versions oococnnncocononococinnnnccnnnonnnnncnnancnnnnnnnnncnncan cn nnnnnnnns 139 This section describes information related to compatibility issues for MySQL Enterprise Backup releases B 1 Cross Platform Compatibility MySQL Enterprise Backup is cross platform compatible when running on the Linux and Windows operating systems backups on a Linux machine can be restored on a Windows machine and vice versa However to avoid data transfer problems arising from letter cases of database or table names the variable lower_case_table_names must be properly configured on the MySQL servers For details see Identifier Case Sensitivity B 2 Compatibility with MySQL Versions MySQL Enterprise Backup 3 11 supports all the MySQL server versions that are currently in the General Availability GA status that is MySQL 5 5 and 5 6 B 3 Compatibility with Older MySQL Enterprise Backup MySQL Enterprise Backup 3 11 can be used to restore backups created for any MySQL server version that are currently in the General Availability GA status that is MySQL 5 5 and 5 6 by any older MySQL Enterprise Backup versions that supports those server versions t
11. Because all the tables in the system tablespace share the same row format to take advantage of other row formats typically requires setting the innodb_file_per_table option so that each table is stored in a separate tablespace S SBT Acronym for system backup to tape See Also system backup to tape 178 selective backup Another name for partial backup See Also partial backup selective restore selective restore Another name for partial restore See Also partial restore selective backup server A MySQL instance controlled by a mysqld daemon A physical machine can host multiple MySQL servers each requiring its own backup operations and schedule Some backup operations communicate with the server through a connection See Also connection instance server repository Contrast with backup repository See Also backup repository repository single file backup A backup technique that packs all the backup data into one file the backup image for ease of storage and transfer The streaming backup technique requires using a single file backup See Also image streaming slave In a replication configuration a database server that receives updates from a master server Typically used to service user queries to minimize the query load on the master With MySQL Enterprise Backup you might take a backup on one server and restore on a different system to create a new slave server with the data already in place You might a
12. Command Line Format sbt environment VARl valuel VAR2 value2 SBT API provider Permitted Values Type string Passes product specific environment variables to Oracle Secure Backup or another SBT compliant backup management product as an alternative to setting and unsetting environment variables before and after each mysqlbackup invocation The parameter to this option is a comma separated list of key value pairs using syntax similar to that of the RMAN tool for the Oracle Database For example sbt environment VAR1 vall VAR2 val2 VAR3 val3 91 Performance Scalability Capacity Options Consult the documentation for your backup management product to see which of its features can be controlled through environment variables For example the Oracle Secure Backup product defines environment variables such as OB_MEDIA_FAMILY OB_DEVICE and OB_RESOURCE_WAIT_TIME You might set such variables with the mysqlbackup by specifying an option such as sbt environment 0B_MEDIA_FAMILY my_mf OB_DEVICE my_tape If the argument string contains any whitespace or special characters recognized by the command shell enclose the entire argument string in quotation marks To escape an equals sign or comma use the character For example sbt environment VAR1 multiple words VAR2 lt angle_brackets gt VAR3 2 2 4 e disable manifest Disable generation of manifest files for a ba
13. Permitted Values Type enumeration 99 Progress Report Options Valid stderr Values stdout file FILENAME fifo FIFONAME table variable The option instructs mysqlbackup to periodically output short progress reports known as progress indicators on its operation The argument of the option controls the destination to which the progress indicators are sent stderr Progress indicators are sent to the standard error stream The report is embedded in a time stamped mysqlbackup INFO message For example 130607 12 22 38 mysqlbackup INFO Progress 191 of 191 MB state Completed stdout Progress indicators are sent to the standard output stream A single newline character is printed after each progress indicator e file FILENAME Progress indicators are sent to a file Each new progress report overwrites the file and the file contains the most recent progress indicator followed by a single newline character e fifo FIFONAME Progress indicators are sent to a file system FIFO A single newline character is printed after each progress indicator Warning E If there is no process reading the FIFO the mysqibackup process hangs at the end of the execution table Progress indicators are sent to the mysql backup_progress table This requires a connection to the MySQL server and therefore only works when backing up a running MySQL instance mysqlbackup f
14. See Also Antelope file format MySQL Enterprise Backup row format system tablespace binary log A file containing a record of all statements that attempt to change table data These statements can be replayed to bring slave servers up to date in a replication scenario or to bring a database up to date after restoring table data from a backup The binary logging feature can be turned on and off although Oracle recommends always enabling it if you use replication or perform backups You can examine the contents of the binary log or replay those statements during replication or recovery by using the mysqlbinlog command For full information about the binary log see The Binary Log For MySQL configuration options related to the binary log see Binary Log Options and Variables For the MySQL Enterprise Backup product the file name of the binary log and the current position within the file are important details To record this information for the master server when taking a backup in a replication context you can specify the slave info option Prior to MySQL 5 0 a similar capability was available known as the update log In MySQL 5 0 and higher the binary log replaces the update log The binary log if enabled on the server is backed up by default See Also binlog relay log replication binlog An informal name for the binary log file For example you might see this abbreviation used in e mail messages or forum discussions See Als
15. Ww N 142 Sample Directory Structure for Full Backup Se eS eS ES ES ee RS eS SS SE Se ea a s Da ee eS ESE Re SE ey ee SE eS SE ee SE UNS sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus sers cirrus pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac pac kups 20 KU KU KU KU KU KU KU K
16. an emergency the time needed to uncompress the backup data before restoring it might be unacceptable There might also be storage issues if there is not enough free space on the database server to hold both the compressed backup and the uncompressed data Thus the more critical the data is the more likely that you might choose not to use compression accepting a slower larger backup to ensure that the restore process is as fast and reliable as possible See Section 5 1 7 Compression Options for information about making compressed backups The unpacking process to restore a single file backup is typically not expensive either in terms of raw speed or extra storage Each file is unpacked directly to its final destination the same as if it was copied individually Thus if you can speed up the backup substantially or decrease its storage requirements by using single file backups that typically does not involve a tradeoff with restore time See Section 5 1 1 5 Work with Single File Backups for information about making single file backups The Apply Log Phase If you store the backup data on a separate machine and that machine is not as busy the machine hosting the database server you can offload some postprocessing work the apply log phase to that separate machine Section 5 1 1 2 Apply Log Operations for Existing Backup Data There is always a performance tradeoff between doing the apply log phase immediately after the initia
17. backup was based has already been restored e Include the incremental option in the command line e Use either the backup dir or incremental backup dir option to specify the incremental backup directory To restore a single file incremental backup besides specifying the location of the incremental backup image with the backup image option also supply with the backup dir or incremental backup di r option the location of a folder that will be used for storing temporary files produced during the restoration process To restore a backup created with the use tts option See the general requirements described in Restoring Backups Created with the use tts Option e When restoring an image backup created with the option setting use tts with minimum locking also supply with the backup di r option the location of a folder that will be used for extracting temporarily all tables in the backup and for performing an app1y 10g operation to make the data up to date before restoring them to the server s data directory e When restoring a backup directory created with the option use tts an apply log operation will be performed on the backup directory That means the backup taken will be altered during the process and users might want to make an extra copy of the backup directory before proceeding with the restoration in order to prevent the loss of backup data in case something goes wrong Also note that
18. conveying An interactive user interface displays Appropriate Legal Notices to the extent that it includes a convenient and prominently visible feature that 1 displays an appropriate copyright notice and 2 tells the user that there is no warranty for the work except to the extent that warranties are provided that licensees may convey the work under this License and how to view a copy of this License If the interface presents a list of user commands or options such as a menu a prominent item in the list meets this criterion 1 Source Code The source code for a work means the preferred form of the work for making modifications to it Object code means any non source form of a work A Standard Interface means an interface that either is an official standard defined by a recognized standards body or in the case of interfaces specified for a particular programming language one that is widely used among developers working in that language The System Libraries of an executable work include anything other than the work as a whole that a is included in the normal form of packaging a Major Component but which is not part of that Major Component and b serves only to enable use of the work with that Major Component or to implement a Standard Interface for which an implementation is available to the public in source code form A Major Component in this context means a major essential component kernel window sys
19. tables that mysqlbackup creates inside the instance allowing you to monitor long running backups and view the results of previous backups The final output section repeats the location of the backup data and provides the LSN values that you might use when you perform an incremental backup next time over the full backup that is just made mysqlbackup user root p backup dir home admin backups backup and apply log MySQL Enterprise Backup version 3 11 1 Linux 2 6 18 274 e15 1686 2014 09 04 Copyright c 2003 2014 Oracle and or its affiliates All Rights Reserved mysqlbackup INFO Starting with following command line mysqlbackup user root p backup dir home admin backups backup and apply log mysqlbackup INFO Enter password mysqlbackup INFO MySQL server version is 5 6 17 log mysqlbackup INFO Got some server configuration information from running server 28 Backing Up an Entire MySQL Instance IMPORTANT Please check that mysqlbackup run completes successfully At the end of a successful backup and apply log run mysqlbackup prints mysqlbackup completed OK 140904 12 34 54 mysqlbackup datadir var lib mysql innodb_data_home_dir innodb_data_file_path ibdatal 12M autoextend innodb_log_group_home_dir var lib mysql innodb_log_files_in_group 2 innodb_log_file_size 50331648 innodb_page_size 16384 innodb_checksum_algorithm innodb innodb_undo_directory var lib m
20. the default For tape backups prefix the image name withsbt See Section 3 3 5 2 Backing Up to Tape for details about tape backups SEC entry PATE Command Line Format src entry PATH Permitted Values Type path name Identifies a file or directory to extract from a single file backup This option is used with the extract command If the argument is a directory all its files and subdirectory contents are extracted No pattern matching expression is allowed for the argument Optionally you can also specify the dst entry option to extract the file or directory in a location different from its original path name For example src entry meta comments txt extracts only one file comments txt while src entry meta extracts the entire directory tree for the meta subdirectory Default All entries are extracted s dst entry PATH Command Line Format dst entry PATH Permitted Values Type path name 90 Single File Backup Options Used with single file backups to extract a single file or directory to a user specified path Use of this option requires specifying the src entry option This option specifies the destination path for the selected entry in backup image corresponding to entry specified by src entry PATH option The entry could point to a single file or single directory For example to retrieve the comments file from a backup image and store it as tmp m
21. threads to perform backup operations in parallel See Section 5 1 11 Performance Scalability Capacity Options for the options to control how many threads are used for different aspects of the restore process 117 Parallel Restore If you see that there is unused system capacity during a restore consider increasing the values for these options and testing whether doing so increases restore performance When tuning and testing backup performance using a RAID storage configuration consider the combination of option settings read threads 3 process threads 6 write threads 3 Compare against the combination read threads 1 process threads 6 writ threads 1 When tuning and testing backup performance using a non RAID storage configuration consider the combination of option settings read threads 1 process threads 6 write threads 1 When you increase the values for any of the 3 threads options also increase the value of the 1limit memory option to give the extra threads enough memory to do their work If the CPU is not too busy less than 80 CPU utilization increase the value of the process threads option If the storage device that you are restoring from the source drive can handle more I O requests increase the value of the read threads option If the storage device that you are restoring to the destination drive can handle more I O requests increase the value of the
22. with examples showing the relevant syntax for the mysqlbackup command It also includes a full syntax reference for the mysqlbackup command 3 1 Before the First Backup The best practices for backups involve planning and strategies This section outlines some of the preparation needed to put such plans and strategies in place 3 1 1 Collect Database Information Before backing up a particular database server for the first time gather some information and decide on some directory names as outlined in the following table Table 3 1 Information Needed to Back Up a Database Where to Find It Default system locations Information to Gather How Used Path to MySQL configuration file This is the preferred way to hardcoded application default locations or from defaults file option in mysqld startup script convey database configuration information to the mysqlbackup command using the defaults file option When connection and data layout information is available from the configuration file you can skip most of the other choices listed below MySQL port MySQL configuration file or mysqld startup script Used to connect to the database instance during backup operations Specified via the 25 Collect Database Information Information to Gather Where to Find It How Used port option of mysqlbackup port is not needed if available from MySQL configuration file N
23. For convenience you can use the incremental base option to automatically derive the necessary log sequence number LSN from the metadata stored in a previous backup directory Or you can specify an explicit LSN value using the start 1sn option using the ending LSN from a previous full or incremental backup To prepare the backup data to be restored you combine each incremental backup with an original full backup Typically you perform a new full backup after a designated period of time after which you can discard the older incremental backup data When running the apply log step for an incremental backup you specify the option sequence incremental apply log and the paths to 2 MySQL configuration files first the cnf file pointing to the full backup that you are updating then the cnf file pointing to the incremental backup data files If you have taken several incremental backups since the last full backup you might run several such apply log steps one after the other to bring the full backup entirely up to date Space Considerations for Incremental Backups The incremental backup feature is primarily intended for InnoDB tables or non InnoDB tables that are read only or rarely updated For non InnoDB files the entire file is included in an incremental backup if that file changed since the previous backup You cannot perform incremental backups with the compress option Incremental backups detect chang
24. PERMITTED BY APPLICABLE LAW EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU SHOULD THE PROGRAM PROVE DEFECTIVE YOU ASSUME THE COST OF ALL NECESSARY SERVICING REPAIR OR CORRECTION So Iba ene iki Ge ici Ey N NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR ANY OTHER PARTY WHO MODIFIES AND OR CONVEYS THE PROGRAM AS PERMITTED ABOVE BE LIABLE TO YOU FOR DAMAGES INCLUDING ANY GENERAL SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 17 Interpretation of Sections 15 and 16 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program unless a warr
25. THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 163 LZ4 License E 6 LZ4 License The following software may be included in this product LZ4 Fast LZ compression algorithm COPE CE ZO 20E Cole BSD 2 Clause License http www opensource org licenses bsd license php Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are mets Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distri ution THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY TREORY Ola KEIABILI TY WHETHER ENS ON TRACI STRICE GINS EME IN ORTO RN INCLUDING NEGLIGENCE OR OTH
26. The alternatives are dir directory_path 82 Incremental Backup Options You specify the prefix dir followed by a directory path The path argument points to the root directory where the data from the previous backup is stored With the first incremental backup you specify the directory holding the full backup with the second incremental backup you specify the directory holding the first incremental backup and so on history last_backup You specify the prefix history followed by 1ast_backup the only valid argument for this mode This makes mysqlbackup query the end_1sn value from the last successful non TTS backup as recorded in the backup_ history table of the server instance that is being backed up it and keeps searching the backup history until it finds the last non TTS backup Note Y If the last full or partial backup made was a TTS backup mysqlbackup skips and then returns its end_1sn value with the no connection option which always turns off the recording of backup history and might cause errors in a subsequent incremental backup Warning E Do not use the history mode if the previous backup was a full backup taken using this mode of the incremental base option start lsn LSN Command Line Format start lsn LSN Permitted Values Type numeric In an incremental backup specifies the highest LSN value included in a previous backup You can get this v
27. aa ee nae eeeeaaeeeeeeaaeeeeeeaaaeeeeeaaaeeeesaaeeees 36 3 3 5 Making a Single File Backup ccccceeceeeeeeeeeeeeee ee aaeaeeeeeeeeeeeeaeaaaaeeeeeeeeeeaeaaaaneneeeees 41 3 3 6 Making an Optimistic Backup ooooccccccconccononncoccnnnononononncnconnnnnnnnnnnnancannan conc nn nnancnnnane 45 3 3 7 Making a Back Up of In Memory Database Data ccooconcccccnoccccconcncccnnnnnnccnnnnanccnnnnnnons 46 3 3 8 Making Scheduled Backups ococococococcccnnccccnononnnnccnnnnnonnnonnanccnnnnncnnnnnnanrrnnnn nr nn nranannin 46 4 Recovering or Restoring a Database oocooonccccccocccnccnnconnncnnnonnnnnnnonnnnnnnnnnnnnnnnnnnnnnnrnnnnnnnrnrnnnnnrnnnnnnns 49 4 1 Preparing the Backup to be Restored cccooocccccnocccccononocccononaccnonnnnccnnnnancncnnnnncccnnnancncnnnancccnns 49 4 2 Performing a Restore Operation cccccceceeeeeeeeeeeeeeee ee ae eae eeeeeeeeeeseaaeaneeeeeeeeeeeaaaaeeeeesereees 50 4 3 Point in Time Recovery from a Hot Backup cccoooncccccnoncccccnonacccnnnnnccnonnnncnnnnnanccnnnnancnnnnnnncinns 53 4 4 Backing Up and Restoring a Single ibd File cece ee eeeeee cece ee ae eeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaa 54 4 5 Restoring a Backup with a Database Upgrade or Downgrade ccceeeeeaeeeeeeeaaeeeeeeaaeeeees 55 5 mysalbackup Command Reference cccceceeeeeeeeeeeeeeeee ee ae aaa eeeeeeeeeeaeaaeaaeeeeeeeeeeeaaaaeeeeeseeeeeeaaaaaaees 57 5 1 mysqlbackup Command Line Options ocoooococccccccnncncnn
28. all its files and subdirectories into the directory tmp my meta 42 Making a Single File Backup mysqlbackup backup image backup my mbi src entry meta dst entry tmp my meta extract Example 3 13 Dealing with Absolute Path Names Since absolute pathnames are extracted to the same paths in local system it could be a problem if you do not have write permission for that path You can remap absolute paths as follows mysqlbackup backup image backup my mbi src entry dst entry myroot extract mysqlbackup backup image backup my mbi src entry extract The first command extracts all absolute paths to myroot directory in the local system The second command extracts all relative paths to the current directory 3 3 5 1 Streaming the Backup Data to Another Device or Server To limit the storage overhead on the database server you can transfer the backup data to a different server without ever storing it locally You can achieve that with a single file backup To send the single file backup to standard output use the mysqlbackup command backup to image without specifying the backup image option You can also specify backup image to make it obvious that the data is sent to stdout To stream the data you use the single file backup in combination with operating system features such as pipes ssh scp and so on which take the input from standard output and create an equivalent file on a remote system Yo
29. and GCC Runtime Library Exception Version 3 1 31 March 2009 Corresponding Source of the work from the predecessor in interest if the predecessor has it or can get it with reasonable efforts You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License For example you may not impose a license fee royalty or other charge for exercise of rights granted under this License and you may not initiate litigation including a cross claim or counterclaim in a lawsuit alleging that any patent claim is infringed by making using selling offering for sale or importing the Program or any portion eye wal Ae 11 Patents A contributor is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based The work thus licensed is called the contributor s contributor version A contributor s essential patent claims are all patent claims owned or controlled by the contributor whether already acquired or hereafter acquired that would be infringed by some manner permitted by this License of making using or selling its contributor version but do not include claims that would be infringed only as a consequence of further modification of the contributor version For purposes of this definition control includes the right to grant patent sublicenses in a manner consistent with the requirements of this License Each contributor grants you
30. and GCC Runtime Library Exception Version 3 1 31 March 2009 rica dotas E 3 GNU Standard C Library libstdc License ooooonnncnnnconococincnnconnnonccnccnnnncn aaaaeeeeeeeeeeeeaeaaeeees E 4 Google Controlling Master Thread I O Rate Patch License ccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeaeaaes E 5 Google SMP Patch License cccceceaceeeeeeee cece ee ae eae teen nese a A aa aa a OAE E A aAA E O AINARE ANA A O E 7 OpenSSL v1 0 LICENSE nica E 8 Percona Multiple I O Threads Patch License cccceeeeeeeeeeeeee tees ee ee ee eeeeeeeeeeaeaaeaneeeeeeeeeaeaae E 9 RegEX Spencer Library License ccceceeeeeee ee eeeceeeeeeeeee ee aaeeeeeeeeeeeeeeaaaaeeeeeeeeeeeaaaaeeneeseeeees E 10 RFC 3174 US Secure Hash Algorithm 1 SHA1 License 0 ceceeeeeeeeeeeeeeeeeeeeeeeeeaaeneeeees Eel ZI Liconsa a a E 1 CURL libcurl License The following software may be included in this product cURL libcurl Use of any of this software is governed by the terms of the license below COPYRIGHT AND PERMISSION NOTICE Copyright c 1996 2014 Daniel Stenberg lt daniel haxx se gt All rights reserved Permission to use copy modify and distribute this software for any purpose with or without fee is hereby granted provided that the above copyright notice and this permission notice appear in all copies THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LI
31. and permission information for backed up files for Linux Unix and OS X systems In the MySQL data directory If you do the backup using a different OS user ID or a different umask setting than applies to the original files you might need to run commands such as chown and chmod on the backup data See Section A 1 Limitations of MySQL Enterprise Backup for details Size of InnoDB redo log files Calculated from the values of the innodb_log_file_size and innodb_log_files_in_group Only needed if you perform incremental backups using the incremental with redo 26 Grant MySQL Privileges to Backup Administrator Information to Gather Where to Find It How Used configuration variables Use the log only option rather than the technique explained for the incremental with redo log on1 y option incremental option The size of the InnoDB redo log and the rate of generation for redo data dictate how often you must perform incremental backups generated Rate at which redo data is Calculated from the values of the InnoDB logical sequence number at different points in time Use the technique explained for the Only needed if you perform incremental backups using the incremental with redo 1og on1 y option rather than the incremental with redo log only option incremental option The size of the InnoDB redo log and the rate of generat
32. and restore operations C 1 Sample Directory Structure for Full Backup Here is an example of the subdirectories and files underneath a typical backup directory The with timestamp option creates a new subdirectory for each backup named according to the timestamp of the job The backups contain the files for the InnoDB system tablespace idb frm MYD MYI CSV and csM files representing table and index data from various storage engines and par and P files representing partitioned tables A A o o A A o O gros Sl aes O os ares aries nes gros ara ares O antes ara o Mars RE find backups sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac sers cirrus bac kups kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kup
33. backup partial restore table partial restore A restore operation that applies to one or more tables or databases but not the entire contents of a MySQL server The data being restored could come from either a partial backup or a full backup Related mysqlbackup options are include tables and xclude tables See Also database full backup partial backup restore table physical backup A backup that copies the actual data files For example the MySQL Enterprise Backup command produces a physical backup because its output contains data files that can be used directly by the mysqld server Contrast with logical backup See Also backup logical backup point in time The time corresponding to the end of a backup operation A prepared backup includes all the changes that occurred while the backup operation was running Restoring the backup brings the data back to the state at the moment when the backup operation completed See Also backup prepared backup restore prepared backup The set of backup data that is entirely consistent and ready to be restored It is produced by performing the apply operation on the raw backup See Also apply raw backup progress table The table mysql backup_progress that holds details of running backup operations When a backup job finishes the details are recorded in the history table See Also backup history table R raw backup The initial set of backup data not yet ready to be restored b
34. backup dir home user dba s3backuptmpdir backup image image to backup dir See Example 4 9 Restoring a Single file Backup from Cloud Storage to a MySQL Server on how to restore a backup image from a cloud storage 44 Making an Optimistic Backup 3 3 6 Making an Optimistic Backup Optimistic backup is a feature introduced in MySQL Enterprise Backup 3 11 for improving performance for backing up and restoring huge databases in which only a small number of tables are modified frequently During a hot backup of a huge database say in the order of terabytes huge redo log files could be generated on the server when the backup is in progress As the redo log files grow faster than they can be processed by mysqlbackup the backup operation can actually fail when mysq1backup cannot catch up with the redo log cycles and LSNs get overwritten by the server before they are read by mysqlbackup Moreover the app1y 1o0g step for preparing a backup for restoration can take a very long time as mysqlbackup has huge ibbackup_logfile files created from the big redo log files to apply to the backup The problems are intensified when the I O resources available for reading and writing the redo logs are scarce during the backup and restoration processes Optimistic backup relieves the problems by dividing the backup process into two internal phases which are transparent to the users 1 Optimistic phase In this first phase tables th
35. backup dir we specified The directory name for each new backup is formed from the date and the clock time when the backup run was started in the local time zone The backup directory contains the backed up ibdata files and ibbackup_logfile Each subdirectory corresponds to a MySQL database and contains copies of frm MYD MYI and similar files For an example of the layout of such a backup directory see Section C 1 Sample Directory Structure for Full Backup 3 2 2 Verifying a Backup To verify the backup restore the backup data on a different server and run the MySQL daemon mysq1d on the new data directory Then you can execute SHOW statements to verify the database and table structure and execute queries to verify the number of rows latest updates and so on This is the same general technique to use when you intend to put the backup data to some other use For example you might set up a replication slave by making a backup of the master server or turn a backup into a new MySQL instance for running report queries datadi r pointing to the backup directory The SQL statements you use to verify the data change the underlying logical sequence number which would interfere with Note Y Always do verification against restored data rather than running mysqld with using the backup directory for subsequent incremental backups 30 Restoring a Database at its Original Location If you did the backup with the backup and a
36. because you created a high volume of InnoDB data before turning on the innodb_file_per_table setting you might use mysq1dump to dump the entire instance then turn on innodb_file_per_table before re creating it so that all the table data is kept outside the system tablespace 11 3 Can I back up non InnoDB data with MySQL Enterprise Backup While MySQL Enterprise Backup can back up non InnoDB data like MYISAM tables the MySQL server to be backed up must support InnoDB i e the backup process will fail if the server was started up with the innodb 0FF or skip innodb option and the server must contain at least one InnoDB table 11 4 What happens if apply step is interrupted 129 If the mysqlbackup command is interrupted during the appl y log or apply incremental backup stage the backup data is OK The file operations performed by those options can be performed multiple times without harming the consistency of the backup data Just run the same mysq1backup command again and when it completes successfully all the necessary changes are present in the backup data 11 5 Why is the option defaults file not recognized When you specify the defaults file option it must be the first option after the name of the command Otherwise the error message makes it look as if the option name is not recognized 11 6 Can I back up a database on one OS platform and restore it on another one using MySQL Enterprise Back
37. efficiency and flexibility when backing up InnoDB tables it can also back up MyISAM and other kinds of tables It is included as part of the MySQL Enterprise Edition subscription See Also Barracuda hot backup InnoDB mysqlbackup The primary command of the MySQL Enterprise Backup product Different options perform backup and restore operations 175 See Also backup restore mysqldump A MySQL command that performs logical backups producing a set of SQL commands to recreate tables and data Suitable for smaller backups or less critical data because the restore operation takes longer than with a physical backup produced by MySQL Enterprise Backup See Also logical backup physical backup restore N non TTS backup A backup that is NOT created using transportable tablespace TTS that is not with the use tts option See Also transportable tablespace O opt file A file containing database configuration information Files with this extension are always included in backups produced by the backup operations of the MySQL Enterprise Backup product offline A type of operation performed while the database server is stopped With the MySQL Enterprise Backup product the main offline operation is the restore step You can optionally perform a cold backup which is another offline operation Contrast with online See Also cold backup online restore online A type of operation performed while the database server is running
38. extracts all contents from a single file backup into the current working directory mysqlbackup backup image var my mbi extract Example 3 10 Extract Single File Backup into a Backup Directory This command behaves like the image to backup dir option by extracting all contents of a single file backup into the backup dir directory mysqlbackup backup image var my mbi backup dir var backup extract Example 3 11 Selective Extract of Single File The following command extracts the single file met a comment s txt into the local path meta comments txt mysqlbackup backup image var my mbi src entry meta comments txt extract The following command extracts the meta comments txt file into a specified path tmp mycomments txt by using the dst ent ry option mysqlbackup backup image var my mbi src entry meta comments txt dst entry tmp mycomments txt extract The following command dumps the contents of meta comments txt inside a single file backup to standard output mysqlbackup backup image var my mbi src entry meta comments txt dst entry extract Example 3 12 Selective Extract of Single Directory The following command extracts a single directory meta into a local file system path meta Extracting a directory extracts all its contents including any subdirectories mysqlbackup backup image backup my mbi src entry meta extract The following command extracts all met a directory contents
39. files that are included with an incremental backup can be used for a point in time recovery PITR which restores a database to its state Saved under the datadir directory under the backup directory Use the skip binlog option to exclude binary logs in the backup For MySQL 5 5 and earlier as well as all offline backups use the 1og bin index option to specify the absolute path of the index file on the MySQL server that lists all the used binary log files if it is different from the default value of the option for mysqibackup to 10 Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes relay log files at a certain point in time after the last full backup See Section 4 3 Point in Time Recovery from a Hot Backup for details Relay log files from a slave server which are included in a backup of a slave server by default except when the backup is created with the use tts option Their inclusion saves the time and resources required for fetching the relay logs from the master when the slave is being restored find the binary log files and include them in the backups E Note Due to some known issues users should always use the skip binlog option when creating offline backups or when creating an incremental backup that is based ona full backup created with the AE locking option See Appen
40. following command restores all tables in the sales database from the backup but excludes the table with the name hardware mysqlbackup socket tmp restoreserver sock datadir logs restoreserverdata backup dir logs backup include tables sales exclude tables sales hardware copy back and apply log See Restoring Backups Created with the use tts Option for the special requirements that apply when you restore selected tables from a TTS backup Example 4 9 Restoring a Single file Backup from Cloud Storage to a MySQL Server Restore a backup image from cloud storage to datadi r on the server using the backup di r option to specify the temporary directory into which the image will be extracted see Section 5 1 15 Cloud Storage Options for information on the cloud service options 52 Restoring Backups Created with the use tts Option mysqlbackup defaults file bkups backupdir backupmy cnf cloud service s3 cloud aws region lt aws region gt cloud access key id lt aws access key id gt cloud secret access key lt aws secret access key gt cloud bucket lt s3 bucket name gt cloud object key lt aws object key gt backup dir home user dba s3backuptmpdir datadir home user dba datadir backup image copy back and apply log Restoring Backups Created with the use tts Option There are some special requirements for restoring ba
41. freely subject to the following restrictions 1 The origin of this software must not be misrepresented you must not claim that you wrote the original software If you use this software in a product an acknowledgment in the product documentation would be appreciated but is not required 2 Altered source versions must be plainly marked as such and must not be misrepresented as being the original software 3 This notice may not be removed or altered from any source distribution Jean loup Gailly jloup gzip org Mark Adler madler alumni caltech edu 168 MySQL Enterprise Backup Glossary These terms are commonly used in information about the MySQL Enterprise Backup product A ARM file Metadata for ARCHIVE tables Contrast with ARZ file Files with this extension are always included in backups produced by the mysq1backup command of the MySQL Enterprise Backup product See Also ARZ file ARZ file Data for ARCHIVE tables Contrast with ARM file Files with this extension are always included in backups produced by the mysq1backup command of the MySQL Enterprise Backup product See Also ARM file Antelope The code name for the original InnoDB file format It supports the redundant and compact row formats but not the newer dynamic and compressed row formats available in the Barracuda file format If your application could benefit from InnoDB table compression or uses BLOBs or large text columns that could benefit from th
42. has meaning if Amazon S3 is used for cloud backup In order to perform cloud backups and restores with the bucket the user identified by the c loud access key id option must have at least the following permissions on the bucket e s3 ListBucket For listing information on items in the bucket e s3 ListBucketMultipartUploads For listing multipart uploads in progress to the bucket 103 Options for Special Backup Types e s3 GetObject For retrieving objects from the bucket e s3 PutOb ject For adding objects to the bucket cloud object key The Amazon S3 object key for the backup image The option only has meaning if Amazon S3 is used for cloud backup cloud access key id AWS access key ID for logging onto Amazon S3 The option only has meaning if Amazon S3 is used for cloud backup cloud secret access key AWS secret access key that goes with the AWS access key id used in cloud access key id The option only has meaning if Amazon S3 is used for cloud backup cloud aws region Region for Amazon Web Services that mysqlbackup accesses for S3 The option only has meaning if Amazon S3 is used for cloud backup 7 cloud trae Print trace information for cloud operations It works independently of trace 72 which specifies the trace level for the non cloud operations of mysqibackup Any non zero value for the option enables the trace function Default value is 0 cloud p
43. i e the backup process will fail if the server was started up with the innodb 0FF or skip innodb option and the server must contain at least one InnoDB table Note Y While MySQL Enterprise Backup can back up non InnoDB data like MYISAM MyISAM tables and these other types of files cannot be backed up in the same non blocking way as InnoDB tables can This phase is a warm backup changes to these tables are prevented while they are being backed up possibly making the database unresponsive for a time but no shutdown is required during the backup Note Y To avoid concurrency issues during backups of busy databases you can use the only innodb or only innodb with frm option to back up only InnoDB tables and associated data Generated Files Included in the Backup The backup data includes some new files that are produced during the backup process These files are used to control later tasks such as verifying and restoring the backup data The files generated during the backup process include backup my cnf Records the crucial configuration parameters that apply to the backup These parameter values are used during a restore operation so that the original values are used regardless of changes to your my cnf file in the meantime meta backup_create xml Lists the command line arguments and environment in which the backup was created meta backup_content xml Essential metadata for the files and database definitions o
44. include incremental incremental with redo log only only innodb or only innodb with frm options A management tool might compare the checksum recorded in the manifest for a single file backup against the checksum for the file after the single file backup is unpacked The file also contains details of all the plugins defined on the backed up server by which users should make sure the same plugins are defined in the same manner on the target server for restoration 126 Using the MySQL Enterprise Backup Manifest e image_files xml information about the files in a single file backup Only produced for backups taken with the backup to image and backup dir to image options A management tool might use the paths recorded in this file to plan or automate the unpacking of a single file backup using the image to backup dir or extract options or to remap the paths of extracted files with the src entry and dst ent ry options 127 128 Chapter 11 Frequently Asked Questions for MySQL Enterprise Backup This section lists some common questions about MySQL Enterprise Backup with answers and pointers to further information Questions e 11 1 129 Does MySQL Enterprise Backup work with MySQL Server version x y z e 11 2 129 What is the big ibdata file that is in all the backups e 11 3 129 Can back up non InnoDB data with MySQL Enterprise Backup e 11 4 129 What happens if apply step is i
45. index it wastes space to define primary keys composed of numerous or lengthy columns or multiple secondary indexes with different permutations of the same columns The Apply Log Phase If you store the backup data on a separate machine and that machine is not as busy the machine hosting the database server you can offload some postprocessing work the apply log phase to that separate machine Section 5 1 1 2 Apply Log Operations for Existing Backup Data There is always a performance tradeoff between doing the apply log phase immediately after the initial backup makes restore faster or postponing it until right before the restore makes backup faster In an emergency restore performance is the most important consideration Thus the more crucial the data is the more important it is to run the apply log phase immediately after the backup Either combine the backup and apply log phases on the same server by specifying the backup and appl1y 1o0g option or perform the fast initial backup transfer the backup data to another server and then perform the apply log phase using one of the options from Section 5 1 1 2 Apply Log Operations for Existing Backup Data 7 2 Optimizing Restore Performance This section describes the performance considerations for restoring a database with MySQL Enterprise Backup This subject is important because The restore operation is the phase of the backup restore cycle that tends to vary substantia
46. located relative to the backup_dir path Any data files specified with absolute paths are placed inside the backup_innodb_data_home directory When the parameter is not specified it inherits the value from the value of the innodb_data_file_path option If both source and destination attempt to use an absolute path that resolve to the same files the backup is cancelled To specify absolute paths for InnoDB datafiles in backup you must also set the backup_innodb_data_home option to backup_innodb_log_group_home_dir PATH Specifies where backup InnoDB logs live Usually the same as backup di r but can be different The names of the log files are fixed and not reconfigurable This parameter is applicable only for backup operations not restore The backup operation uses this value and writes it as innodb_log_group_home_dir value in backup my cnf For copy back and apply log operations innodb_log_group_home_dir in backup my cnf is treated in a way that is compatible with how it was created backup_innodb_log_files_in_group N 77 Backup Repository Options Specifies the number of InnoDB log files in backup before being rotated Example 5 Usually same as innodb_log_files_in_group but can be different The value for this parameter is derived as e Specified backup_innodb_log_files_in_group value from command line or configuration file e Else innodb_log_files_in_group value from the database co
47. location to set up a new replication slave with the data from a master server or to clone a database for reporting purposes See Chapter 4 Recovering or Restoring a Database for instructions on restoring databases 17 18 Chapter 2 Installing MySQL Enterprise Backup Install the MySQL Enterprise Backup product on each database server whose contents you intend to back up You perform all backup and restore operations locally by running the mysq1backup command on the same server as the MySQL instance Optional You can also install the MySQL Enterprise Backup product on computers other than the database server only to run mysqlbackup with the apply log option See Section 5 1 1 2 Apply Log Operations for Existing Backup Data for information about bringing backup data to a separate server and running the apply log step there The MySQL Enterprise Backup product is packaged as either an archive file t gz archived with tar and compressed with gzip or as a platform specific installer Installing on Unix and Linux Systems For all Linux and Unix systems the product is available as a tgz file Unpack this file as follows tar xvzi package tgz The mysqlbackup command is unpacked into a subdirectory You can either copy them into a system directory preserving their execute permission bits or add to your PATH setting the directory where you unpacked it Note Y On FreeBSD 10 1 there is a dependency for
48. mysqlbackup INFO Backup Image validation successful mysqlbackup INFO Source Image Path logs img bi mysqlbackup completed OK This is a sample output for a checksum mismatch in the header mysqlbackup ERROR Checksum mismatch Computed checksum Checksum in image mysqlbackup ERROR Problem verifying checksum Image Path meb backups image mbi mysqlbackup ERROR Backup image validation failed This is a sample output for an image containing corrupted ibd files mysqlbackup ERROR datadir db2 bigtabl ibd has corrupt page number 64 page number from page header mysqlbackup ERROR datadir db2 bigtabl ibd is corrupt and has 10 corrupt pages mysqlbackup ERROR datadir db2 t1 ibd has corrupt page number 4 page number from page header mysqlbackup ERROR datadir db2 t1 ibd is corrupt and has 5 corrupt pages mysqlbackup ERROR datadir ibdatal has corrupt page number 63 page number from page header mysqlbackup ERROR datadir ibdatal has corrupt page number 7 page number from page header mysqlbackup ERROR datadir ibdatal is corrupt and has 10 corrupt pages mysqlbackup failed with errors This is a sample output for a successful validation for a compressed backup directory mysqlbackup INFO backups backup dir datadir tpch tabnorm5 ibz Validated mysqlbackup INFO backups backup dir datadir tpch tabnorm6 ibz Validated mysqlbackup INFO backups backup dir datadir tpch tabnorm7 ibz Validat
49. of numbered files containing events that describe database changes and an index file that contains the names of all used relay log files For more information on relay log see The Slave Relay Log The relay log on a server is backed up by default See Also binary log replication replication A common configuration for MySQL deployments with data and DML operations from a master server synchronized with a set of slave servers With MySQL Enterprise Backup you might take a backup on one server and restore on a different system to create a new slave server with the data already in place You might also back up data from a slave server rather than the master to minimize any slowdown of the overall system See Also master slave repository We distinguish between the server repository and the backup repository See Also backup repository server repository restore The converse of the backup operation The data files from a prepared backup are put back into place to repair a data issue or bring the system back to an earlier state See Also backup prepared backup row format The disk storage format for a row from an InnoDB table As InnoDB gains new capabilities such as compression new row formats are introduced to support the resulting improvements in storage efficiency and performance Each table has its own row format specified through the ROW_FORMAT option To see the row format for each InnoDB table issue the command SHOW TABLE STATUS
50. of the backup run mysqlbackup pings the server after copying each database to keep the connection alive Important A Although the mysq1backup command backs up InnoDB tables without interrupting database use the final stage that copies non InnoDB files such as MyISAM tables and frm files temporarily puts the database into a read only state using the statement FLUSH TABLES WITH READ LOCK For best backup performance and minimal impact on database processing 1 Do not run long SELECT queries or other SQL statements at the time of the backup run 2 Keep your MyISAM tables relatively small and primarily for read only or read mostly work Then the locked phase at the end of a mysqibackup run is short maybe a few seconds and does not disturb the normal processing of mysqld much If the preceding conditions are not met in your database application use the on1y innodb option to back up only InnoDB tables or use the no 1ocking option to back up non InnoDB files Note that MyISAM frm and other files copied under the no 1ocking setting cannot be guaranteed to be consistent if they are updated during this final phase of the backup Fora large database a backup run might take a long time Always check that mysqlbackup has completed successfully either by verifying that the mysqlbackup command returned exit code 0 or by observing that mysqlbackup has printed the text mysqlbackup completed OK e The mys
51. of the database is retrieved automatically through a database connection For a cold backup you must specify file locations through configuration files or command line options 1 2 The mysqlbackup Command When using the MySQL Enterprise Backup product you primarily work with the mysqlbackup command Based on the options you specify this command performs all the different types of backup operations and restore operations too mysqlbackup can do other things that you would otherwise code into your own backup scripts such as creating a timestamped subdirectory for each backup compressing the backup data and packing the backup data into a single file for easy transfer to another server For usage information about mysqlbackup features see Chapter 3 Backing Up a Database Server For option syntax see Chapter 5 mysqlbackup Command Reference 1 3 Overview of Backup Performance and Capacity Considerations In your backup strategy performance and storage space are key aspects You want the backup to complete quickly with little CPU overhead on the database server You also want the backup data to be compact so you can keep multiple backups on hand to restore at a moment s notice Transferring the backup data to a different system should be quick and convenient All of these aspects are controlled by options of the mysqlbackup command Sometimes you must balance the different kinds of overhead CPU cycles storage space and network traffic
52. option is required for both turning on message logging and for supplying the path name of a directory in which to save the log file However if the skip messages 1ogdir option is also specified it takes precedence and message logging is skipped The following are some examples showing how the message logging is controlled This creates a log file for the backup operation in the directory home backup_dir meta due to the default settings SMYSQLBACKUP uroot port 3306 backup dir home backup_dir backup This skips message logging for the backup operation SMYSQLBACKUP uroot port 3306 backup dir home backup_dir skip messages logdir backup This creates a log file for the app1y 10g operation in an existing directory named home teelog_dir rather than the default location SMYSQLBACKUP uroot port 3306 backup dir home backup_dir messages logdir home teelog_dir apply log This creates a log file for the 1ist image operation in an existing directory named home teelog_dir SMYSQLBACKUP uroot port 3306 backup image backup my mbi messages logdir home teelog_dir list image 5 1 13 Progress Report Options There are two options for controlling the progress reporting function of mysq1backup show progress and progress interval E show progress stderr stdout file FILENAME fifo FIFONAME tablel variable Command Line Format show progress destinations
53. or LZMA algorithm it is ignored when any other algorithms are selected by the compress method option Default 1 lowest and fastest compression Explicitly specifying a non zero value through a configuration file or command line automatically enables the compress option uncompress When used with the apply log or copy back and apply 10g operation uncompresses the compressed backup before applying the InnoDB log 5 1 8 Incremental Backup Options For an overview of incremental backups and usage information about these options see Section 3 3 2 Making an Incremental Backup To take an incremental backup specify the incremental or incremental with redo 1og only along with the incremental backup dir All InnoDB data modified after the specified LSN 80 Incremental Backup Options is copied in the incremental backup Depending on the choice of incremental or incremental with redo log on1y other options are required or recommended e incremental Specifies that the associated backup or backup to image operation is incremental Also requires either the incremental base option or the combination of the start 1sn and incremental backup dir options The incremental aspect applies only to InnoDB tables By default all non InnoDB and frm files are also included in incremental backup To exclude non InnoDB data in an incremental backup use the only innodb o
54. process will fail Use the skip relaylog option if you expect a FLUSH LOGS statement will be run during the backup and it is not necessary to include the relay logs in the backup log bin index PATH Command Line Format log bin index F ILENAME Permitted Values Type file name Default data_dir host_name bin index For MySQL 5 5 and earlier as well as all offline backups specify the absolute path including filename and extension of the index file on the MySQL server that lists all the used binary log files if it is different from the default path given below in order to include the binary log files in the backup Default data_dir host_name bin index relay log index PATH Command Line Format relay 1log index FILENAME 96 Performance Scalability Capacity Options Permitted Values Type file name Default data_dir host_name relay bin index For offline backups of salve servers only specify the absolute path including filename and extension of the index file on the MySQL server that lists all the used relay log files if it is different from the default path given below in order to include the relay log files in the backup Default data_dir host_name relay bin index master info file PATH Command Line Format master info file FILENAME Permitted Values Type file name Default data_dir master info For offl
55. product includes cryptographic software written by Eric Young eay cryptsoft com This product includes software written by Tim Hudson tjh cryptsoft com Original SSLeay License L Copyright Cc 1995 1998 Bric Young Jeayleryptseft com All rights reserved This package is an SSL implementation written by Eric Young eay cryptsoft com The implementation was written so as to conform with Netscapes SSL This library is free for commercial and non commercial use as long as the following conditions are aheared to The following conditions apply to all code found in this distribution be it the RC4 RSA lhash DES etc code not just the SSL code The SSL documentation included with this distribution is covered by the same copyright terms except that the holder is Tim Hudson tjh cryptsoft com Copyright remains Eric Young s and as such any Copyright notices in the code are not to be removed If this package is used in a product Eric Young should be given attribution as the author of the parts of the library used This can be in the form of a textual message at program startup or in documentation online or textual provided with the package Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met 1 Redistributions of source code must retain the copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form
56. storage engines Example 3 1 Making an Uncompressed Partial Backup of InnoDB Tables In this example we have configured MySQL so that some InnoDB tables have their own tablespaces We make a partial backup including only those InnoDB tables in test database whose name starts with ib The contents of the database directory for test database are shown below The directory contains a MySQL description file frm file for each of the tables alex1 alex2 alex3 blobt3 ibstestO ibstest09 ibtestlla ibtestllb ibtest11c and ibtest11d in the database Of these 10 tables six alex1 alex2 alex3 blobt3 ibstest0 ibstest09 are stored in per table data files ibd files ls sqldata mts test alexl frm alex2 ibd blobt3 frm ibstest0 ibd ibtestlla frm ibtestlld frm alexl ibd alex3 frm blobt3 ibd ibtest09 frm ibtestllb frm alex2 frm alex3 ibd ibstestO frm ibtest09 ibd ibtestllc frm We run the mysqlbackup with the include option Back up some InnoDB tables but not any frm files 39 Making a Partial Backup mysqlbackup defaults file home pekka my cnf include testl ib only innodb backup Many lines of output mysqlbackup Scanned log up to lsn 2666737471 mysqlbackup Was able to parse the log up to lsn 2666737471 mysqlbackup Maximum page number for a log record 0 101208 17 17 45 mysqlbackup Full backup completed Back up some InnoDB tables and the frm files for the backed up t
57. successfully 140904 12 35 03 mysqlbackup INFO Backup created in directory home admin backups 140904 12 35 03 mysqlbackup INFO MySQL binlog position filename mysqld bin 000001 position 120 Start Leh e GOs End LSN e 1611237 mysqlbackup INFO Creating 14 buffers each of size 65536 140904 12 35 03 mysql backup INFO Apply log operation starts with following threads 1 read threads 1 process threads mysqlbackup INFO Using up to 100 MB of memory 140904 12 35 03 mysqlbackup INFO ibbackup_logfile s creation parameters Srece lem 1610752 eme Wei LEAS start checkpoint 1611237 mysqlbackup INFO InnoDB Starting an apply batch of log records to the database Mn D Bisa oOgues SiS con IS LI SS lee nO SO OS ASAS 27 28 29 3 mysqlbackup INFO InnoDB Setting log file size to 50331648 mysqlbackup INFO InnoDB Setting log file size to 50331648 40904 12 35 14 mysqlbackup INFO We were able to parse ibbackup_logfile up to lam IGSS mysqlbackup INFO Last MySQL binlog file position 0 120 file name mysqld bin 000001 120 40904 12 35 14 mysqlbackup INFO The first data file is home admin backups datadir ibdatal and the new created log files are at home admin backups datadir 40904 12 35 14 mysqlbackup INFO Apply log operation completed successfully 40904 12 35 14 mysqlbackup INFO Full backup prepared for recovery successfully mysqlbackup completed OK Now the backup subdirectory is created under the
58. such 14 Revised Versions of this License The Free Software Foundation may publish revised and or new versions of the GNU General Public License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Program specifies that a certain numbered version of the GNU General Public License or any later version applies to it you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation If the Program does not specify a version number of the GNU General Public License you may choose any version ever published by the Free Software Foundation If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used that proxy s public statement of acceptance of a version permanently authorizes you to choose that version for the Program Later license versions may give you additional or different permissions However no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version 15 Disclaimer of Warranty 158 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 THERE IS NO WARRANTY FOR THE PROGRAM TO THE EXTENT
59. table_name are matched by the regular expression are taken as busy tables which will be backed up in the second or the normal phase of the backup Tables whose fully qualified names are NOT matched by the regular expression are taken as inactive tables which will be backed up in the first or the optimistic phase of the backup See Section 3 3 6 Making an Optimistic Backup for details on the concept use cases and command samples for an optimistic backup MySQL Enterprise Backup will throw an error if the option is used but no regular expression is supplied with it When both the optimistic time and the optimistic busy tables options are used and they come into conflict on determining which tables are to be optimistic optimistic busy tables takes precedence over optimistic time 5 1 12 Message Logging Options mysqlbackup writes important progress and error information to the stderr stream The information is often very valuable for tracking down problems that occur during an operation Starting from MySQL Enterprise Backup 3 9 the output to the stderr stream is also saved to a log file by default for most mysqlbackup operations so that the error information can be easily accessed in any debug process The message logging works like a tee process on a Unix like system in which the output of a program is split to be both displayed and saved to a file The log file thus produced is named in the followi
60. threads 6 write threads 3 Compare against the combination read threads 1 process threads 6 writ threads 1 e When tuning and testing backup performance using a non RAID storage configuration consider the combination of option settings read threads 1 process threads 6 write threads 1 e When you increase the values for any of the 3 threads options also increase the value of the 1limit memory option to give the extra threads enough memory to do their work e If the CPU is not too busy less than 80 CPU utilization increase the value of the process threads option e If the storage device that you are backing up from the source drive can handle more I O requests increase the value of the read threads option e If the storage device that you are backing up to the destination drive can handle more I O requests increase the value of the write threads option Depending on your operating system you can measure resource utilization using commands such as top iostat sar dtrace or a graphical performance monitor Do not increase the number of read or write threads iowait once the system iowait value reaches approximately 20 MyISAM Considerations Important A e Although the mysqlbackup command backs up InnoDB tables without interrupting database use the final stage that copies non InnoDB files such as 114 Network Performance MyISAM tables and frm files temporari
61. to lock tables Connected to mysqld server 40904 12 34 59 mysqlbackup INFO Starting to lock all the tables 40904 12 35 00 mysqlbackup INFO All tables are locked and flushed to disk 40904 12 35 00 mysqlbackup INFO Opening backup source directory var lib mysql 40904 12 35 00 mysqlbackup INFO Starting to backup all non innodb files in subdirectories of var lib mysql 40904 12 35 00 mysqlbackup INFO Copying the database directory performance_schema 40904 12 35 01 mysqlbackup INFO Completing the copy of all non innodb files 40904 12 35 01 mysqlbackup INFO Completed the copy of binlog files 40904 12 35 02 mysqlbackup INFO A copied database page was modified at 1611237 This is the highest lsn found on page Scanned los us to lem 1112372 Was able to parse the log up to lsn 1611237 Maximum page number for a log record 0 INFO MEB logfile created at home admin backups meta MEB_2014 09 04 12 34 54 140904 12 35 02 mysqlbackup 140904 12 35 02 mysqlbackup INFO All tables unlocked INFO All MySQL tables were locked for 2 530 seconds 29 Verifying a Backup 140904 12 35 03 mysqlbackup INFO Reading all global variables from the server 140904 12 35 03 mysqlbackup INFO Completed reading of all global variables from the server 140904 12 35 03 mysqlbackup INFO Creating server config files server my cnf and server all cnf in home admi 140904 12 35 03 mysqlbackup INFO Full Backup operation completed
62. use for publicity purposes of names of licensors or authors of the material or e Declining to grant rights under trademark law for use of some trade names trademarks or service marks or f Requiring indemnification of licensors and authors of that material by anyone who conveys the material or modified versions of it with contractual assumptions of liability to the recipient for any liability that these contractual assumptions directly impose on those licensors and authors All other non permissive additional terms are considered further restrictions within the meaning of section 10 If the Program as you received it or any part of it contains a notice stating that it is governed by this License along with a term that is a further restriction you may remove that term If a license document 155 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 contains a further restriction but permits relicensing or conveying under this License you may add to a covered work material governed by the terms of that license document provided that the further restriction does not survive such relicensing or conveying If you add terms to a covered work in accord with this section you must place in the relevant source files a statement of the additional terms that apply to those files or a notice indicating where to find the applicable terms Additional terms permis
63. use tools like OpenSSL openssl rand 32 hex 8f3ca b850ec6366f4a54feba99 f2dc42fa79577158911fe8cad641ffffle63d6 To put an OpenSSL generated key into a key file you can do the following openssl rand 32 hex gt keyfile cat keyfile 6ald325e6e 0577 3400b7cd624ae574f5186d0da2eeb946895de418297ed75b The encryption function uses MySQL Enterprise Backup s own encryption format decryption is possible only by using MySQL Enterprise Backup For Unix like operating systems different magic numbers are used to identify encrypted and unencrypted backup files For examples you can add these lines to the etc magic file of your operating system 0 string MBackuP n MySQL Enterprise Backup backup image 0 string MebEncR n MySQL Enterprise Backup encrypted backup The file command can then be used to identify the file types file backups imagel backups image2 backups imagel MySQL Enterprise Backup backup image backups image2 MySQL Enterprise Backup encrypted backup The command options used for encryption and decryption are encrypt decrypt key and key file These options can be used with various operations on backup images See Section 5 1 14 Encryption Options for details The following is a sample command for creating an encrypted backup mysqlbackup backup image backups image enc encrypt key 23D987F3A047B475C900127148F 9E0394857983645192874A2B3049570C12A34 backup dir var tmp backup backup to im
64. versions of a program to make sure it remains free software for all its users We the Free Software Foundation use the GNU General Public License for most of our software it applies also to any other work released this way by its authors You can apply it to your programs too When we speak of free software we are referring to freedom not price Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software and charge for them if you wish that you receive source code or can get it if you want it that you can change the software or use pieces of it in new free programs and that you know you can do these things To protect your rights we need to prevent others from denying you these rights or asking you to surrender the rights Therefore you have certain responsibilities if you distribute copies of the software or if you modify it responsibilities to respect the freedom of others For example if you distribute copies of such a program whether gratis or for a fee you must pass on to the recipients the same freedoms that you received You must make sure that they too receive or can get the source code And you must show them these terms so they know their rights Developers that use the GNU GPL protect your rights with two steps 1 assert copyright on the software and 2 offer you this License giving you legal permission to copy distribute and or MOCHE Wien For th
65. 011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 eo e e ee oe o e e o e o ee o e e e e o e e eo o e ee Me o e e ee o e ee o o e e oo o e ero Me o Me e eo o e e e e o e e eo o Ww
66. 1 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 0 33 47 datadir mysql help_relation MYI 0 33 47 datadir mysql he
67. 1l server password value short option pi connect_timeout s5 Enable SSL for connection ssl key file_name ssl cert file_name ssl ca file_name ssl capath directory_name ssl cipher cipher Imst ssl verify server cert Connection Options Specific to mysqlbackup no connection connect if online Most other connection parameters used by the mysql command are recognized but silently ignored Unknown connection parameters cause the mysq1backup command to stop The following connections options are specific to mysqlbackup no connection The no connection option supersedes the other connection options and uses file level operations to perform the backup When you use this option you must specify in the configuration file or on the command line many options whose values are normally retrieved automatically through the database connection Warning E This option also turns on the no history 1ogging and no 1locking options which might result in inconsistencies in non InnoDB data if the tables are modified during the backup operation It might also affect subsequent incremental backups see the description for the incremental base option for details 73 Server Repository Options connect if onlin By default a database connection is used for backup operations both during the initial stage to retrieve source repository configuration and to lock tables while copyin
68. 2638548215 We specify that number again in the command here the incremental backup includes all changes that came after the specified LSN UV mysqlbackup defaults file home pekka my cnf incremental start lsn 2638548215 incremental backup dir incr backup 2010 12 08_17 14 48 backup dir full backup 2010 12 08_17 14 11 backup Many lines of output mysqlbackup Scanned log up to lsn 2654252454 mysqlbackup Was able to parse the log up to lsn 2654252454 mysqlbackup Maximum page number for a log record 0 mysqlbackup Backup contains changes from lsn 2638548216 to lsn 2654252454 101208 17 12 24 mysqlbackup Incremental backup completed Next steps e Make a note of the LSN value in the message at the end of the backup for example mysqlbackup Was able to parse the log up to lsn LSN_number You specify this value when performing incremental backups of changes that occur after this incremental backup e Apply the incremental backup to the backup files so that the backup is ready to be restored at any time You can move the backup data to a different server first to avoid the CPU and I O overhead of this operation on the database server itself e On a regular schedule determined by date or amount of database activity take further take incremental backups Optionally periodically start the cycle over again by taking a full uncompressed or compressed backup Typically this milestone happens when you can a
69. 3 key file option 103 L limit memory option 94 list image option 71 90 locking 174 log 7 65 174 log bin index 96 logical backup 6 174 logs of backup operations 124 LSN 32 80 174 M manifest 7 92 126 175 master 110 175 master info file 97 media management software 175 media management software MMS products 121 MEMORY tables 46 message logging 98 meta directory 7 MMS products 121 monitoring backup jobs 123 MRG file 175 my cnf 175 my ini 175 MYD file 7 MYD file 175 MYI file 7 MYI file 175 MyISAM 175 MyISAM tables 57 MySQL Enterprise Backup 175 MySQL Enterprise Monitor 123 mysqlbackup 57 175 and media management software MMS products 121 configuration options 105 examples 31 files produced 7 182 modes of operation 64 options 59 overview 6 required privileges 27 using 25 mysqlbinlog command 53 mysqldump 46 176 N no history logging option 79 no locking option 95 non TTS backup 176 number of buffers option 92 O offline 176 on disk full option 95 online 176 only innodb option 86 only innodb option 88 only known file types option 85 opt file 7 176 optimistic backup 176 optimistic busy tables 98 optimistic time 97 options mysqlbackup 59 connection 72 for cloud storage 103 for compression 79 for controlling backup overhead performance and scalability 92 for controlling message logging
70. 3 provided that all Target Code was generated by Eligible Compilation Processes You may then convey such a combination under terms of your choice consistent with the licensing of the Independent Modules 2 No Weakening of GCC Copyleft The availability of this Exception does not imply any general presumption that third party software is unaffected by the copyleft requirements of the license of GCC E 3 GNU Standard C Library libstdc License The following software may be included in this product GNU Standard C Library libstdc This component is licensed under Section E 2 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 Additional notices Copyright c 1994 Hewlett Packard Company Permission to use copy modify distribute and sell this software and its documentation for any purpose is hereby granted without fee provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation Hewlett Packard Company makes no representations about the suitability of this software for any purpose It is provided as is without express or implied warranty Casyiiciae e 1996 1997 Silicon Graphics Computer Systems Inc Permission to use copy modify distribute and sell this software and its documentation for any purpose is hereby granted without fee provided tha
71. 3 2 standard For example include mydb1 t 12 matches the tables t1 and t2 in the database mydb mysqlbackup throws an error when the option is used without a regular expression being supplied with it This option only applies to InnoDB tables created with the MySQL option innodb_file_per_table enabled which is the default setting for MySQL 5 6 and after in which case the tables are in separate files that can be included or excluded from the backup All tables in the InnoDB system tablespace are always backed up When no InnoDB table names match the specified regular expression an error is thrown with a message indicating there are no matches Default Backs up all InnoDB tables Note Y This option does not filter non InnoDB tables for which options like databases and databases 1list file can be used 87 Partial Backup and Restore Options Important A This option does not filter the frm files associated with InnoDB tables meaning that regardless of the option s value all the frm files for all InnoDB tables are always backed up unless they are excluded by other options Those frm files for InnoDB tables that are not backed up should be deleted before the database backup is restored See Making a Partial Backup with the Legacy Options for details databases LIST Specifies the list of non InnoDB tables to back up The argument specifies a space separated list of database or table names of the follo
72. 98 for controlling progress reporting 99 for encryption 102 for generating metadata 79 for incremental backups 80 for partial backups 84 for single file backups 90 for special types of backups 104 in configuration files 105 layout of backup files 76 layout of database files 74 modes of operation 64 options in common with mysql 71 standard options 71 Oracle Secure Backup 176 OSB 176 P page reread count option 95 page reread time option 95 par file 7 177 parallel backup 113 116 177 parallel backups 6 partial backup 36 84 177 partial restore 177 performance of backups 113 of restores 116 performance of backup operations 6 physical backup 6 177 point in time 177 point in time recovery 53 posix_fadvise system call 6 prepared backup 7 49 177 privileges 27 process threads option 93 progress indicator 99 progress table 177 progress interval 102 R RAID 113 116 raw backup 7 49 177 read threads option 93 redo log 178 regular expression 178 relay log 178 relay log index 97 relaylog info file 97 release notes 147 replication 109 110 110 178 repository 178 restore 178 restoring a backup 49 at original location 31 backup created with the use tts option 53 examples 50 mysqlbackup options 66 overview 17 point in time recovery 53 preparation 49 single ibd file 54 row format 178 S SBT 178 sbt database name option 91 sbt
73. A hot backup is the ideal example because the database continues to run and no read or write operations are blocked For that reason sometimes hot backup and online backup are used as synonyms A cold backup is the opposite of an online operation by definition the database server is shut down while the backup happens A warm backup is also a kind of online operation because the database server continues to run although some write operations could be blocked while a warm backup is in progress Contrast with offline See Also cold backup hot backup offline warm backup optimistic backup Optimistic backup is a feature introduced in MySQL Enterprise Backup 3 11 for improving performance for backing up and restoring huge databases in which only a small number of tables are modified frequently An optimistic backup consists of two phases 1 the optimistic phase in which tables that are unlikely to be modified during the backup process identified by the user with the opt imist ic time option or by exclusion with the optimistic busy tables option are backed up without locking the MySQL instance 2 a normal phase in which tables that are not backed up in the first phase are being backed up in a manner similar to how they are processed in an ordinary backup the InnoDB files are copied first and then other relevant files and copied or processed with the MySQL instance locked The redo logs undo logs and the system tablespace are also b
74. Backup and Restore Options Note Y Since MySQL Enterprise Backup 3 10 the two options include tables and xclude tables have been introduced These were intended for replacing the older options of include databases databases list file and only innodb with frm which are incompatible with the new options and will be deprecated in future releases For references purpose we have included information on the older options at the end of this section in Legacy Partial Backup Options To select specific data to be backed up or restored use the partial backup and restore options described in this section For an overview of partial backup and usage information on the following options for partial backup see Section 3 3 4 Making a Partial Backup include tables REGEXP Command Line Format include tables REGEXP Permitted Values Type string Include for backup or restoration only those tables both innodb and non innodb whose fully qualified names in the form of db_name table_name match the regular expression REGEXP The regular expression syntax used is the extended form specified in the POSIX 1003 2 standard For example include tables mydb1 t 12 matches the tables t1 and t2 in the database mydb On Unix like systems quote the regular expression appropriately to prevent interpretation of shell meta characters Some limitations apply when using the option to select database na
75. Backups created with the skip unused pages option cannot be restored using copy back and apply log For image backups taken with MySQL Enterprise Backup 3 8 2 or earlier per table ibd files pointed to by is1 files in a backup are restored by copy back and apply log to the server s data directory rather than the locations pointed to by the isl files 67 Subcommands Due to a known issue when restoring a compressed backup created with MySQL Enterprise Backup 3 9 or earlier and containing any InnoDB tables that were created on the server as compressed tables by using the ROW_FORMAT COMPRESSED option the KEY_BLOCK_SIZE option or both do not use copy back and apply 1lo0g instead perform an apply log first and then a copy back See entry for Bug 17992297 in the MySQL Enterprise Backup 3 10 0 changelog for details At the end of the copy back and apply 10g operation the file backup_variables txt is being created or updated in the data directory This file contains metadata about the restored contents and is being used by successive single step restores of incremental backups it should not be deleted or modified by users For some sample commands for restoring different kinds of backups with the copy back and apply log subcommand see Section 4 2 Performing a Restore Operation Warning O When restoring a server for replication purpose if the backed up server has used the innodb_undo_directo
76. Do not read default options from any given file no history logging Disable history logging even if connection is available no locking Disable locking of tables even if connection is available number of buffers Specifies the exact number of memory buffers to be used for the backup operation 61 mysqlbackup Command Line Options Format Description Introduced on disk full Specifies the behavior when a backup process encounters a disk full condition only innodb Back up only InnoDB data and log files only innodb with frm Legacy Back up only InnoDB data log files and the frm files associated with the InnoDB tables only known file types Includes only files of a list of known types in the backup optimistic busy tables Perform an optimistic backup using the regular expression 3 11 0 specified with the option to select tables that will be skipped in the first phase of an optimistic backup optimistic time Perform an optimistic backup with the value specified with 3 11 0 the option as the optimistic time a time after which tables that have not been modified are believed to be inactive tables page reread count Maximum number of page re reads page reread time Wait time before a page re read password Connection password pipe alias for protocol pipe port TCP portnumber to connect to print defaults Print a list of option va
77. E INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE Acknowledgement Funding for the RFC Editor function is currently provided by the Internet Society E 11 zlib License The following software may be included in this product zlib Oracle gratefully acknowledges the contributions of Jean loup Gailly and Mark Adler in creating the zlib general purpose compression library which is used in this product zlib h interface of the zlib general purpose compression library Copyright C 1995 2004 Jean loup Gailly and Mark Adler zlib h interface of the zlib general purpose compression library Werle 1 239 us Aia ZOOS Copyright C 1995 2005 Jean loup Gailly and Mark Adler zlib h interface of the zlib general purpose compression library 167 zlib License Wermsiem 1 2507 Monel Sida 20140 Copyright C 1995 2010 Jean loup Gailly and Mark Adler This software is provided as is without any express or implied warranty In no event will the authors be held liable for any damages arising from the use of this software Permission is granted to anyone to use this software for any purpose including commercial applications and to alter it and redistribute it
78. E POSSIBILITY OF SUCH DAMAGE The license and distribution terms for any publically available version or derivative of this code cannot be changed i e this code cannot simply be copied and put under another distribution license including the GNU Public License E 8 Percona Multiple I O Threads Patch License The following software may be included in this product Percona Multiple I O threads patch Copyright c 2008 2009 Percona Inc All rights reserved Redistribution and use of this software in source and binary forms with or without modification are permitted provided that the following conditions are met Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of Percona Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Percona Inc THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FO
79. ERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE You gen COMEACIE Was eNO aie 8 LZ4 source repository http code google com p 1z4 DAA public forum hitpes groups google com torumy torumy lz4c E 7 OpenSSL v1 0 License The following software may be included in this product OpenSSL v1 0 LICENSE ISSUES The OpenSSL toolkit stays under a dual license i e both the conditions of the OpenSSL License and the original SSLeay license apply to the toolkit See below for the actual license texts Actually both licenses are BSD style Open Source licenses In case of any license issues related to OpenSSL please contact openssl core openssl org OpenSSL License Copyright c 1998 2008 The OpenSSL Project All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met 1 Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer 2 Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution 164 OpenSSL v1 0 License 3 All advertising materials mentioning features or use of this software must display the following acknow
80. L server make sure the target data directories are all clean containing no old or unwanted data files This might require manual removal of files at the locations specified by both the datadir and innodb_data_file path options The same cleanup is not required for restoring backups created with the use tts option in which case other requirements described in Restoring Backups Created with the use tts Option apply though and usually not necessary for restoring a partial backup You can combine the apply log and the copy back operations as well as a number of other operations depending on the kind of backup you are restoring into a single step by using the copy back and apply 1o0g option instead mysqlbackup defaults file usr local mysql my cnf backup dir export backups full copy back and apply log Example 4 5 Restoring a Compressed Backup Restore a compressed backup at lt backupDir gt to lt restoreDir gt on the server using copy back and apply log mysqlbackup defaults file lt my cnf gt uroot backup dir lt backupDir gt datadir lt restoreDir gt uncompress copy back and apply log Do the same for a compressed backup image named lt image_name gt using the backup dir option to specify the temporary directory into which the image will be extracted mysqlbackup defaults file lt backupDir gt backup my cnf uroot backup image lt image_name gt backup dir lt backupTmpDir gt dat
81. Line Format comments STRING Permitted Values Type string Specifies a comment string that describes or identifies the backup Surround multi word comments with appropriate quotation marks The string is saved in a file meta comments txt in the backup For example comments Backup of HR data on 2010 12 10 comments file PATH Command Line Format comments file PATH Permitted Values Type file name Specifies path to a file containing comments describing the backup This file is saved as meta comments txt in the backup For example comments file path to comments txt This option overrides the comment s option if both are specified 5 1 7 Compression Options For an overview on backup compression see Section 3 3 3 Making a Compressed Backup Ccompress Create backup in compressed format For a regular backup only the InnoDB data files are compressed and they bear the ibz extension after the compression Similarly for a single image backup only the InnoDB data files inside the backup image are compressed Default compression is disabled compress method ALGORITHM Command Line Format compress method ALGORITHM Permitted Values Type enumeration Default 1z4 79 Incremental Backup Options Valid Values zlib 124 lzma Specifies the compression algorithm The supported arguments for the option and
82. MITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Except as contained in this notice the name of a copyright holder shall not be used in advertising or otherwise to promote the sale use or other dealings in this Software without prior written authorization of the copyright holder E 2 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 GNU GENERAL PUBLIC LICENSE Version 3 29 June 2007 Copyright C 2007 Free Software Foundation Inc lt http fsf org gt Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed 149 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 Preamble The GNU General Public License is a free copyleft license for software and other kinds of works The licenses for most software and other practical works are designed to take away your freedom to share and change the works By contrast the GNU General Public License is intended to guarantee your freedom to share and change all
83. MySQL Enterprise Backup User s Guide Version 3 11 1 Abstract This is the User s Guide for the MySQL Enterprise Backup product This manual describes the procedures to back up and restore MySQL databases It covers techniques for minimizing time and storage overhead during backups and to keep the database available during backup operations It illustrates the features and syntax of the mysqlbackup command for example how to back up selected databases or tables how to back up only the changes since a previous backup and how to transfer the backup data efficiently to a different server For notes detailing the changes in each release see the MySQL Enterprise Backup 3 11 Release Notes For legal information see the Legal Notices For help with using MySQL please visit either the MySQL Forums or MySQL Mailing Lists where you can discuss your issues with other MySQL users For additional documentation on MySQL products including translations of the documentation into other languages and downloadable versions in variety of formats including HTML and PDF formats see the MySQL Documentation Library Document generated on 2015 12 15 revision 6220 Table of Contents Preface and Legal Notices ooocccconnnccccconnnnocconnnnnccnnnnnncnnnnn rr E ee seaaee ee eeaaea ee A E OSE ix Getting Started with MySQL Enterprise Backup cceeeeeeeeeeeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeneeeeeeeeeaeaaea 1 1 Introduction t
84. MySQL server performs conversions for any special characters in any database or table names to come up with the file names for storage Here are two examples of MySQL commands including special characters and in their database and file names mysql gt CREATE TABLE db 2 t 2 cl INT ENGINE InnoDB mysql gt CREATE TABLE db 3 t 3 cl INT ENGINE InnoDB The tables created by these commands are stored in the file system as these files db 002e2 t 002e2 ibd db 002d3 t 002d3 ibd Currently mysqlbackup does not perform the same conversion with database and table names supplied using the include tables and xclude tables options Using for example include tables db 2 t 2 db 3 t 3 will not select the tables described above As a workaround for a backup that does not use transportable tablespace TTS that is the use tts option is not used during the creation of the backup users can look up the file names for the desired tables in the data directories of the databases and in the arguments for the include tables and xclude tables options use the converted names for the database directories as database names and the converted file names without the file extension as table names For example for the tables mentioned above select them for inclusion in a backup with the option argument include tables db 002e2 t 002e2 db 002d3 t 002d3 Using the same argument with the option xclude table
85. Options issiria tinii ni aea a aA aaas 103 5 1 16 Options for Special Backup Types cceeecceeeeeeeeeeeee esse aaa neeeeeeeeeaeaaaeeeeeeeeeeaeaaaaneeeeees 104 5 2 Configuration Files and Parameters ccccceeeeeeeeeeeee ee aaeeeeeeeeeeeeeaaeaeeeeeeeeeseaaaaeeeeeeeeeeeaeaaeaaes 105 The mysqlbackup command is an easy to use tool for all backup and restore operations During backup operations mysqlbackup backs up e All InnoDB tables and indexes including e The InnoDB system tablespace which by default contains all the InnoDB tables e Any separate data files produced under the InnoDB file per table setting Each one contains one table and its associated indexes Each data file can use either the original Antelope or the new Barracuda file format All MyISAM tables and indexes e Tables managed by other storage engines e Other files underneath the MySQL data directory such as the frm files that record the structure of each table In addition to creating backups mysqlbackup can pack and unpack backup data apply to the backup data any changes to InnoDB tables that occurred during the backup operation and restore data index and log files back to their original locations Sample command line arguments to start mysqlbackup are Information about data files can be retrieved through the database connection Specify connection options on the command line mysqlbackup user dba password port 3306 wi
86. R ANY DIRECT INDIRECT NCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE E 9 RegEX Spencer Library License The following software may be included in this product Henry Spencer s Regular Expression Library RegEX Spencer Copyright 1992 1993 1994 1997 Henry Spencer All rights reserved This software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of Caliitoraale Permission is granted to anyone to use this software for any purpose on any computer system and to alter it and redistribute it subject to the following restrictions 1 The author is not responsible for the consequences of use of this software no matter how awful even if they arise from flaws in it 2 The origin of this software must not be misrepresented either by explicit claim or by omission Since few users ever read sources credits must appear in the documentation 166 RFC 3174 US Secure Hash Algorithm 1 SHA1 License 3 Altered versions must be plainly marked as such and must not be mi
87. SCARD TABLESPACE and ALTER TABLE IMPORT TABLESPACE on the other server brings the copied data file into the other instance A separate cfg file copied along with the ibd file is used to update the table metadata for example the space ID as the tablespace is imported See Copying File Per Table Tablespaces to Another Server for usage information Use the use tts option to create a backup with transportable tablespace See also Restoring Backups Created with the use tts Option See Also partial backup TTS Short form for transportable tablespace See Also partial backup transportable tablespace W warm backup A backup taken while the database is running but that restricts some database operations during the backup process For example tables might become read only For busy applications and web sites you might prefer a hot backup See Also backup cold backup hot backup 180 Index Symbols frm file 36 A Antelope 57 169 apply 169 apply incremental backup option 50 66 apply log option 66 ARM file 169 ARZ file 169 B backup 169 backup directory 169 backup option 65 backup repository 169 backup and apply log option 65 backup dir option 76 backup dir to image option 70 backup image option 90 backup my cnf 169 backup my cnf file 7 backup to image option 65 90 backups cold 5 compressed 6 35 40 50 79 145 controlling overhead performance an
88. U KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU KU ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 ps 20 06 16_10 33 47 datadir mem migration_status_data_collection frm 06 16_10 33 47 datadir mem migration_status_data_collection ibd 06 16_10 33 47 datadir mem migration_status_servers frm 06 16_10 33 47 datadir mem migration_status_servers ibd 06 16_10 33 47 datadir mem migration_status_servers_migration_state frm 06 16_10 33 47 datadir mem migration_status_servers_migration_state ibd 06 16_10 33 47 datadir mem migration_status_servers_migration_status_data_colle 06 16_10 33 47 datadir mem migration_status_servers_migration_status_data_colle 06 16_10 33 47 datadir mem mos_service_requests frm 06 16_10 33 47 datadir mem mos_service_requests ibd 06 16_10 33 47 datadir mem resource_bundle frm 06 16_10 33 47 datadir mem resour
89. _state last_error and last_error_code to evaluate the success or failure of each backup If last_error is NO_ERROR the backup operation was successful In case of any errors you can retrieve the full list of errors for that backup operation from the backup_progress table 10 5 Using the MySQL Enterprise Backup Manifest Each backup directory includes some files in the met a subdirectory that detail how the backup was produced and what files it contains The files containing this information are known collectively as the manifest mysqlbackup produces these files for use by database management tools it does not consult or modify the manifest files after creating them Management tools can use the manifest during diagnosis and troubleshooting procedures for example where the original MySQL instance has been lost entirely and the recovery process is more substantial than copying files back to a working MySQL server The files in the manifest include backup_create xml information about the backup operation backup_content xml information about the files in the backup This information is only complete and consistent when the backup operation succeeds The contents of this file might be expanded in the future A management tool might use this information to confirm which tables are part of a full backup or a partial backup performed with the dat abases option The information is not present for partial backups taken with the
90. _zone_name MYD 0 33 47 datadir mysql time_zone_name MYI DUO ARI PL AO ONO AO SN OY OA AA WON AO AO AO A A AO ONO OA AO AO O SOY RADO ON AA KON AO AI AO OA O AO AO OA ON OA O OOTY OO A ON ON o Ww Ww N 144 Sample Directory Structure for Compressed Backup Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition frm Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition MYD Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition MYI Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition_type frm Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition_type MYD Users cirrus backups 2011 06 16_10 33 47 datadir mysql time_zone_transition_type MYI Users cirrus backups 2011 06 16_10 33 47 datadir mysgql user frm Users cirrus backups 2011 06 16_10 33 47 datadir mysql user MYD Users cirrus backups 2011 06 16_10 33 47 datadir mysql user MYI Users cirrus backups 2011 06 16_10 33 47 meta Users cirrus backups 2011 06 16_10 33 47 meta backup_content xml Users cirrus backups 2011 06 16_10 33 47 meta backup_create xml Users cirrus backups 2011 06 16_10 33 47 meta backup_variables txt Users cirrus backups 2011 06 16_10 34 12 Users cirrus backups 2011 06 16_10 34 12 backup my enf Users cirrus backups 2011 06 16_10 34 12 datadir Users cirrus backups 2011 06 16_10 34 12 datadir ib_logfile0 Us
91. a a aa a iaiia 103 5 1 16 Options for Special Backup Types cooooonoccccnccnccnnnonnnnconnnnconnnonnancnnnancononnnnancnncancnnns 104 5 2 Configuration Files and Parameters ccccceceeeeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeaaaaeeeesereees 105 6 Using MySQL Enterprise Backup with Replication cccccceeeeeeeeeeeee eee ee eeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaes 109 6 1 Setting Up a New Replication Slave ccccceeeeeeeeeee cece eee eeeeeeeeee ee aa aa eeeeeeeeeeeeaaaaeeeeeeeeeeeeaea 109 6 2 Backing up and Restoring a Slave Database ooocccccnnncccocococcccnnnoncnnnonnanccnnnnnonnnnnnanccnnnnccnnns 110 6 3 Restoring a Master Database 00 ieee cece ene teeter kuirudia kueka akeri Neu ee aaneeeeeaaeeeeeeaaeeeeees 110 7 Performance Considerations for MySQL Enterprise Backup cceeeeeeceeeeeeeeeeeeeeeaaeneeeeeeeeeeeeaea 113 7 1 Optimizing Backup Performance ccceceeeeeee cece ee ee eee ee cece ee ee ee aa ea eeeeeeeeeeeeaeaaeeneeeeseeeeaeaaea 113 7 2 Optimizing Restore Performance cccccecceeeeeeeeeeeee ee aaeaeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaa 116 8 Encryption for Backups ad 119 23 9 Using MySQL Enterprise Backup with Media Management Software MMS Products stdeboabenehtentest ees 121 9 1 Backing Up to Tape with Oracle Secure Backup cceeeeeeeeeeeeeeeeeeeeeeeeeaeaaeaeeeeeeeeeeeeaea 121 10 Troubleshooting for MySQL Enterprise Backup
92. a non exclusive worldwide royalty free patent license under the contributor s essential patent claims to make use sell offer for sale import and otherwise run modify and propagate the contents of its contributor version In the following three paragraphs a patent license is any express agreement or commitment however denominated not to enforce a patent such as an express permission to practice a patent or covenant not to sue for patent infringement To grant such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party If you convey a covered work knowingly relying on a patent license and the Corresponding Source of the work is not available for anyone to copy free of charge and under the terms of this License through a publicly available network server or other readily accessible means then you must either 1 cause the Corresponding Source to be so available or 2 arrange to deprive yourself of the benefit of the patent license for this particular work or 3 arrange in a manner consistent with the requirements of this License to extend the patent license to downstream recipients Knowingly relying means you have actual knowledge that but for the patent license your conveying the covered work in a country or your recipient s use of the covered work in a country would infringe one or more identifiable patents in that country that you have reason to beli
93. ables only mysqlbackup defaults file home pekka my cnf include test ib only innodb with frm related backup many lines of output mysqlbackup Scanned log up to lsn 2666737471 mysqlbackup Was able to parse the log up to lsn 2666737471 mysqlbackup Maximum page number for a log record 0 101208 17 17 45 mysqlbackup Full backup completed The backup directory contains only backups of ibstest and ibtest09 tables Other InnoDB tables did not match the include pattern test ib Notice however that the tables ibtestila ibtest11b ibtestilc ibtestild are in the backup even though they are not visible in the directory shown below because they are stored in the system tablespace ibdata1 file which is always included in the backup With the only innodb option ls sqldata backup test ibstest0 ibd Wares OL iba With the only innodb with frm related option ls sqldata backup test ibstest0 frm ibtest09 frm ibstest0 ibd ibtest09 ibd Example 3 2 Making a Compressed Partial Backup We have configured MySQL so that every InnoDB table has its own tablespace We make a partial backup including only those InnoDB tables whose name starts with alex or blob The contents of the database directory for test database is shown below ls sqldata mts test alexl frm alex2 ibd blobt3 frm ibstest0 ibd ibtestlla frm ibtestlld frm alexl ibd alex3 frm blobt3 ibd ibtest09 frm ibtestllb frm alex2 frm alex3 ibd ibste
94. acked up in this phase See Section 3 3 6 Making an Optimistic Backup for details Oracle Secure Backup An Oracle product for managing backup media and so classified as media management software MMS Abbreviated OSB For MySQL Enterprise Backup OSB is typically used to manage tape backups See Also backup media management software OSB OSB Abbreviation for Oracle Secure Backup a media management software product MMS See Also Oracle Secure Backup 176 P par file A file containing partition definitions Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product parallel backup The default processing mode in MySQL Enterprise Backup 3 8 and higher employing multiple threads for different classes of internal operations read process and write See Section 1 3 Overview of Backup Performance and Capacity Considerations for an overview Section 5 1 11 Performance Scalability Capacity Options for the relevant mysqlbackup options and Chapter 7 Performance Considerations for MySQL Enterprise Backup for performance guidelines and tips partial backup A backup that contains some of the tables in a MySQL database or some of the databases in a MySQL instance Contrast with full backup Related mysqlbackup options are include tables xclud tables use tts only known file types and only innodb See Also backup database full
95. ackup directory quotes are used for the argument of xec when locked to prevent premature expansion of the variable BACKUP_DIR On Unix or Linux systems export BACKUP_DIR path_to_backupdir mysqlbackup exec when locked mysqldump mydb t1 gt BACKUP_DIR t1 sql other_options mysqlbackup_comman Or on Windows systems set BACKUP_DIR path_to_backupdir mysqlbackup exec when locked mysqldump mydb tl gt BACKUP_DIR t1 sql other_options mysqlbackup_comma If the utility cannot be executed or returns a non zero exit status the whole backup process is cancelled If you also use the suspend at end option the utility specified by xec when 1locked is executed after the suspension is lifted 5 2 Configuration Files and Parameters 105 Options Files You can specify mysqlbackup options either on the command line or as configuration parameters inside a configuration file This section describes the use of configuration files In general mysqlbackup follows the mysqi style of processing configuration options mysqlbackup and client group options are passed as command line options Any command line options that you specify override the values from the configuration file and in the case of duplicate options the last instance takes precedence mysqlbackup also reads options in the mysqld group to detect parameters related to the source repository when no connection to mysqld is available The underscore characters
96. adir lt restoreDir gt uncompress copy back and apply log See Section 3 3 3 Making a Compressed Backup and Section 5 1 7 Compression Options for more details on compressed backups Example 4 6 Restoring an Encrypted Backup Image Restore an encrypted backup image named lt image_name gt to lt restoreDir gt on the server with copy back and apply log using the encryption key contained in a file named lt keyFile gt mysqlbackup defaults file lt backupDir gt backup my cnf backup image lt image_name gt 51 Performing a Restore Operation backup dir lt backupTmpDir gt datadir lt restoreDir gt decrypt key file lt keyFile gt copy back and apply log See Section 5 1 14 Encryption Options for more details on backup encryption and decryption Example 4 7 Restoring an Incremental Backup Image mysqlbackup defaults file lt backupDir gt backup my cnf uroot backup image lt inc_image_name gt incremental backup dir lt incBackupTmpDir gt datadir lt restoreDir gt incremental A copy back and apply log In this example the incremental backup image named lt inc_image_name gt was restored to lt restoreDir gt on the server where the full backup that the incremental backup image was based on has already been restored The incremental backup dir option is used to specify the temporary directory into which the image will be extracted you can use backup di r for the
97. age To use a key file for the same task mysqlbackup backup image backups image enc encrypt key file meb key backup dir var tmp backup backup to image 119 To decrypt a backup when extracting it mysqlbackup backup image backups image enc decrypt key file meb key backup dir backups extract dir extract To validate an encrypted backup image mysqlbackup backup image logs encimage bi decrypt key file meb enckey validate 120 Chapter 9 Using MySQL Enterprise Backup with Media Management Software MMS Products Table of Contents 9 1 Backing Up to Tape with Oracle Secure Backup coooooooccccccnconccnnonncnccnnnononononnnncnnnnnnonnnnnnancancnncinns 121 This section describes how you can use MySQL Enterprise Backup in combination with media management software MMS products Such products are typically used for managing large volumes of backup data often with high capacity backup devices such as tape drives 9 1 Backing Up to Tape with Oracle Secure Backup Tape drives are affordable high capacity storage devices for backup data The MySQL Enterprise Backup product can interface with media management software MMS such as Oracle Secure Backup OSB to drive MySQL backup and restore jobs The media management software must support Version 2 or higher of the System Backup to Tape SBT interface On the MySQL Enterprise Backup side you run the backup job as a single file backup u
98. al regulations As such use duplication disclosure modification and adaptation of the programs including any operating system integrated software any programs installed on the hardware and or documentation shall be subject to license terms and license restrictions applicable to the programs No other rights are granted to the U S Government This software or hardware is developed for general use in a variety of information management applications It is not developed or intended for use in any inherently dangerous applications including applications that may create a risk of personal injury If you use this software or hardware in dangerous applications then you shall be responsible to take all appropriate fail safe backup redundancy and other measures to ensure its safe use Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications Oracle and Java are registered trademarks of Oracle and or its affiliates Other names may be trademarks of their respective owners Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International Inc AMD Opteron the AMD logo and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices UNIX is a registered trademark of The Open Group This software or hardwa
99. all not publish or distribute this documentation in any form or on any media except if you distribute the documentation in a manner similar to how Oracle disseminates it that is electronically for download on a Web site with the software or on a CD ROM or similar medium provided however that the documentation is disseminated together with the software on the same medium Any other use such as any dissemination of printed copies or use of this documentation in whole or in part in another publication requires the prior written consent from an authorized representative of Oracle Oracle and or its affiliates reserve any and all rights to this documentation not expressly granted above Part Getting Started with MySQL Enterprise Backup Table of Contents 1 Introduction to MySQL Enterprise Backup 1 1 Types of Backups ee 1 2 The mysqlbackup Command 1 3 Overview of Backup Performance and Capacity Considerations ccceeeeeeeeeeeeeeeeeeeeeeeaees 1 4 Files that Are Backed Up 1 5 Overview of Restoring a Database 2 Installing MySQL Enterprise Backup Chapter 1 Introduction to MySQL Enterprise Backup Table of Contents del RY POS OF BACKUPS ii A cai ieenmete a duaceanes 5 1 2 The mysqlbackup Command mbr di 6 1 3 Overview of Backup Performance and Capacity Considerations oooociccnnnncccoconncaccnnnnccnnnonanncannancnnns 6 1 4 Files that Are Backed UD iuto
100. all the SQL activities to a single file first and then pipe or play the file to the mysql client For more tips on using the binary log for point in time recovery see Point in Time Incremental Recovery Using the Binary Log 4 4 Backing Up and Restoring a Single ibd File A table with a table specific tablespace stored in an ibd file can be restored individually without taking down the MySQL server This technique is applicable if you delete or update the table data by mistake without actually losing the table itself through a DROP TABLE TRUNCATE TABLE of DROP DATABASE statement If you have a clean backup of an ibd file you can restore it to the MySQL installation from which it originated as follows 1 For MySQL 5 5 and earlier the table must already exist and not have been dropped or truncated since taking the backup When an InnoDB table is truncated or dropped and recreated it gets a new table ID Any ID mismatch between the table in the database and the backed up table can prevent it from being restored The requirement for matching table IDs is also the reason why you must restore to the same MySQL server from which the backup data came not another server with a similar set of databases and tables This restriction does not apply to MySQL 5 6 and later as long as the restoration is made from one Generally Available GA version to another in the same series of MySQL servers Prevent write operatio
101. alue from the output of the previous backup operation or from the backup_history table s end_1sn column for the previous backup operation Always used in combination with the incremental option not needed when you use the incremental base option not recommended when you use the incremental with redo 1o0g on1y mechanism for incremental backups incremental backup dir PATH Command Line Format incremental backup dir PATH Permitted Values Type directory name Specifies the location under which to store data from an incremental backup This is the same location you specify with incremental base if you use that option for a subsequent incremental backup Example 5 4 Incremental Backup These examples show typical combinations of options used for incremental backups mysqlbackup incremental incremental backup dir var mysql backup latest incremental base dir var mysql backup previous backup AA mysqlbackup incremental with redo log only incremental backup dir var mysql backup latest incremental base dir var mysql backup previous A 83 Partial Backup and Restore Options backup mysqlbackup incremental start 1sn 12345 incremental backup dir var mysql backup inc backup mysqlbackup incremental with redo log only start 1sn 12345 incremental backup dir var mysql backup inc backup 5 1 9 Partial
102. anty or assumption of liability accompanies a copy of the Program in return for a fee END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program and you want it to be of the greatest possible use to the public the best way to achieve this is to make it free software which everyone can redistribute and change under these terms To do so attach the following notices to the program It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty and each file should have at least the copyright line and a pointer to where the full notice is found lt one line to give the program s name and a brief idea of what it does gt Copyright C lt year gt lt name of author gt This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see lt http www gnu org licenses gt Also add information on how to contact you by electronic and p
103. aper mail If the program does terminal interaction make it output a short notice like this when it starts in an interactive mode 159 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 lt program gt Copyright C lt year gt lt name of author gt This program comes with ABSOLUTELY NO WARRANTY for details type show w This is free software and you are welcome to redistribute it under certain conditions type show c for details The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of course your program s commands might be different for a GUI interface you would use an about box You should also get your employer if you work as a programmer or school if any to sign a copyright disclaimer for the program if necessary For more information on this and how to apply and follow the GNU GPL see lt http www gnu org licenses gt The GNU General Public License does not permit incorporating your program into proprietary programs If your program is a subroutine library you may consider it more useful to permit linking proprietary applications with the library If this is what you want to do use the GNU Lesser General Public License instead of this License But first please read lt http www gnu org philosophy why not 1gp1 html gt GCC RUNTIME LIBRARY EXCEPTION Venson Sil Sil Ma
104. ariable Reference However mysqlbackup does not accept any short forms for these options as mysql does for example you must use help instead of h for mysqlbackup help Display help version Display version information verbose Print more verbose information debug Print debug information More standard options are available for mysqlbackup force Force operations such as overwrite files create backup directory trace level Trace level of messages by mysqlbackup force By default some of the operations halt rather than overwrite any user data or log files when told to write to existing files force allows the overwriting of InnoDB data and log files during the apply log and app1y incremental backup operations and allows the replacing of an image file during an backup to image or backup dir to image option For all other operations the force option is rejected with an error message trace level Command Line Format trace LEVEL Permitted Values Type enumeration Default 0 Valid 0 Values 1 2 3 Trace level of mysq1backup messages The permissible levels in the order of increasing fineness are 0 INFO information warnings errors 1 FINE verbose option is enabled 2 FINER debug option is enabled e 3 FINEST includes all low level outputs 5 1 3 Connection Options When mysqlbackup creates a backup it sends SQL comman
105. at are unlikely to be modified during the backup process referred to as the inactive tables below identified by the user with the optimistic time option or by exclusion with the optimistic busy tables option are backed up without locking the MySQL instance And because those tables are not expected to be changed before the backup is finished redo logs undo logs and system table spaces are not backed up by mysqlbackup in this phase 2 Normal phase In this second phase tables that are not backed up in the first phase referred to as the busy tables below are being backed up in a manner similar to how they are processed in an ordinary backup the InnoDB files are copied first and then the other relevant files and copied or processed with the MySQL instance locked Also if it turns out that some of the inactive tables have actually been modified after they were backed up in the optimistic phase they are copied again in the normal phase The redo logs undo logs and the system table space are also backed up in this phase An optimistic backup occurs whenever the optimistic time Or optimistic busy tables option is used For how to use the options see detailed descriptions for them in Section 5 1 11 Performance Scalability Capacity Options If as expected the inactive tables identified by the options are not changed a lot during the backup the overall backup time time for the backup operation plus time for the apply lo
106. ata past a certain age This option is NOT set on default If you do use a single backup directory that is if you omit the with timestamp option either specify a new unique directory name for each backup job or specify the force 72 option to overwrite existing backup files With the incremental base option as part of each incremental backup command you specify the directory containing the previous backup To make the directory names predictable you might prefer to leave out the with timestamp option and instead generate a sequence of directory names as part of your backup script Always Full Backup or Full Backup plus Incremental Backups If your InnoDB data volume is small or if your database is so busy that a high percentage of data changes between backups you might run a full backup each time Typically you can save time and storage space by running periodic full backups and in between running several incremental backups as described in Section 3 3 2 Making an Incremental Backup Use Compression or Not Creating a compressed backup can save you considerable storage space and reduce O significantly And with the LZ4 compression method introduced since release 3 10 the overhead for processing compression is quite low In cases where database backups are moving from a faster disk system where the active database files sit to a possibly slower storage compression will often significantly lower the ove
107. ayout of the MySQL data files Used in restore operations to reproduce the same layout as when the backup was taken ibbackup_logfile A condensed version of the ib_logfile files from the MySQL data directory The InnoDB log files ib_logfile are fixed size files that are continuously updated during database operation For backup purposes only the changes that are committed while the backup is in progress are needed These changes are recorded in ibbackup_logfile and used to re create the ib_logfile files during the apply log phase ibbackup_redo_log_only ib_logfile Used instead of ibbackup_logfile for incremental backups taken with the incremental with redo log only option Created in the backup directory during the apply log phase after the initial backup These files are not copied from the original data directory but rather re created in the backup directory during the apply log phase after the initial backup Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes using the changes recorded in the ibbackup_logfile file Renamed version of each isl file from the backed up server A isi file is created when you specify the location of an InnoDB table using the syntax CREATE TABLE DATA DIRECTORY to act like a symbolic link pointing to the tablespace file See Creating a File Per Table Tablespa
108. backup completed OK With the start 1sn option you do have to record the LSN of the previous backup but then the location of the previous backup is less significant so you can use with timestamp to create named subdirectories automatically mysqlbackup defaults file home pekka my cnf incremental start 1sn 2654255716 with timestamp incremental backup dir incr backup backup many lines of output mysqlbackup Backup created in directory incr backup 2010 12 08_17 14 48 mysaqlback p iscan keine 2643 S 7 117 mysqlbackup incremental_base_lsn 2666733462 mysqlbackup end_lsn 2666736714 101208 17 14 58 mysqlbackup mysqlbackup completed OK Wherever you use the incremental option you can use the incremental with redo 1og only option instead Because incremental with redo 1og on1y is more dependent on the precise LSN than the incremental option is use the incremental base option rather than the start 1sn option with this kind of incremental backup For this alternative kind of incremental backup to work the volume of changed information must be low enough and the redo log files must be large enough that all the changes since the previous incremental backup must be present in the redo log and not overwritten See the incremental with redo 1og only option description to learn how to verify those requirements mysqlbackup defaults file home pekka my cnf incr
109. begin the cycle again 31 Making an Incremental Backup This section outlines some of the considerations for making this most basic kind of backup Because a full backup can take longer and produce larger backup files then other kinds of backups your decisions about speed capacity and convenience are especially important for this part of the backup strategy For examples showing the commands to make a full backup see Section 3 2 1 Backing Up an Entire MySQL Instance Options on Command Line or in Configuration File For clarity the examples in this manual typically show command line options to demonstrate connection parameters and other information that might be the same for each backup job For convenience and consistency you can include these options in the mysqlbackup section of the MySQL configuration file that you pass to the mysqlbackup command mysqlbackup also picks them up from the mysqld section if they are present For example relying on the port information in the configuration file avoids the need to edit your backup scripts if the database instance switches to a different port Output in Single Directory or Timestamped Subdirectories For convenience the with timestamp option creates uniquely named subdirectories under the backup directory to hold the output from each backup job The timestamped subdirectories make it simpler to establish retention periods for example by removing or archiving backup d
110. ble you must specify it Whether the initial filename begins with a character or not the files are located relative to the innodb_data_home_dir value innodb_log_group_home_dir PATH Specifies where InnoDB logs live within the server repository Usually the same as dat adir but can be different Its value is derived as follows e If innodb_log_group_home_dir is not specified it inherits the value of datadir e If innodb_log_group_home_dir is a relative path that path is located relative to that is underneath the datadir value e If innodb_log_group_home_dir is an absolute path its value is used as is innodb_log_files_in_group N Specifies the number of InnoDB log files before being rotated Typically you do not need to specify this option because its value is retrieved automatically using the database connection If no database connection is available you must specify it When a database connection exists the value is retrieved automatically and overrides any value you specify innodb_log_file_size SIZE Specifies maximum single InnoDB log file size before switching to next log file Example 20M Typically you do not need to specify this option because its value is retrieved automatically using the database connection If no database connection is available you must specify it When a database connection exists the value is retrieved automatically and overrides any value you specify innodb_
111. blic License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 modification follow TERMS AND CONDITIONS 0 Definitions This License refers to version 3 of the GNU General Public License Copyright also means copyright like laws that apply to other kinds of works such as semiconductor masks The Program refers to any copyrightable work licensed under this License Each licensee is addressed as you Licensees and recipients may be individuals or organizations To modify a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission other than the making of an exact copy The resulting work is called a modified version of the earlier work or a work based on the earlier work A covered work means either the unmodified Program or a work based on the Program To propagate a work means to do anything with it that without permission would make you directly or secondarily liable for infringement under applicable copyright law except executing it on a computer or modifying a private copy Propagation includes copying distribution with or without modification making available to the public and in some countries other activities as well To convey a work means any kind of propagation that enables other parties to make or receive copies Mere interaction with a user through a computer network with no transfer of a copy is not
112. ccnncoirico lorca tdt daria 7 1 5 Overview of Restoring a Database ooocoooconocccccccnconnnonnnnconcnncononnnnancnncnncnnnnnnnanannrnnnnnnnnnnanncrnncnnnnnns 17 The MySQL Enterprise Backup product performs backup operations for MySQL data lt can back up all kinds of MySQL tables lt has special optimizations for fast and convenient backups of InnoDB tables Because of the speed of InnoDB backups and the reliability and scalability features of InnoDB tables we recommend that you use InnoDB tables for your most important data This book describes the best practices regarding MySQL backups and documents how to use MySQL Enterprise Backup features to implement these practices This book teaches you Why backups are important The files that make up a MySQL database and the roles they play e How to keep the database running during a backup e How to minimize the time CPU overhead and storage overhead for a backup job Often minimizing one of these aspects increases another e How to restore your data when disaster strikes You learn how to verify backups and practice recovery so that you can stay calm and confident under pressure e Other ways to use backup data for day to day administration and in deploying new servers 1 1 Types of Backups The various kinds of backup techniques are classified on a scale ranging from hot the most desirable to cold the most disruptive Your goal is to keep the database system and associated a
113. ce Outside the Data Directory for details The b1 files might or might not be turned back into is1 files during the copy back operation If the specified directory does not exist on the server where the backup is restored the mysqlbackup command attempts to create it If the directory cannot be created the restore operation fails Thus if you use the DATA DIRECTORY clause to put tables in different locations and restore to a server with a different file structure where the corresponding directories cannot be created edit the b1 files before restoring to point to directories that do exist on the destination server Timestamped directory such as 2011 05 26 13 42 02 Created by the with timestamp option All the backup files go inside this subdirectory Use the with timestamp option whenever you intend to keep more than one set of backup data available under the same main backup directory datadir directory A subdirectory that stores all the data files and database subdirectories from the original MySQL instance Created under the backup directory by the mysqlbackup command binary log files Binary log files from the server which are included in a backup by default except when the backup is created with the use tts option They allow a snapshot of the server to be taken so a server can be cloned to its exact state Using a full backup as a basis the binary log
114. ce and binary forms with or without modification are permitted provided that the following conditions cute Wises Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of the Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT NCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE E 5 Google SMP Patch License The following software may be included in this prod
115. ce_bundle ibd 06 16_10 33 47 datadir mem resource_bundle_map frm 06 16_10 33 47 datadir mem resource_bundle_map ibd 06 16_10 33 47 datadir mem rule_alarms frm 06 16_10 33 47 datadir mem rule_alarms ibd 06 16_10 33 47 datadir mem rule_dc_schedules frm 06 16_10 33 47 datadir mem rule_dc_schedules ibd 06 16_10 33 47 datadir mem rule_eval_result_vars frm 06 16_10 33 47 datadir mem rule_eval_result_vars ibd 06 16_10 33 47 datadir mem rule_eval_results frm 06 16_10 33 47 datadir mem rule_eval_results ibd 06 16_10 33 47 datadir mem rule_schedule_email_targets frm 06 16_10 33 47 datadir mem rule_schedule_email_targets ibd 06 16_10 33 47 datadir mem rule_schedules frm 06 16_10 33 47 datadir mem rule_schedules ibd 06 16_10 33 47 datadir mem rule_tags frm 06 16_10 33 47 datadir mem rule_tags ibd 06 16_10 33 47 datadir mem rule_thresholds frm 06 16_10 33 47 datadir mem rule_thresholds ibd 06 16_10 33 47 datadir mem rule_variables frm 06 16_10 33 47 datadir mem rule_variables ibd 06 16_10 33 47 datadir mem rules frm 06 16_10 33 47 datadir mem rules ibd 06 16_10 33 47 datadir mem schema_version_v2 frm 06 16_10 33 47 datadir mem schema_version_v2 ibd 06 16_10 33 47 datadir mem statement_data frm 06 16_10 33 47 datadir mem statement_data ibd 06 16_10 33 47 datadir mem statement_examples frm 06 16_10 33 47 datadir mem statement_examples ibd 06 16_10 33 47 datadir mem statement_explain_data frm 06 16_10 33 47 datadir mem statemen
116. cially but also tables from MyISAM and other storage engines is MySQL Enterprise Backup The hot backup process consists of two stages The initial copying of the InnoDB data files produces a raw backup The apply step incorporates any changes to the database that happened while the backup was running Applying the changes produces a prepared backup these files are ready to be restored whenever necessary A full backup consists of a hot backup phase that copies the InnoDB data followed by a warm backup phase that copies any non InnoDB data such as MyISAM tables and frm files See Also apply cold backup frm file full backup InnoDB instance prepared backup raw backup warm backup ibd file Each InnoDB tablespace created using the file per table setting has a filename with a ibd extension This extension does not apply to the system tablespace which is made up of files named ibdatal ibdata2 and so on See Also ibz file system tablespace tablespace Ibz file When the MySQL Enterprise Backup product performs a compressed backup it transforms each tablespace file that is created using the file per table setting from a ibd extension to a ibz extension The compression applied during backup is distinct from the compressed row format that keeps table data compressed during normal operation An InnoDB tablespace that is already in compressed row format is not compressed a second time because that would save little or no space
117. cked up and the tables are then locked in read only mode while the redo log with only the portion containing the relevant changes made after the hot backup is being included in the backup Any tables created during the locking phase are ignored e with full locking The selected tables are locked in read only mode while they are being backed up The redo log is not included in the backup Any tables created during the locking phase are ignored Default back up with minimum locking There are some special requirements for restoring backups created with the use tts option see the explanations in Section 4 2 Performing a Restore Operation for details 5 1 10 Single File Backup Options These options are associated with single file backups You use them in combination with the mysqlbackup subcommands backup to image image to backup dir backup dir to image list image and extract that pack or unpack single image backups For usage information see Section 3 3 5 Making a Single File Backup e backup image IMAGE Command Line Format backup image IMAGE Permitted Values Type file name Specify the path name of the file used for a single file backup By default the single file backup is streamed to standard output so that you can pipe it directly to other commands such as tape backup or ssh related network commands You can optionally prefix the image name with file to signify file I O
118. ckup Table of Contents 3 Backing Up a Database Server ccceceeeecceeeeeeeee cece ee cea eee eeee eres ee ae aa rra eeeeeeaeaaaaeeeeeeeeeeeaaaaneeeneeeees 25 3 1 Before the First Backup svenire ienne aee ANE a eee 25 3 1 1 Collect Database Information 0 cece ceeeeeee cece eee eeeeeeeeeee ee ae aa eae eeeeeeeeseaaaaeeeeeeeeeeeeaaa 25 3 1 2 Grant MySQL Privileges to Backup Administrator 0 cccccceeeeeeeeeeeeeeeeaeaaeeeeeeeeeees 27 3 1 3 Designate a Location for Backup Data 00 ccc eececcceeeee eee eeee etna eeeeeeaaeeeeeeaaeeeeeeaaaeeees 28 3 2 The Typical Backup Verify Restore Cycle oooocoooccciccccccccnonococcnnnncnnnnnnnanccnnnncnnnnnnnancnnnancnnns 28 3 2 1 Backing Up an Entire MySQL Instance 0 cccceeeeeeee ee eeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeaees 28 3 2 2 Verifying a BACKUP iviciioiconiai dc 30 3 2 3 Restoring a Database at its Original Location eceeeeeee ee eeeeeeeeeeeeee ee aeeaeeeeeeeeeeeeaes 31 3 3 Backup Scenarios and Examples 0 ccccccececeeeeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaaaeeeeeeeeeeeaaaaeeeeeseeeees 31 3 3 1 Making a Full Backup raine e Nana aeaaea E KAKAN Aa KEANE KST 31 3 3 2 Making an Incremental Backup oocccccoocccccnnncccnnnnnnccnnnnnncnnnnnnnccnnnnnncrnnnnnnrrnnonnnernnnnnnees 32 3 3 3 Making a Compressed Backup ceeeeeeeeeeeeeaeeeeeeeeeeeeeeeaaeaeeeeeeeeeeseaaaaaeeeeeeeeeeeaaa 35 3 3 4 Making a Partial Backup saiaraha
119. ckup di r value 107 108 Chapter 6 Using MySQL Enterprise Backup with Replication Table of Contents 6 1 Setting Up a New Replication Slave cccccececeeeeeceaeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaaaaeeeeseeeeaeaaaaneeeeeees 109 6 2 Backing up and Restoring a Slave Database ccceceeeceee eee eeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaeaaeeneeeeeeees 110 6 3 Restoring a Master Database cccccceeee cece ener cece ENKANTEA KARENE AERAR ENESENN AKARKEN EEAS 110 Backup and restore operations are especially important in systems that use MySQL replication to synchronize data across a master server and a set of slave servers In a replication configuration MySQL Enterprise Backup helps you to deal with entire system images to set up new slave servers or to restore a master server in an efficient way that avoids unnecessary work for the slave servers Having multiple slave servers to choose from gives you more flexibility about where to perform backups When the binary log is enabled you have more flexibility about restoring to a point in time even a time that is later than the last backup GTID support with MySQL Server 5 6 and above MySQL Enterprise Backup supports the GTID feature of MySQL 5 6 e The GTID feature is compatible with the CSV tables that the mysq1backup command uses to log job progress and history e When a server using the GTID feature is backed up mysqibackup produces a file gtid_executed
120. ckup directory For example you can use this option to back up MEMORY tables with the mysqldump command storing the output in the backup directory To delay any redirection or variable substitution until the command is executed enclose the entire parameter value within single quotes 3 3 8 Making Scheduled Backups Maintaining a regular backup schedule is an important measure for preventing data loss for you MySQL server This section discusses some simple means for setting up a schedule for running MySQL Enterprise Backup For Linux and other Unix like platforms you can set up a cron job on your system for scheduled backups There are two types of cron jobs to set up a user cron job which is owned and run by a particular user do the following Log on as the user who runs MySQL Enterprise Backup and use the following command to invoke an editor for creating or modifying a crontab shell gt crontab e In the editor add an entry similar to the following one to the crontab and then save your changes 46 Making Scheduled Backups daily path to mysqlbackup mysqlbackup uroot backup dir path to backup folder cronbackups with ti This crontab entries invokes mysqlbackup to create a backup under the cronbackups directory at 00 00 00 everyday Outputs from the stderr and stdout streams are redirected to dev null so they will not invoke other actions on the part of the Cron server for example email notification
121. ckup operation which are backup_create xml and backup_content xml present in the meta subdirectory 5 1 11 Performance Scalability Capacity Options These options limit the resources used by the backup process in order to minimize backup overhead for busy or huge databases or specify behaviors of the process when encountering resource issues number of buffers num_buffers Command Line Format number of buffers NUMBER Permitted Values Type numeric Default 114 Min 1 Value Specifies the number of buffers each 16MB in size to use during multithreaded options Use a high number for CPU intensive processing such as backup particularly when using compression Use a low number for disk intensive processing such as restoring a backup This value should be at least as high as the number of read threads or write threads depending on the type of operation Default currently 14 For compression or incremental backup operations the buffer size is slightly more than 16MB to accommodate the headers One additional buffer is used for single file incremental backup and single file compressed backup Compressed backup compressed single file backup and uncompress apply log operations require one additional buffer for each process thread If you change the number of read write and processing threads you can experiment with changing this value so that it is slightly larger than the total number of threads s
122. ckups created with the use tts option The destination server must be running e Make sure that the required parameters for connecting to the server port number socket name etc are provided as command line options for mysqlbackup or are specified in the client section of a default file The destination server must be using the same page size that was used on the server on which the backup was made e The innodb_file_per_table option must be enabled on the destination server The tables being restored must not exist on the destination server A restore fails if the InnoDB file format of a per table data file ibd file to be restored does not match the value of the innodb_file_format system variable on the destination server In that case use the force 72 option with the restore commands to change temporarily the value of innodb_file format on the server in order to allow restores of per table data files regardless of their format 4 3 Point in Time Recovery from a Hot Backup Using MySQL Enterprise Backup and the binary log 10 files included by default in the incremental backups it creates except when they are created with the use tts option you can restore your database to its state at an arbitrary time t in between a full backup and an incremental backup or in between two incremental backups To do so 1 Binary logging must be enabled in MySQL before taking the full backup that serves as the base for this r
123. consistent Therefore only use mysqlbackup with an SBR slave if you know no temporary tables are created on the master 6 3 Restoring a Master Database To fix a corruption problem in a replication master database you can restore the backup taking care not to propagate unnecessary SQL operations to the slave servers 1 Using the backup of the master database do the apply log operation shut down the database and do the copy backx operation Edit the master my cnf file and comment out 109 bin so that the slaves do not receive twice the binary log needed to recover the master Replication in the slaves must be stopped temporarily while you pipe the binary log to the master In the slaves do mysql gt STOP SLAVE Start the master mysqid on the restored backup mysqld 110 Restoring a Master Database InnoDB Doing recovery scanned up to log sequence number 0 64300044 InnoDB Last MySQL binlog file position 0 5585832 file name omnibook pan 002 InnoDB prints the binary log file omnibook bin 002 in this case and the position 5585832 in this case it was able to recover to Pipe the remaining of the binary log files to the restored backup For example if there are two more binary log files omnibook bin 003 and omnibook bin 004 that come after omnibook bin 002 pipe them all with a single connection to the server see Point in Time Incremental Recovery Using the Binary Log for more instructions on us
124. cp user root password backup image sbt backup shoeprod 2011 05 30 backup dir backup backup to image Associates this backup with storage selector shoeprod mysqlbackup port 3306 protocol tcp user root password backup image sbt backup shoeprod 2011 05 30 sbt database name shoeprod backup dir backup backup to image Uses an alternative SBT library opt Other MMS so mysqlbackup port 3306 protocol tcp user root password backup image sbt backup shoeprod 2011 05 30 sbt lib path opt Other MMS so backup dir backup backup to image 122 Chapter 10 Troubleshooting for MySQL Enterprise Backup Table of Contents 10 1 Monitoring Backups with MySQL Enterprise Monitor 0 ccceceeeeeee ee eceeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaaa 123 10 2 Error codes of MySQL Enterprise Backup oooooccccccnccccccnooncnccnnconcnnnnnnnnccnnnnnnnnnnnnanccnnnnnnnnnnanancins 123 10 3 Working Around Corruption Problems oooooccccnncococononoconcnncnncnnnnnncnnnnnnnnnnnnnnnancennnnnonnnnnnancancnncinns 124 10 4 Using the MySQL Enterprise Backup LOGS ccocooococnccccnncoccnnnonocaconnnncnnononnancancnnconnnnnnananccancnnnnnns 124 10 5 Using the MySQL Enterprise Backup Manifest oooooooccccccncinccnnocnccccnncnnonononnanccnnnnnnnnnnnnannancancnnns 126 To troubleshoot issues regarding backup and restore with the MySQL Enterprise Backup product consider the following aspects e B
125. ction A 1 Limitations of MySQL Enterprise Backup for restrictions on backups at the same time as DDL operations Network Performance For data processing operations you might know the conventional advice that Unix sockets are faster than TCP IP for communicating with the database Although the mysqlbackup command supports the options protocol tcp protocol socket and protocol pipe these options do not have a significant effect on backup or restore performance These processes involve file copy operations rather than client server network traffic The database communication controlled by the protoco1 option is low volume For example mysqlbackup retrieves information about database parameters through the database connection but not table or index data Data Size If certain tables or databases contain non critical information or are rarely updated you can leave them out of your most frequent backups and back them up on a less frequent schedule See Section 5 1 9 Partial Backup and Restore Options for information about the relevant options and Section 3 3 4 Making a Partial Backup for instructions about leaving out data from specific tables databases or storage engines Partial backups are faster because they copy compress and transmit a smaller volume of data To minimize the overall size of InnoDB data files consider enabling the MySQL configuration option innodb_file_per_table This option can minimiz
126. cursively listed For usage and examples see Section 3 3 5 Making a Single File Backup Note Y The 1ist image operation can be performed on a cloud backup only if the cloud proxy supports range headers extract Unpacks an individual file or directory from a single file backup For troubleshooting or restoration operations that do not require the full set of backup data The resulting file or directory goes in the current directory or in backup dir if specified All files and directory contents in the image with absolute path names are extracted into the same absolute path names on the local system For usage and examples see Section 3 3 5 Making a Single File Backup The src entry path option can be used for selective extraction of a single file or single directory in image Specify the path as it appears in the image The dst entry path option along with src ent ry path option can be used to extract a single file or single directory into a user specified file or directory respectively If the src ent ry option is used but dst ent ry option is omitted then the selected file or directory is extracted to the same path in the local file system The default destination for the extract is the current working directory It can be overridden by the backup di r option All the files with relative pathnames in the image are extracted to pathnames relative to the destination directory If the image contains some entr
127. d scalability 92 encrypted 119 full 31 141 hot 5 incremental 6 32 80 145 InnoDB tables only 57 logical 6 message logging 98 monitoring 123 parallel 6 partial 36 84 physical 6 prepared 7 49 preparing to restore 49 progress report 99 raw 7 49 scheduled 46 single file 6 streaming 6 43 to cloud 44 to tape 44 121 troubleshooting 123 uncompressed 6 39 verifying 30 warm 5 backup_content xml 7 backup_content xml file 126 backup_create xml 7 backup_create xml file 126 BACKUP_HISTORY table 124 BACKUP_PROGRESS table 124 backup_variables txt file 7 Barracuda 57 170 benchmarking 113 binary log 53 170 binlog 170 C changelog 147 changes release notes 147 cloud backups 44 cloud access key id option 104 cloud aws region option 104 cloud bucket option 103 cloud object key option 104 cloud proxy option 104 cloud secret access key option 104 cloud service option 103 cloud trace option 104 cold backup 5 170 command line tools 6 comments option 79 comments file option 79 comments txt file 7 79 compress option 35 79 compress level option 35 80 compress method option 80 compressed backup 145 compressed backups 6 35 40 50 79 compression 170 compression level 171 configuration file 171 configuration options 105 connection 171 connection options 72 copy back option 17 31 49 66 copy back and apply log option 67 corrupt
128. d term regardless of how the transaction is characterized the Corresponding Source conveyed under this section must be accompanied by the Installation Information But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product for example the work has been installed in ROM 154 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 The requirement to provide Installation Information does not include a requirement to continue to provide support service warranty or updates for a work that has been modified or installed by the recipient or for the User Product in which it has been modified or installed Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network Corresponding Source conveyed and Installation Information provided di accorda with this section must be in lt a format that ds publicly documented and with an implementation available to the public in source code form and must require no special password or key for unpacking reading or copying 7 Additional Terms Additional permissions are terms that supplement the terms of this License by making exceptions from one or more of its conditions Additional permissions that are applicable
129. d the stated conditions are met This License explicitly affirms your unlimited permission to run the unmodified Program The output from running a covered work is covered by this License only if the output given its content constitutes a covered work This License acknowledges your rights of fair use or other equivalent as provided by copyright law You may make run and propagate covered works that you do not convey without conditions so long as your license otherwise remains in force You may convey covered works to others for the sole purpose of having them make modifications exclusively for you or provide you with facilities for running those works provided that you comply with the terms of this License in conveying all material for which you do not control copyright Those thus making or running the covered works for you must do so exclusively on your behalf under your direction and control on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you Conveying under any other circumstances is permitted solely under the conditions stated below Sublicensing is not allowed section 10 makes it unnecessary 3 Protecting Users Legal Rights From Anti Circumvention Law No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996 or similar law
130. data_file_path lt innodb_data_file_path_of_backedup_server gt uncompress backup image copy back and apply log Example 3 16 Stream a Backup Directory to a Remote MySQL Server The following command streams a backup directory as a single backup file to be restored on a remote MySQL server 43 Making a Single File Backup mysqlbackup backup image backup dir path to my backup backup dir to image ssh lt user name gt lt remote host name gt mysqlbackup backup dir backup_tmp datadir data backup image copy back and apply log 3 3 5 2 Backing Up to Tape Tape drives are affordable high capacity storage devices for backup data MySQL Enterprise Backup can interface with media management software MMS such as Oracle Secure Backup OSB to drive MySQL backup and restore jobs The media management software must support Version 2 or higher of the System Backup to Tape SBT interface For information about doing tape backups in combination with MMS products such as Oracle Secure Backup see Chapter 9 Using MySQL Enterprise Backup with Media Management Software MMS Products 3 3 5 3 Backing Up to Cloud Storage MySQL Enterprise Backup supports cloud backup since version 3 10 2 Only single file backups can be created on and restored from cloud storage All mysqibackup options compatible with single file operations including for example the incremental compression partial and encrypti
131. delete of data By skipping the unused pages during backups this option can reduce the backup sizes and thus the required disk space and I O resources for the operations However subsequent app1y 1og operations on the backups will take more time to complete as the unused pages are inserted back into the tables during the operations skip binlog Do not include binary log files in a backup Binary log files are included by default for all kinds of online backups full incremental compressed partial single file etc See Section 1 4 Files that Are Backed Up for details Use this option to skip backing up binary logs if resource performance or other issues arise when creating offline backups or when creating an incremental backup that is based on a full backup created with the no 1ocking option See Appendix A Note Y Due to some known issues users should always use the skip binlog option MySQL Enterprise Backup Limitations for details skip relaylog Do not include relay log files in a backup Relay log files are included by default for all kinds of online backups full incremental compressed partial single file etc of a slave server See Section 1 4 Files that Are Backed Up for details Use this option to skip backing up relay logs if resource performance or other issues arise Note R If a user runs a FLUSH LOGS statement while backup is in progress for a slave the backup
132. derivative works of the Software unless such copies or derivative works are solely in the form of machine executable object code generated by a source language processor THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE TITLE AND NON INFRINGEMENT IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY WHETHER IN CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Copyright C 2004 Ami Tavory and Vladimir Dreizin IBM HRL Permission to use copy modify sell and distribute this software is hereby granted without fee provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation None of the above authors nor IBM Haifa Research Laboratories make any representation about the suitability of this software for any purpose It is provided as is without express or implied warranty E 4 Google Controlling Master Thread I O Rate Patch License The following software may be included in this product Google Controlling master thread I O rate patch 162 Google SMP Patch License Caricias e 2009 Coge aa All rights reserved Redistribution and use in sour
133. dicators with different meters Progress 300 of 1540 MB state Waiting for locks Progress 400 of 1450 MB state Copying InnoDB data compression 30 The exact set of meters included in the progress indicator depends on the command and the options used for it s progress interval SECONDS Command Line Format progress interval SECONDS Permitted Values Type numeric Default 2 Min 1 Value Max 100000 Value Interval between progress reports in seconds Default value is two seconds The shortest interval is 1 second and the longest allowed interval is 100000 seconds 5 1 14 Encryption Options These options are for creating encrypted single file backups and for decrypting them See Chapter 8 Encryption for Backups for more details and usage information on the encryption and decryption functions of MySQL Enterprise Backup enexry pe 102 Cloud Storage Options Encrypt the data when creating a backup image by a backup to image operation or when packing a backup directory into a single file with the backup dir to image subcommand It cannot be used with the backup or backup and apply 10g subcommand decrypt Decrypt an encrypted backup image when performing an extract image to backup dir or copy back and apply 1lo0g operation It is also used for performing a validate or list image operation on an encrypted backup image The option cannot be used in a apply
134. dix A MySQL Enterprise Backup Limitations for details Saved under the datadi r directory under the backup directory Use the skip relaylog option to exclude relay logs in the backup For offline backup use the relay log index option to specify the absolute path of the index file on the MySQL server that lists all the used relay log files if it is different from the default value of the option for mysqibackup to find the relay log files and include them in the backups 11 Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes slave status log files image file Usually named master info and relay log info they are included by default in a backup of a slave database in a replication setup See Slave Status Logs for details A single file backup produced by the backup to image option with a name specified by the backup image option Saved under the datadir directory under the backup directory For an offline backup use the master info fil and relaylog info file options to specify the absolute paths of the information files if they are different from the default values of the options for mysqlbackup to find those files and include them in the backups If your backup data directory consists only of zero byte files with a single giant data file in the top level directory you have a single file backup You can
135. ds to MySQL server using a database connection The general connection details are the same as described in Connecting to the MySQL Server in the MySQL Reference Manual As part of the mysqibackup invocation specify the appropriate user password port and or socket options that are necessary to connect to the MySQL server You can specify the following connection specific options in the mysqlbackup or client sections of a MySQL configuration file or through mysq1backup command line options mysqlbackup reads your default configuration files and then the my cn file specified on the command line 72 Connection Options Note Y mysqlbackup reads only user password port and socket options from the client group and ignores any other connection options e If you do not provide a value for the password the command prompts for one from the keyboard e The host option is allowed in the configuration file for compatibility but currently it has no effect The mysqlbackup command always connects to the local server s IP address Options Common to mysqld login path name port port num protocol tcp socket pipe memory pipe alias for protocol pigpe user name short option u host hostname socket name shared memory base name value Windows only character sets dir PATH default character set VALUE secure auth Don t connect to pre4 1
136. e tmpdir general log etc and any global variable that uses an absolute filepath to avoid the accidental usage of the wrong file locations by the target server During a copy back or copy back and apply log operation the server repository options values e g datadir innodb_data_home_dir etc in the file are modified if the command makes changes to them through the command options However during an apply incremental backup operation the values already saved in the file take precedence and they are not modified by the option values supplied through the command 14 InnoDB Data File Name Pattern or Extension Relation to Original Data Files Notes Warning O When using the file to restart the target server change parameters like tmpdir general log etc and any global variable that uses an absolute filepath to avoid the accidental usage of the wrong file locations by the target server InnoDB Data Data managed by the InnoDB storage engine is always backed up The primary InnoDB related data files that are backed up include the ibdata files that represent the system tablespace and possibly the data for some user tables any ibd files containing data from user tables created with the file per table setting enabled data extracted from the ib_logfile files the redo log information representing changes that occur w
137. e MySQL Tables for instructions on this command Warning Restoring a database to an older MySQL version i e server downgrading is only supported when the original and the final versions are in the same release series 55 Steps to Back Up on MySQL 5 5 and Restore on MySQL 5 6 e g going from 5 5 30 to 5 5 29 Downgrading to a lower series e g from 5 6 33 to 5 5 33 might cause server crashes or data corruption Steps to Back Up on MySQL 5 5 and Restore on MySQL 5 6 Back up the data on the MySQL 5 5 server Restore the data to the directory you plan to use as the MySQL 5 6 server s data directory by running an apply log and then a copy back operation on the backup Restart the MySQL 5 5 server using the intended data directory for the MySQL 5 6 server as its own data directory Note Y This is an extra step beyond the normal restore and upgrade procedures special to the restoration of MySQL 5 5 data to MySQL 5 6 server with it the MySQL 5 5 server prepares the data for an upgrade to MySQL 5 6 by performing some clean up steps on the data similar to what the server would do during a crash recovery Stop the MySQL 5 5 server Install the MySQL 5 6 server Start the MySQL 5 6 server Run upgrade steps as documented in the MySQL reference manual on the restored data Make sure the mysql_upgrade that comes with MySQL 5 6 is applied Check data Steps to Back Up on MySQL 5 1 and Restore on MySQL 5 5 Back up
138. e data size for InnoDB tables in several ways e It prevents the InnoDB system tablespace from ballooning in size allocating disk space that can afterwards only be used by MySQL For example sometimes huge amounts of data are 115 The Apply Log Phase only needed temporarily or are loaded by mistake or during experimentation Without the innodb_file_per_table option the system tablespace expands to hold all this data and never shrinks afterward It immediately frees the disk space taken up by an InnoDB table and its indexes when the table is dropped or truncated Each table and its associated indexes are represented by a ibd file that is deleted or emptied by these DDL operations It allows unused space within a ibd file to be reclaimed by the OPTIMIZE TABLE statement when substantial amounts of data are removed or indexes are dropped It enables partial backups where you back up some InnoDB tables and not others as discussed in Section 3 3 4 Making a Partial Backup Avoid creating indexes that are not used by queries Because indexes take up space in the backup data unnecessary indexes slow down the backup process The copying and scanning mechanisms used by mysqlbackup do not rely on indexes to do their work For example it is typically not helpful to create an index on each column of a table because only one index is used by any query Because the primary key columns are included in each InnoDB secondary
139. e developers and authors protection the GPL clearly explains that there is no warranty for this free software For both users and authors sake the GPL requires that modified versions be marked as changed so that their problems will not be attributed erroneously to authors of previous versions Some devices are designed to deny users access to install or run modified versions of the software inside them although the manufacturer can do so This is fundamentally incompatible with the aim of protecting users freedom to change the software The systematic pattern of such abuse occurs in the area of products for individuals to use which is precisely where it is most unacceptable Therefore we have designed this version of the GPL to prohibit the practice for those products If such problems arise substantially in other domains we stand ready to extend this provision to those domains in future versions of the GPL as needed to protect the freedom of users Finally every program is threatened constantly by software patents States should not allow patents to restrict development and use of software on general purpose computers but in those that do we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary To prevent this the GPL assures that patents cannot be used to render the program non free The precise terms and conditions for copying distribution and 150 GNU General Pu
140. e dynamic row format you might switch some tables to Barracuda format You select the file format to use by setting the innodb_file_format option before creating the table See Also Barracuda compression file format apply The operation that transforms a raw backup into a prepared backup by incorporating changes that occurred while the backup was running using data from the log See Also log prepared backup raw backup B backup The process of copying some or all table data and metadata from a MySQL instance for safekeeping Can also refer to the set of copied files This is a crucial task for DBAs The reverse of this process is the restore operation With MySQL physical backups are performed by the MySQL Enterprise Backup product and logical backups are performed by the mysqldump command These techniques have different characteristics in terms of size and representation of the backup data and speed especially speed of the restore operation Backups are further classified as hot warm or cold depending on how much they interfere with normal database operation Hot backups have the least interference cold backups the most See Also cold backup hot backup logical backup mysqldump physical backup warm backup backup directory The directory under which the backup data and metadata are stored permanently or temporarily It is used in most kinds of backup and restore operations including single file backups and restores See t
141. e number of threads to use for processing data such as compressing or uncompressing backup files Default currently 6 This default applies to these kinds of operations extract and backup It is ignored when you use any of the options incremental with redo log only apply incremental backup copy back or backup dir to image If you specify a value of 0 it is silently adjusted to 1 The maximum is 15 if you supply a negative value it is silently adjusted to 15 For app1y 10g operations the number of process threads is always 1 regardless of this option setting See Section 7 1 Optimizing Backup Performance and Section 7 2 Optimizing Restore Performance for advice about recommended combinations of values for read threads process threads and write threads for various hardware configurations such as RAID or non RAID storage devices write threads num_threads Command Line Format write threads NUMBER Permitted Values Type numeric 93 Performance Scalability Capacity Options Default Min Value Eb pa Max 15 Value Specifies the number of threads to use for writing data to disk Default currently 1 This default applies to these kinds of operations copy back extract and backup It is ignored when you use any of the single file backup options 1ist image or validate If you specify a value of 0 it is silently adjusted to 1 The maximu
142. e same material under section 10 9 Acceptance Not Required for Having Copies You are not required to accept this License in order to receive or run a copy of the Program Ancillary propagation of a covered work occurring solely as a consequence of using peer to peer transmission to receive a copy likewise does not require acceptance However nothing other than this License grants you permission to propagate or modify any covered work These actions infringe copyright if you do not accept this License Therefore by modifying or propagating a covered work you indicate your acceptance of this License to do so 10 Automatic Licensing of Downstream Recipients Each time you convey a covered work the recipient automatically receives a license from the original licensors to run modify and propagate that work subject to this License You are not responsible for enforcing compliance by third parties with this License Ay entity transaction 18 a transaction transterring control of an organization or substantially all assets of one or subdividing an organization or merging organizations If propagation of a covered work results from an entity transaction each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party s predecessor in interest had or could give under the previous paragraph plus a right to possession of the 156 GNU General Public License Version 3 0 29 June 2007
143. e space overhead on the database server You also avoid the performance overhead of saving a set of backup files and then bundling them into an archive for transport to another server or storage device For details see Section 3 3 5 1 Streaming the Backup Data to Another Device or Server When streaming backup data to tape you typically do not compress the backup because the CPU overhead on the database server to do the compression is more expensive than the additional storage space on the tape device When streaming backup data to another server you might compress on the original server or the destination server depending on which server has more spare CPU capacity and how much network traffic the compression could save Or you might leave the backup data uncompressed on the destination server so that it is ready to be restored on short notice For disaster recovery when speed to restore the data is critical you might prefer to have critical backup data already prepared and uncompressed so that the restore operation involves as few steps as possible It is during a disaster recovery that speed is most critical For example although a logical backup performed with the mysqldump command might take about the same time as a physical backup with the MySQL Enterprise Backup product at least for a small database the MySQL Enterprise Backup restore operation is typically faster Copying the actual data files back to the data directory skips t
144. e the size of the redo log issue the command SHOW VARIABLES LIKE innodb_log_file and based on the output multiply the innodb_log_file_size setting by innodb_log_files_in_group To compute redo log size at the physical level look in the datadir directory of the MySQL instance and sum the sizes of the files matching the pattern ib_logfile e The InnoDB LSN value corresponds to the number of bytes written to the redo log To check the LSN at some point in time issue the command SHOW ENGINE INNODB STATUS and look under the LOG heading While planning your backup strategy record the LSN values periodically and subtract the earlier value from the current one to calculate how much redo data is generated each hour day and so on Prior to MySQL 5 5 it was common practice to keep the redo logs fairly small to avoid long startup times when the MySQL server was killed rather than shut down normally In MySQL 5 5 and higher the performance of crash recovery is significantly improved as described in Optimizing InnoDB Configuration Variables With those releases you can make your redo log files bigger if that helps your backup strategy and your database workload 81 Incremental Backup Options e This type of incremental backup is not so forgiving of too low start 1sn values as the standard incremental option For example you cannot make a full backup and then make a series of incremental with redo 1o0g on1y backups al
145. e the verification function of the tool and the option write crc32 makes innochecksum rewrite the checksum values on the disk IMPORTANT Do not treat corruption problems as a minor annoyance Find out what is wrong with the system that causes the corruption however such troubleshooting is beyond the scope of this manual 10 4 Using the MySQL Enterprise Backup Logs The mysql backup_progress table lets you monitor backup jobs as they run The mysql backup_history table lets you see the results of completed jobs Because these tables are created with the CSV storage engine you can query them from SQL or parse the text files from an application or script To skip updating these tables for a backup operation use the no history 1ogging option backup progress Table Each row in the backup_progress table records a state change or message from a running backup job The backup_progress table has the following columns 124 backup_history Table backup_id tool_name error_code error_message e current_time current state Because the CSV storage engine cannot represent NULL values directly the logs use a 1 value instead for example in the binlog_pos column if binary logging is not enabled Use the backup_id value to group together the information for a single backup operation and to correlate with the corresponding row in the backup_history table after the job is finished Use the error_code and error_messag
146. e undo logs are divided between when you use a non zero innodb_undo_logs setting By default all the undo logs are part of the system tablespace and the system tablespace will always contain one undo tablespace in addition to those configured by innodb_undo_tablespaces with timestamp Creates a subdirectory underneath the backup directory with a name formed from the timestamp of the backup operation Useful to maintain a single backup directory containing many backup snapshots 78 Metadata Options Default no timestamped subdirectory is created To reuse the same backup directory for a new backup either remove the previous backup files manually or specify the force 72 option to overwrite them 5 1 6 Metadata Options These options control the generation of metadata about backups Some metadata is stored in the backup directory other metadata is stored in tables within the mysql database of the backed up instance no history logging Turns off the recording of backup progress and history in logging tables inside the backed up database See Section 10 4 Using the MySQL Enterprise Backup Logs for details about these tables Default history logging is enabled When no connection is specified history logging is automatically disabled When connect if online Is specified history logging only works if a database connection is successfully established during the backup comment s STRING Command
147. e values to track the progress of the job and detect if a serious error occurs that requires stopping the backup operation Use the current_time and current_state values to measure how long each part of the backup operation takes to help with planning the time intervals for future backups backup_history Table Each row in the backup_history table records the details of one completed backup job produced by the mysqlbackup command The backup_history table has the following columns backup_id tool_name start_time end_time binlog_pos binlog_file e compression level engines e innodb_data_file path e innodb_file _ format start_lLsn e end_isn backup_type backup_format mysql_data_dir 125 Using the MySQL Enterprise Backup Manifest innodb_data_home_dir innodb_log_group_home_dir e innodb_log_files_in_group innodb_log_file_size backup_destination e lock_time exit_state e last_error last_error_code Use the end_isn value to automate operations related to incremental backups When you take a full or incremental backup you specify the end LSN from that backup as the starting LSN for the next incremental backup Use the values that correspond to backup related configuration settings such as mysql_data_dir innodb_data_home_dir and backup_dest ination to confirm that the backups are using the right source and destination directories Use the values exit
148. eaaeaeenees 39 3 2 Making a Compressed Partial Backup c cceeeeeeeeee cree ea eeeeeeee tees ae aaeaeeeeeeeeeseaaaaeeeeeseeeeeeaeaaeaees 40 3 3 Single File Backup to Absolute Path ccccccececeaeceeeeeeeeeeeeeae aaa eeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeeeeeseeeees 41 3 4 Single File Backup to Relative Path ooooooonoccciccccccnononncnconcnnconnnnnnancnncnncononnnnnnnncannnnnnnnnananccnncnncnnns 41 3 5 Single File Backup to Standard Output 0 cccccceeeeeeeeeeeeeeeee cece aaa eeeeeeee sees aaeaeeeeeeeeeeeaaaaeeeeeeeeeees 41 3 6 Convert Existing Backup Directory to Single Image cceceeeeeeeceeeeeeeeeeeeeeeaeaaeaeeeeeeeeeeeeaaaaeenees 41 3 7 Extract Existing Image to Backup Directory oocccoconcccccnoccccnnnnnnccnnnnnnccnnnnnnccnnnonnccnnnnnnrcnnnnnncrnnnnnners 42 3 8 List Single File Backup Content 0 cccceceeeeeceeeeee ents ee ee eee tect eeee ee aa aaae tees eeeeseaeaaaaeeeeeeeeeaeaaaaees 42 3 9 Extract Single File Backup into Current Directory ooooconccccccccicccnnonnccconnnnncnnnonnancnnnnncnnnnnnnannancancnnns 42 3 10 Extract Single File Backup into a Backup Directory ccccceeeceeeeeaeeeeeeeeeeeeeeeaeaaeeeeeeeeeeeeaeaaeeees 42 3 11 Selective Extract of Single File ooooononociccnnnoccccconcccconconconononnnncnncnnconnnnnnancnn cnn cn nn nn nnnannrn rca nnnnnnnns 42 3 12 Selective Extract of Single Directory oooooocococonocncicccnccnononcnnccncnnconononnnncnncnn conc nnnnnan cnn nn
149. ecause it does not incorporate changes that occurred while the backup was running The apply operation transforms the backup files into a prepared backup that is ready to be restored 177 See Also apply prepared backup redo log A set of files typically named ib_logfile0 and ib_logfilel that record statements that attempt to change data in InnoDB tables These statements are replayed automatically to correct data written by incomplete transactions on startup following a crash The passage of data through the redo logs is represented by the ever increasing LSN value The 4GB limit on maximum size for the redo log is raised in MySQL 5 6 See Also LSN regular expression Some MySQL Enterprise Backup features use POSIX style regular expressions for example to specify tables databases or both to include or exclude from a partial backup Regular expressions require escaping for dots in filenames because the dot is the single character wildcard no escaping is needed for forward slashes in path names When specifying regular expressions on the command line surround them with quotation marks as appropriate for the shell environment to prevent expansion of characters such as asterisks by the shell wildcard mechanism See Also exclude include partial backup relay log A record on a slave server for the events read from the binary log of the master and written by the slave I O thread The relay log like the binary log consists of a set
150. ed mysqlbackup INFO backups backup dir datadir tpch tabnorm8 ibz Validated mysqlbackup INFO backups backup dir datadir tpch tabnorm9 ibz Validated mysqlbackup INFO backups backup dir datadir tpch tabrowformat ibz Validated 140219 11 22 45 mysqlbackup INFO Validate backup directory operation completed successfully 5 1 1 5 Work with Single File Backups 69 Subcommands To simplify transfer and management of backup data you can keep each backup in a single file the backup image The backup to image option performs a backup directly to a single file or the options here can pack an existing backup into a single file or unpack a single file backup to a full backup directory structure There are other options for working with single file backups which are explained below For usage and examples see Section 3 3 5 Making a Single File Backup mysqlbackup STD OPTIONS backup image IMAGE backup dir PATH MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS image to backup dir mysqlbackup STD OPTIONS backup dir PATH backup image IMAGE MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS backup dir to image mysqlbackup STD OPTIONS backup image IMAGE src entry PATH MESSAGE LOGGING OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS list image
151. eeeeeeeaeaaeeneeeeeeeeeaeaaaateeeeeeeeeeeaaaaenees 147 E Licenses for Third Party Component ccccccecceeeeeeeeeee ee ee eae teeeeeeeeeaeaaeaeeeeeeeeeeaeaaeaeeeeeeeeeeaeaae 149 EI cURL libcurl License como it ee tis el ea aie eed 149 E 2 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 ccccecccececc cece ee eeee ce ee ee eeee ca eeeeaeeesaeeeaeeeseeeeeaeeeesaeeeaaes 149 E 3 GNU Standard C Library libstdc License 20 0 0 eee cece cece cece ae ee eeeeeeeeeeeeaeaaeeeeeeeeeees 161 E 4 Google Controlling Master Thread I O Rate Patch License eseese 162 E 5 Google SMP Patch License 0 cccccceeeaeeeeeeeeeeeee ee ae eats ee nese ee ae aaaeeeeeeeeeseaaaaaeeeeeeeeeaeaaea 163 EG EZA LICONSA AAA A A ae eed 164 E7 OpenSsl VicO LicenSe unica ains 164 E 8 Percona Multiple l O Threads Patch License coocnncococonocccincnnccnnnonnnnccncancnnnnnnnancnnnancnncnnnnnns 166 E 9 RegEX Spencer Library License oooococcnccocococonococcnnnnncnnnonnnncnnnancnnnnnnnancnnnnn cono nnnnananncnnnnncnnns 166 E 10 RFC 3174 US Secure Hash Algorithm 1 SHA1 License oooocciccnncococonococoncnncnncnnnanncannnnos 167 End zlib ico ti ed eo eae eta eam A 167 MySQL Enterprise Backup Glossary cccececeeeeeeeeeeeee ee eee eeeeeeeee esse stts ee neeeeeeeeeaeaaeaseeeeeeeeeaeaaaaneeeeeees 169 133 134 Appendix A MySQL Enterprise Backup Limitations Table o
152. efore troubleshooting any problem familiarize yourself with the known limits and restrictions on the product in Appendix A MySQL Enterprise Backup Limitations e If the mysqlbackup command encounters problems during operating system calls it returns the corresponding OS error codes You might need to consult your operating system documentation for the meaning and solution of these error codes The output from the mysqlbackup command is sent to stderr rather than stdout By default the same output is also saved to a log file in the backup_di r for use in error diagnosis See Section 5 1 12 Message Logging Options for details on how to configure this logging feature Incremental backups require care to specify a sequence of time periods You must record the final LSN value at the end of each backup and specify that value in the next incremental backup You must also make sure that the full backup you restore is prepared correctly first so that it contains all the changes from the sequence of incremental backups e As the mysqibackup command proceeds it writes progress information into the mysql backup_progress table When the command finishes the backup operation it records status information in the mysql backup_history table You can query these tables to monitor ongoing jobs see how much time was needed for various stages and check if any errors occurred 10 1 Monitoring Backups with MySQL Enterprise Monitor With the combination
153. em log_db_actions P p6 ibd 0 33 47 datadir mem log_db_actions P p7 ibd 0 33 47 datadir mem log_db_actions P p8 ibd 0 33 47 datadir mem log_db_actions frm 0 33 47 datadir mem log_db_actions par 0 33 47 datadir mem loghistogram_data frm 0 33 47 datadir mem loghistogram_data ibd 0 33 47 datadir mem map_entries frm 0 33 47 datadir mem map_entries ibd 0 33 47 datadir mem migration frm 0 33 47 datadir mem migration ibd 0 33 47 datadir mem migration_migration_state frm 0 33 47 datadir mem migration_migration_state ibd 0 33 47 datadir mem migration_migration_status_servers frm 0 33 47 datadir mem migration_migration_status_servers ibd 0 33 47 datadir mem migration_state frm 0 33 47 datadir mem migration_state ibd Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2
154. emental incremental base dir incr backup wednesday incremental backup dir incr backup thursday backup Many lines of output mysqlbackup Backup created in directory incr backup thursday mysqlbackup start_lsn 2654255717 mysqlbackup incremental_base_lsn 2666733462 mysqlbackup end_lsn 2666736714 101208 17 14 58 mysqlbackup mysqlbackup completed OK See Section C 3 Sample Directory Structure for Incremental Backup for a listing of files from a typical incremental backup Once again we apply to the full backup any changes that occurred while the backup was running mysqlbackup backup dir full backup 2010 12 08_17 14 11 apply log many lines of output 101208 17 15 10 mysqlbackup Full backup prepared for recovery successfully 101208 17 15 10 mysqlbackup mysqlbackup completed OK Then we apply the changes from the incremental backup 34 Making a Compressed Backup mysqlbackup incremental backup dir incr backup 2010 12 08_17 14 48 backup dir full backup 2010 12 08_17 14 11 apply incremental backup Many lines of output 101208 17 15 12 mysqlbackup mysqlbackup completed OK Now the data files in the full backup directory are fully up to date as of the time of the last incremental backup This example shows an incremental backup The last full backup we ran reported that the highest LSN was 2638548215 mysqlbackup Was able to parse the log up to Isn
155. ence_inventory_attributes frm 0 33 47 datadir mem hilo_sequence_inventory_attributes ibd 0 33 47 datadir mem hilo_sequence_inventory_instances frm 0 33 47 datadir mem hilo_sequence_inventory_instances ibd 0 33 47 datadir mem hilo_sequence_inventory_namespaces frm 0 33 47 datadir mem hilo_sequence_inventory_namespaces ibd 0 33 47 datadir mem hilo_sequence_inventory_types frm 0 33 47 datadir mem hilo_sequence_inventory_types ibd 0 33 47 datadir mem hilo_sequence_rule_alarms frm 0 33 47 datadir mem hilo_sequence_rule_alarms ibd 0 33 47 datadir mem hilo_sequence_rule_eval_results frm 0 33 47 datadir mem hilo_sequence_rule_eval_results ibd 0 33 47 datadir mem inventory_attributes frm 7 datadir mem inventory_attributes ibd 0 33 47 datadir mem inventory_instance_attributes frm 0 33 47 datadir mem inventory_instance_attributes ibd 0 33 47 datadir mem inventory_instance_tags frm 0 33 47 datadir mem inventory_instance_tags ibd 0 33 47 datadir mem inventory_instances frm 0 33 47 datadir mem inventory_instances ibd 0 33 47 datadir mem inventory_namespaces frm 0 33 47 datadir mem inventory_namespaces ibd 0 33 47 datadir mem inventory_types frm 0 33 47 datadir mem inventory_types ibd 0 33 47 datadir mem log_db_actions P p0 ibd 0 33 47 datadir mem log_db_actions P pl ibd 0 33 47 datadir mem log_db_actions P p2 ibd 0 33 47 datadir mem log_db_actions P p3 ibd 0 33 47 datadir mem log_db_actions P p4 ibd 0 33 47 datadir mem log_db_actions P p5 ibd 0 33 47 datadir m
156. environment option 91 sbt lib path option 91 selective backup 179 selective restore 179 server 179 server repository 179 show progress 100 single file backup 6 69 90 179 183 skip binlog 96 skip relaylog 96 skip unused pages 96 slave 109 110 179 slave info option 104 sleep option 94 space for backup data 6 src entry option 90 start Isn option 83 streaming 43 179 streaming backups 6 suspend 179 suspend at end option 105 system backup to tape 179 system tablespace 7 179 T table 180 tablespace 180 tape backups 44 121 third party contributions 149 transportable tablespace 180 TRG file 7 TRG file 180 TRN file 7 troubleshooting for backups 123 TTS 180 U uncompress option 80 uncompressed backups 6 39 use tts option 86 V validate option 68 validating a backup 68 verifying a backup 30 W warm backup 5 180 with timestamp option 78 write threads option 94 184
157. erent server first to avoid the CPU and I O overhead of performing this operation on the database server After applying the log periodically take incremental backups which are much faster and smaller than a full backup like these ones Making a Partial Backup with the Legacy Options Important A Information in this subsection is only for using the legacy options of include databases databases list file and only innodb with frm which will be deprecated in the upcoming issues For creating partial backups it is strongly recommended that the new options of include tables and xclude tables be used instead Note that you cannot combine the legacy and the new partial backup options in a single command MySQL Enterprise Backup can make different kinds of partial backup using the legacy partial backup options e Including certain InnoDB tables but not others This operation involves the include only innodb and only innodb with frm options e Including certain non InnoDB tables from selected databases but not others This operation involves the databases and databases list file options For syntax details on all these options see Legacy Partial Backup Options Note Y Typically a partial backup is more difficult to restore than a full backup because the backup data might not include the necessary interrelated pieces to constitute a complete MySQL instance In particular InnoDB tables have inter
158. ers cirrus backups 2011 06 16_10 34 12 datadir ib_logfilel Users cirrus backups 2011 06 16_10 34 12 datadir ibbackup_logfile Users cirrus backups 2011 06 16_10 34 12 datadir ibdatal Users cirrus backups 2011 06 16_10 34 12 datadir mem Users cirrus backups 2011 06 16_10 34 12 datadir mem db opt Users cirrus backups 2011 06 16_10 34 12 datadir mem dc_p_double P p0 ibd Same database and table files as the previous backup Users cirrus backups 2011 06 16_10 34 12 meta Users cirrus backups 2011 06 16_10 34 12 meta backup_content xml Users cirrus backups 2011 06 16_10 34 12 meta backup_create xml Users cirrus backups 2011 06 16_10 34 12 meta backup_variables txt C 2 Sample Directory Structure for Compressed Backup Here is an excerpt from the file listing under backup dir datadi r mem for a backup from a MySQL Enterprise Monitor repository database Notice how the ibd files for InnoDB tables are now compressed to ibz files while other kinds of files are left unchanged inventory_types frm inventory_types ibz log_db_actions P p0 ibz log_db_actions P pl1 ibz log_db_actions P p2 ibz log_db_actions P p3 ibz log_db_actions P p4 ibz log_db_actions P p5 ibz log_db_actions P p6 ibz log_db_actions P p7 ibz log_db_actions P p8 ibz logmdiomacEakonsr acm log_db_actions par loghistogram_data frm loghistogram_data ibz C 3 Sample Directory Structure for Incremental Backup An incremental backup p
159. es 80 5 1 9 Partial Backup and Restore Options ccceceeeeeeeeeeeeeeeeeeeeeeaeaaeeteeeeeeeeeaeaaea 84 5 1 10 Single File Backup Options 00coooccccccccccncnonccoccnnnnncnnnnnncnccnnnncnnnnnnnan cnn nnn cn nnnnnnanes 90 5 1 11 Performance Scalability Capacity Options ooooocoonconncccincnnccnnnnccnccncancnncnnnnnns 92 5 1 12 Message Logging Options oocoooconoccccncnnconononenaconcnncnnnnnnnancnncnnnancnnnnanancnnncnnnnnns 98 5 1 13 Progress Report Options occoccocococonccoccnncnnconnnnncnccnnnnnnnnnnnnanccnnnnnnnnnnnnancancancnnns 99 5 1 14 Encryption Options tn ei a a a aidaa aS 102 5 1 15 Cloud Storage Options ococcoccococoncccconcnnconcnnnnancnncnnnononnnnnanccnnnnnnnnnnanancancancinns 103 MySQL Enterprise Backup User s Guide Version 3 11 1 5 1 16 Options for Special Backup Types ceeeeeeeee esac eeteeeeeeeeeaeaaeaeeeeeeeeeeeeaaa 104 5 2 Configuration Files and Parameters 0 ccccececeeeeeeeeeeeeeeeeeaeaeeeeeeeeeeeeeaeaaaaeeeeeeeeeeeeaaa 105 6 Using MySQL Enterprise Backup with Replication cccccccccceeeeeeeeeeeeeeeaaeeeeeeeeeeeeaeaaaaenees 109 6 1 Setting Up a New Replication Slave oooonoocciccnncocccononaconcnnconcnnnonncncnnnnnnnnnnnnnancancancnnns 109 6 2 Backing up and Restoring a Slave Database ooooncccnconnccnnncnnccnnnnnnccnnnnnnccnnonanccnnnnnness 110 6 3 Restoring a Master Database 0 cece eccceeeee cents ee cena ener tena eee sean E SAKER ERCK 110
160. es at the level of pages in the InnoDB data files as opposed to table rows each page that has changed is backed up Thus the space and time savings are not exactly proportional to the percentage of changed InnoDB rows or columns Examples of Incremental Backups This example uses the mysq1backup command to make an incremental backup of a MySQL server including all databases and tables We show two alternatives one using the incremental bas option and the other using the start 1sn option With the incremental base option you do not have to keep track of LSN values between one backup and the next Instead you specify the directory of the previous backup either full or incremental and mysqlbackup figures out the starting point for this backup based on the metadata of the earlier one Because you need a known set of directory names you might use hardcoded names or generate a sequence of names in your own backup script rather than using the with timestamp option mysqlbackup defaults file home pekka my cnf incremental incremental base dir incr backup wednesday incremental backup dir incr backup thursday 33 Making an Incremental Backup backup Many lines of output mysqlbackup Backup created in directory incr backup thursday mysaqlback pk istant Ssn 26540355 7 11 7 mysqlbackup incremental_base_lsn 2666733462 mysqlbackup end_lsn 2666736714 101208 17 14 58 mysqlbackup mysql
161. estore operation 2 Using the full and incremental backups that were created before tp restore the database to a time as close to tz as possible and note that time let us call it ts Make sure the restored database is in a consistent state This can be achieved by for example using the copy back and apply 10g command for backup restore 3 Roll forward the database to its state at the desired time t using the binary log 10 file s included in the incremental backup that covers tz Use the mysqlbinlog utility to extract from the binary log 10 file s all the SQL activities that happened in between the tz which you noted in step 3 and tz specifying those times with the start datetime and stop datetime options and pipe the output to the mysq1 client to be replayed on the server mysqlbinlog start datetime Weru N stop datetime tg binlog 000005 binlog 000006 binlog 000007 WCL U ESQ 9 53 Backing Up and Restoring a Single ibd File An alternative is to identify the beginning and endpoint of the extraction not by the start and stop times but by their corresponding binary log positions mysqlbinlog start position binary log position corresponding to t _ stop position binary log position corresponding to t p binlog 000005 binlog 000006 binlog 000007 Mys UE O OO Note that you need to pipe all the binary log files in a single connection to the server You can also dump
162. etails on the concept use cases and command samples for an optimistic backup Accepted formats for specifying the option include now This includes all tables into the optimistic phase of the backup process It is the default value for the option when no value is specified 97 Message Logging Options e Number Unit Indicates the optimistic time as a time at a certain duration into the past Unit can be any one of years months hours and minutes Some examples for option strings in this format include 5years 2days 13months 23hours and 35minutes A date time format in any of the following forms YYMMDD YYYYMMDD YYMMDDHHMMSS YYYYMMDDHHMMSSYY MM DD YYYY MM DD YY MM DD Or HH MM SSYYYYMMDDTHHMMSS as designated by the ISO 8601 standard When both the optimistic time and the optimistic busy tables options are used and they come into conflict on determining which tables are to be backed up in the optimistic phase optimistic busy tables takes precedence over optimistic time e optimistic busy tables REGEXP Command Line Format optimistic busy tables REGEXP Permitted Values Type string Perform an optimistic backup using the regular expression specified with the option to select tables that will be skipped in the first phase of an optimistic backup because they are likely to be modified during the backup process Tables whose fully qualified names in the form of database_name
163. eve are valid If pursuant to or in connection with a single transaction or arrangement you convey or propagate by procuring conveyance of a covered work and grant a patent license to some of the parties receiving the covered work authorizing them to use propagate modify or convey a specific copy of the covered work then the patent license you grant is automatically extended to all recipients of the covered work and works based on it A patent license is discriminatory if it does not include within the scope of its coverage prohibits the exercise of or is conditioned on the non exercise of one or more of the rights that are specifically granted under this License You may not convey a covered work if 157 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 you are a party to an arrangement with a third party that is in the business of distributing software under which you make payment to the third party based on the extent of your activity of conveying the work and under which the third party grants to any of the parties who would receive the covered work from you a discriminatory patent license a in connection with copies of the covered work conveyed by you or copies made from those copies or b primarily for and in connection with specific products or compilations that contain the covered work unless you entered into that arrangement or that patent
164. exclude In a partial backup to select a set of tables databases or a combination of both to be omitted from the backup Contrast with include See Also partial backup extract The operation that retrieves some content from an image file produced by a single file backup It can apply to a single file unpacked to an arbitrary location or to the entire backup reproducing the original directory structure of the backup data These two kinds of extraction are performed by the mysqlbackup options extract and image to backup dir respectively See Also image single file backup F frm file A file containing the metadata such as the table definition of a MySQL table For backups you must always keep the full set of frm files along with the backup data to be able to restore tables that are altered or dropped after the backup Although each InnoDB table has a frm file InnoDB maintains its own table metadata in the system tablespace the frm files are not needed for InnoDB to operate on InnoDB tables These files are backed up by the MySQL Enterprise Backup product These files must not be modified by an ALTER TABLE operation while the backup is taking place which is why backups that include non InnoDB tables perform aFLUSH TABLES WITH READ LOCK operation to freeze such activity while backing up the frm files Restoring a backup can result in frm files being created changed or removed to match the state of the database at the time
165. f Contents A 1 Limitations of MySQL Enterprise Backup ccceceeeeeeeeeeeeeeeeeeeeaeaeeeeeeeeeeeeeaaaaeeneeseeeeeeaeaaeaees 135 Please refer to the MySQL Enterprise Backup version history in Appendix D MySQL Enterprise Backup Release Notes for a list of fixed mysqlbackup bugs A 1 Limitations of MySQL Enterprise Backup The group commit feature in MySQL 5 6 and higher changes the frequency of flush operations for the InnoDB redo log which could affect the point in time associated with the backup data from InnoDB tables See Section B 4 Compatibility Notes for Specific MySQL Versions for details For MySQL 5 5 and earlier when restoring an individual InnoDB table as described in Section 4 4 Backing Up and Restoring a Single ibd File the table must not have been dropped or truncated in the MySQL server after the backup Dropping or truncating an InnoDB table changes its internal table ID and when the table is re created the ID will not match the table ID from the backup data This restriction does not apply to MySQL 5 6 and later as long as the restoration is made from one Generally Available GA version to another in the same series of MySQL servers In Linux Unix and OS X systems the mysq1backup command does not record file ownership or permissions of the files that are backed up Upon restore these files might have different ownership for example being owned by root rather than mysql They might also have d
166. f the backup data server my cnf Contains values of the backed up server s global variables that are set to non default values e server all cnf Contains values of all the global variables of the backed up server For details about all the files in the backup directory see Table 1 1 Files in a MySQL Enterprise Backup Output Directory Single File Backups Depending on your workflow you might perform a single file backup rather than the typical backup that produces a separate file for every file in the original instance The single file format is easier to transfer to a different system compress and uncompress and ensure that no backed up files are deleted later by 16 Overview of Restoring a Database mistake It is just as fast as a multi file backup to do a full restore restoring individual files can be slower than in a multi file backup For instructions see Section 3 3 5 Making a Single File Backup 1 5 Overview of Restoring a Database To initiate the restore process you run the mysqlbackup command with the copy back or the copy back and apply log subcommand You can restore all the data for a MySQL server multiple databases each containing multiple tables Or you can restore selected databases tables or both To repair a problem such as data corruption you restore the data back to its original location on the original server machine You might restore to a different server machine or a different
167. file and transferring it to another server See Section 5 1 1 5 Work with Single File Backups for the options related to single file backups and Section 3 3 5 Making a Single File Backup for usage instructions InnoDB Configuration Options Settings Prior to MySQL 5 5 it was common practice to keep the redo logs fairly small to avoid long startup times when the MySQL server was killed rather than shut down normally In MySQL 5 5 and higher the performance of crash recovery is significantly improved as explained in Optimizing InnoDB Configuration Variables With those releases you can make your redo log files bigger if that helps your backup strategy and your database workload As discussed later there are a number of reasons why you might prefer to run with the setting innodb_file_per_table 1 Parallel Backup The mysqibackup command can take advantage of modern multicore CPUs and operating system threads to perform backup operations in parallel See Section 5 1 11 Performance Scalability Capacity Options for the options to control how many threads are used for different aspects of the backup process If you see that there is unused system capacity during backups consider increasing the values for these options and testing whether doing so increases backup performance e When tuning and testing backup performance using a RAID storage configuration consider the combination of option settings read threads 3 process
168. files in the backup innodb_checksum_algorithm The name of the checksum algorithm used for validating InnoDB tablespaces innodb_data_file_path Specifies InnoDB system tablespace files path and size innodb_data_home_dir Specifies base directory for all InnoDB data files in the shared system tablespace innodb_log_file_size The size in bytes of each InnoDB log file in the log group innodb_log_files_in_group The number of InnoDB log files innodb_log_group_home_dir The directory path to InnoDB log files innodb_page_size The page size for all InnoDB tablespaces in a MySQL instance key The symmetric key used for encryption and decryption key file The pathname of a file that contains the symmetric key used for encryption and decryption limit memory The memory in MB available for the MEB operation log bin index Specifies the absolute path of the index file on the MySQL 3 11 0 server that lists all the used binary log files for MySQL 5 5 and for all offline backups login path Read options from the named login path in the mylogin cnf login file master info file Specifies the absolute path of the information file in which 3 11 0 a slave records information about its master for offline backups of salve servers only information file messages logdir Specifies the path name of an existing directory for storing the message log no connection no defaults Do not connect to server
169. for details There are some special requirements when restoring backups created with the use tts option see Restoring Backups Created with the use tts Option for details 66 Subcommands copy back a d apply Log In a single step restores a single file backup specified by the backup image option or a backup from the directory specified by the backup dir option to a server s data directory and performs an apply log operation to the restored data to bring them up to date Comparing with a multi step approach for restoring a single file backup which typically consists of performing the successive steps of extract uncompress apply log and copy back for restoring compressed image or extract apply log and copy back for uncompressed image the option makes the restoration process simpler and faster and also saves the disk space required The following are some special requirements for different kinds of backup restoration using copy back and apply log To restore a compressed directory or image include the uncompress option in the command line To restore a single file backup besides specifying the location of the backup image with the backup image option also supply with the backup dir option the location of a folder that will be used for storing temporary files produced during the restoration process To restore an incremental backup directory assuming the full backup on which the incremental
170. for every backup especially incremental backups so that you do not restore out of date versions of any databases 3 3 5 Making a Single File Backup To avoid a large number of backup files to track and keep safe and to simplify moving backup data around the mysqlbackup command can create a backup in a single file format pack an existing backup into a single file unpack the single file back to the original backup directory structure list the contents of a single file backup verify the contents of a single file backup against embedded checksums or extract a single file or directory tree For the syntax of the relevant mysqibackup options see Section 5 1 10 Single File Backup Options Because the single file backup can be streamed or piped to another process such as a tape backup or a command such as scp you can use this technique to put the backup on another storage device or server without significant storage overhead on the original database server During preparation of the single file backup some small work files are prepared temporarily inside the specified backup directory To create a single file backup use the mysqlbackup subcommand backup to image Example 3 3 Single File Backup to Absolute Path This command creates a single backup image in the given absolute path It still requires backup di r which is used to hold temporary output status and metadata files mysqlbackup backup image backups sales mbi backu
171. for this backup job gtid_executed sql Signifies the backup came from a server with GTIDs enabled GTIDs are a replication feature in MySQL 5 6 and higher See Replication with Global Transaction Identifiers for details When you back up a server with GTIDs enabled the file gtid_executed sql is created in the backup directory Edit and execute this file after restoring the backup data on a slave server server my cnt Contains values of the backed up server s global variables that are set to non default values Use this file or server all cnf to start the target server for restoration During a copy back or copy back and apply log operation the server repository options values e g datadir innodb_data_home_dir etc in the file are modified if the command makes changes to them through the command options However during an apply incremental backup operation the values already saved in the file take precedence and they are not modified by the 13 Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes server all cnf Contains values of all the global variables of the backed up server Use this file or server my cnf to start the target server for restoration option values supplied through the command Warning When using the file to restart the target server change parameters lik
172. g non InnoDB data This option allows mysqlbackup to make connection attempts in both phases but continues even if the connection cannot be established If a connection cannot be established the processing is the same as with the no connection option This option can be useful in emergency situations for example when the database server goes down during the backup operation 5 1 4 Server Repository Options These repository options specify various parameters related to the database server from which the data is backed up or to which a backup is restored These options are used only with the following operations Backup creation operations backup backup and apply log backup to image Restore operations copy back copy back and apply log When a database connection is available during a backup the parameters describing the source repository are ignored overridden by the corresponding values retrieved from the database connection For information about how these options are specified for the MySQL server click the option names to see the descriptions in the MySQL Reference Manual datadir PATH This is the datadi r value used by the MySQL instance The frm files live here inside subdirectories named after the databases inside the instance When a database connection exists the value is retrieved automatically and overrides any value you specify This is a crucial parameter for both the MySQL server and MySQL Enterprise Bac
173. g operation can be reduced significantly comparing with an ordinary backup because the apply log operation will be much faster However if it turns out that the inactive tables identified are modified a lot during the backup process benefits of performing an optimistic back up will become limited and in the worst case an optimistic backup might actually take longer to perform and for a single file backup the size of the backup will be larger when comparing with an ordinary backup Therefore users should be careful in identifying which tables are inactive and which are busy when trying to perform an optimistic backup Note Y An optimistic backup cannot be performed for an incremental backup or a backup using transportable tablespaces TTS The following examples illustrate how to make an optimistic backup Example 3 19 Optimistic Backup Using the Option opt imi st ic time YYMMDDHHMMSS In this example tables that have been modified since the noon of May 16 2011 are treated as busy tables and backed up in the normal phase of an optimistic backup and all other tables are backed up in the optimistic phase mysqlbackup defaults file etc my cnf optimistic time 110516120000 backup 45 Making a Back Up of In Memory Database Data Example 3 20 Optimistic Backup Using the Option optimistic time now In this example all tables are treated as inactive tables and backed up in the optimistic phase of an optimistic bac
174. ge Specifies the path name of the backup image backup_innodb_checksum_algori The name of the checksum algorithm used for validating thmoDB tablespaces backup_innodb_data_file_path backup_innodb_data_home_dir Specifies Innodb system tablespace files path and size in backup Backup base directory for all InnoDB data files in the system tablespace backup_innodb_log_file_size The size in bytes of each InnoDB backup log file backup_innodb_log_files_in_grow Number of InnoDB log files in backup p backup_innodb_log_group_home Backup directory for InnoDB log files dir backup_innodb_page_size The page size for all InnoDB tablespaces in a MySQL instance backup_innodb_undo_ directory The relative or absolute directory path where InnoDB creates separate tablespaces for the undo logs backup_innodb_undo_logs Number of rollback segments in the system tablespace that InnoDB uses within a transaction character sets dir The number of tablespace files that the undo logs are backup_innodb_undo_tablespace divided between when a non zero innodb_undo_logs setting is used Directory for character set files cloud access key id AWS access key ID for logging onto Amazon S3 59 mysqlbackup Command Line Options Format Description Introduced cloud aws region cloud bucket Region for Amazon Web Services that mysq
175. hat is MySQL Enterprise Backup 3 5 to 3 10 Note Y e For any restore that involves a server upgrade or downgrade see the important discussion in Section 4 5 Restoring a Backup with a Database Upgrade or Downgrade B 4 Compatibility Notes for Specific MySQL Versions This section lists any performance related features and settings in specific MySQL Server versions that affect various aspects of the backup process MySQL 5 6 Some new MySQL 5 6 features introduce changes in directory layout and file contents for InnoDB tables Backing up servers that use these features requires MySQL Enterprise Backup 3 8 1 or higher innodb_page_size configuration option 139 MySQL 5 6 innodb_undo_directory innodb_undo_logs and innodb_undo_tablespaces configuration options innodb_checksum_algorithm configuration option DATA DIRECTORY clause of the CREATE TABLE statement which produces a isl file in the database directory and stores the ibd file in a user specified location Online DDL See MySQL Enterprise Backup 3 9 Release Notes for details on the fixes and enhancements related to these MySQL 5 6 features 140 Appendix C Extended Examples Table of Contents C 1 Sample Directory Structure for Full Backup C 2 Sample Directory Structure for Compressed Backup C 3 Sample Directory Structure for Incremental Backup This section illustrates the commands and associated output for various backup
176. he initial backup such as the apply log phase or the restore phase This file is not modified at any stage once generated 12 Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes by the backup to image or backup dir to image options For details about this file see Section 10 5 Using the MySQL Enterprise Backup Manifest backup_create xml Lists the command line arguments and environment in which the backup was created For details about this file see Section 10 5 Using the MySQL Enterprise Backup Manifest This file is not modified once it is created You can prevent this file from being generated by specifying the disable manifest option backup_content xml Essential metadata for the files and database definitions of the backup data It also contains details of all the plugins defined on the backed up server by which users should make sure the same plugins are defined in the same manner on the target server for restoration For details about this file see Section 10 5 Using the MySQL Enterprise Backup Manifest This file is not modified once created You can prevent this file from being generated by specifying the disable manifest option comments txt Produced by the comments or comment s file option The comments are specified by you to document the purpose or special considerations
177. he description of the backup dir option on how the backup directory is used for different purposes and for different operations backup repository Contrast with server repository See Also repository server repository backup my cnf A small configuration file generated by MySQL Enterprise Backup containing a minimal set of configuration parameters This file records the settings that apply to this backup data Subsequent operations such as the 169 apply process read options from this file to determine how the backup data is structured This file always has the extension cnf rather than cnf on Unix like systems and ini on Windows systems See Also apply configuration file Barracuda The code name for an InnoDB file format that supports compression for table data This file format was first introduced in the InnoDB Plugin It supports the compressed row format that enables InnoDB table compression and the dynamic row format that improves the storage layout for BLOB and large text columns You can select it through the innodb_file_ format option Because the InnoDB system tablespace is stored in the original Antelope file format to use the Barracuda file format you must also enable the file per table setting which puts newly created tables in their own tablespaces separate from the system tablespace The MySQL Enterprise Backup product version 3 5 and above supports backing up tablespaces that use the Barracuda file format
178. he execution how much data will be copied or processed Therefore the total data meter shows the estimated amount of the total data for a backup The estimate is updated during the execution of the command For example Progress 200 of 1450 MB is followed by Progress 200 of 1550 MB when 100MB of data is added on the server If the operation is successful the final progress indicator shows the actual amount of data copied at the end of the operation e Compression meter It indicates the sliding average of the compression ratio which is defined for each block of data that is compressed as orig_size compressed_size orig_size For example 101 Encryption Options compression 40 This means that after compression the data takes 40 less space calculated as an average over the last 10 data blocks The compression meter is included in the progress indicator if the compress option is enabled for the mysqlbackup operation The value of the compression meter is undefined until at least 10 data blocks have been compressed The undefined meter value is denoted by the in the meter compression e State meter It is a short description of the major step the command is currently executing For example state Copying InnoDB data state Waiting for locks state Copying system tablespace state Copying ibd files state Copying non InnoDB data state Completed Here are some examples of progress in
179. he overhead of inserting rows and updating indexes that comes from replaying the SQL statements from mysqldump output To minimize any impact on server performance on Linux and Unix systems MySQL Enterprise Backup writes the backup data without storing it in the operating system s disk cache by using the posix_fadvise system call This technique minimizes any slowdown following the backup operation by preventing frequently accessed data from being flushed from the disk cache by the large one time read operation for the backup data For more on techniques and tradeoffs involving backup and restore performance see Chapter 7 Performance Considerations for MySQL Enterprise Backup 1 4 Files that Are Backed Up DBA and development work typically involves logical structures such as tables rows columns the data dictionary and so on For backups you must understand the physical details of how these structures are represented by files Table 1 1 Files in a MySQL Enterprise Backup Output Directory File Name Pattern or Extension Relation to Original Data Files Notes ibdata The InnoDB system tablespace Because the original files might containing multiple InnoDB tables change while the backup is in and associated indexes progress the apply log step Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes applies the same changes to the corresponding bac
180. hen no connection to mysqid is allowed or when there is no need to copy MyISAM files for example when you are sure there are no DDL changes during the backup See Making a Partial Backup with the Legacy Options for instructions and examples The option is not compatible with the slave info option Default backups include files from all storage engines use tts with minimum locking with full locking Enable selective backup of InnoDB tables using transportable tablespaces TTS This is to be used in conjunction with the include option which selects the InnoDB tables to be backed up by a regular expression Using TTS for backups offers the following advantages e Backups can be restored to a different server e The system tablespace is not backed up saving disk space and I O resources Data consistency of the tables is managed by MySQL Enterprise Backup However the option has the following limitations e Supports only MySQL version 5 6 and after as earlier versions of MySQL do not support TTS e Can only backup tables that are stored in their own individual tablespaces i e tables created with the innodb_file_per_table option enabled Cannot back up partitioned tables e Cannot restore tables selectively from the backup Cannot be used for incremental backups There are two possible values for the option 89 Single File Backup Options e with minimum locking Hot copies of the selected tables are ba
181. hen the database is shut down normally this type of activity is performed during shutdown by the purge operation data dictionary A set of tables controlled by the InnoDB storage engine that keeps track of InnoDB related objects such as tables indexes and table columns These tables are part of the InnoDB system tablespace Because the MySQL Enterprise Backup product always backs up the system tablespace all backups include the contents of the data dictionary See Also hot backup MySQL Enterprise Backup system tablespace database A set of tables and related objects owned by a MySQL user Equivalent to schema in Oracle Database terminology MySQL Enterprise Backup can perform a partial backup that includes some databases and not others The full set of databases controlled by a MySQL server is known as an instance See Also instance partial backup downtime A period when the database is unresponsive The database might be entirely shut down or in a read only state when applications are attempting to insert update or delete data The goal for your backup strategy is to 171 minimize downtime using techniques such as hot backup for InnoDB tables cold backup using slave servers in a replication configuration and minimizing the duration of the suspend stage where you run customized backup logic while the MySQL server is locked See Also cold backup hot backup InnoDB locking replication slave suspend E
182. hile the backup is running which is stored in a new backup file ibbackup_logfile If you use the compressed backup feature the ibd files are renamed in their compressed form to ibz files The files as they are originally copied form a raw backup that requires further processing before it is ready to be restored You then run the apply step which updates the backup files based on the changes recorded in the ibbackup_logfile file producing a prepared backup At this point the backup data corresponds to a single point in time The files are now ready to be restored to their original location or for some other use such as testing reporting or deployment as a replication slave To restore InnoDB tables to their original state you must also have the corresponding frm files along with the backup data Otherwise the table definitions could be missing or outdated if someone has run ALTER TABLE Or DROP TABLE statements since the backup By default the mysqlbackup command 15 Data from MyISAM and Other Storage Engines automatically copies the frm files during a backup operation and restores the files during a restore operation Data from MyISAM and Other Storage Engines The mysq1backup command can also back up the MYD files MYI files and associated frm files for MyISAM tables The same applies to files with other extensions as shown in this list tables the MySQL server to be backed up must support InnoDB
183. ies with absolute pathnames those entries are extracted to the same absolute path names even if backup dir option is specified The dst ent ry option must be used to relocate an absolute pathname copy back and apply log See description for copy back and apply 10g in Section 5 1 1 3 Restore an Existing Backup 5 1 2 Standard Options The standard options are options of a general nature or options that are not classified under any other specific option group Here is a list of the standard options The following standard options also exist for the mysql command Full descriptions for these options can be found in the MySQL reference manual accessible through e g Server Option and Variable Reference These options must be specified ahead of any other mysq1backup options including the rest of the standard options print defaults Print the program argument list and exit no defaults Don t read default options from any option file defaults file PATH Only read default options from the given file It has to be the first optio defaults extra file PATH Read this file after the global files are read defaults group suffix str Also read option groups with the usual names and a suffix of str 71 Connection Options The following options are also common between mysqlbackup and mysql and full descriptions for them can be found in the MySQL reference manual accessible through e g Server Option and V
184. ifferent read write permissions for example being readable by anyone rather than just the file owner When planning your backup strategy survey the files in the MySQL data directory to ensure they have consistent owner and permission settings When executing a restore operation use an appropriate combination of su umask chown and chmod on the restored files to set up the same owners and privileges as on the original files In some cases backups of non transactional tables such as My 1 SAM tables could contain additional uncommitted data If autocommit is turned off and both InnoDB tables and non transactional tables are modified within the same transaction data can be written to the non transactional table before the binary log position is updated The binary log position is updated when the transaction is committed but the non transactional data is written immediately If the backup occurs while such a transaction is open the backup data contains the updates made to the non transactional table If the mysqlbackup process is interrupted such as by a Unix kill 9 command a FLUSH TABLES WITH READ LOCK operation might remain running In this case use the KILL QUERY statement from the mysql command line to kill the FLUSH TABLES WITH READ LOCK statement This issue is more likely to occur if the FLUSH TABLES operation is stalled by a long running query or transaction Refer to Chapter 5 mysqlbackup Command Reference for guidelines about backup
185. ified in the POSIX 1003 2 standard On Unix like systems quote the regular expression appropriately to prevent interpretation of shell meta characters This feature has been implemented with Henry Spencer s regular expression library The backup directory produced contains a backup log file and copies of InnoDB data files IMPORTANT Although the mysq1backup command supports taking partial backups be careful when restoring a database from a partial backup mysqlbackup copies also the frm files of those tables that are not included in the backup except when you do partial backups using for example the databases option If you use mysqlbackup with the include option before restoring the database delete from the backup data the frm files for any tables that are not included in the backup IMPORTANT Because the InnoDB system tablespace holds metadata about InnoDB tables from all databases in an instance restoring a partial backup on a server that includes other databases could cause the system to lose track of those InnoDB tables in other databases Always restore partial backups ona fresh MySQL server instance without any other InnoDB tables that you want to preserve The only innodb and only innodb with frm options back up InnoDB tables only skipping those of other storage engines You might also use them together with the include option to make selective backup of InnoDB tables while excluding all other files created by other
186. in parameter names can be replaced with dashes and treated as synonyms similar to mysqld parameters that use this same convention See Using Options on the Command Line in the MySQL Reference Manual for details The documentation typically lists the names with underscores to match the output of the SHOW VARIABLES statement Options Files The mysqlbackup command reads the location of the MySQL data to back up from in order of priority The connection information from the running database whenever possible Thus in most cases you can avoid specifying most options on the command line or in a configuration file e Parameters you specify on the mysqlbackup command line You can specify certain options for individual backup jobs this way e The MySQL configuration file by default my cnf on Unix and my ini on Windows The parameters are searched for first under the mysqlbackup group then under the client group You can put common parameters that apply to most of your backup jobs into the configuration file Because mysqlbackup does not overwrite any files during the initial backup step the backup directory must not contain any old backup files mysq1backup stops when asked to create a file that already exists to avoid harming an existing backup For convenience specify the with timestamp option which always creates a unique timestamped subdirectory for each backup job underneath the main backup directory Configuratio
187. incremental incremental with redo log only incremental backup dir incremental base and start 1sn See Also full backup InnoDB The type of MySQL table that works best with MySQL Enterprise Backup These tables can be backed up using the hot backup technique that avoids interruptions in database processing For this reason and because of the higher reliability and concurrency possible with InnoDB tables most deployments should use InnoDB for the bulk of their data and their most important data In MySQL 5 5 and higher the CREATE TABLE statement creates InnoDB tables by default See Also hot backup table instance The full contents of a MySQL server possibly including multiple databases A backup operation can back up an entire instance or a partial backup can include selected databases and tables See Also database partial backup L locking See Also suspend warm backup log Several types of log files are used within the MySQL Enterprise Backup product The most common is the InnoDB redo log that is consulted during incremental backups See Also incremental backup redo log log sequence number See LSN logical backup A backup that reproduces table structure and data without copying the actual data files For example the mysqldump command produces a logical backup because its output contains statements such as CREATE TABLE and INSERT that can re create the data Contrast with physical backup See Also backup physica
188. ine backups of salve servers only specify the absolute path including filename and extension of the information file in which a slave records information about its master if it is different from the default path given below in order to include the information file in the backup Default data_dir master info relaylog info file PATH Command Line Format relaylog info file FILENAME Permitted Values Type file name Default data_dir relay log info For offline backups of salve servers only specify the absolute path including filename and extension of the information file in which a slave records information about the relay logs if it is different from the default path given below in order to include the information file in the backup Default data_dir relay log info optimistic time DATE TIME Command Line Format optimistic time DATE TIME Permitted Values Type string Default now Perform an optimistic backup with the value specified with the option as the optimistic time a time after which the tables that have not been modified are taken as inactive tables The inactive tables are believed to be unlikely to change during the backup process The inactive tables are backed up in the optimistic phase of the backup and all other tables are backed up in the normal phase See Section 3 3 6 Making an Optimistic Backup for d
189. ing it to another server involves additional CPU overhead on the database server where the backup takes place but less network traffic and less disk I O on the server that is the final destination for the backup data Consider the load on your database server the bandwidth of your network and the relative capacities of the database and destination servers when deciding whether or not to use compression See Section 3 3 3 Making a Compressed Backup and Section 5 1 7 Compression Options for information about creating compressed backups Compression involves a tradeoff between backup performance and restore performance In an emergency the time needed to uncompress the backup data before restoring it might be unacceptable There might also be storage issues if there is not enough free space on the database server to hold both the compressed backup and the uncompressed data Thus the more critical the data is the more likely that you might choose not to use compression accepting a slower larger backup to ensure that the restore process is as fast and reliable as possible 113 Single File Backups Single File Backups The single file backup by itself is not necessarily faster than the traditional type of backup that produces a directory tree of output files Its performance advantage comes from combining different steps that you might otherwise have to perform in sequence such as combining the backup data into a single output
190. ing mysqlbinlog mysqlbinlog start position 5585833 mysqldatadir omnibook bin 002 mysqldatadir omnibook bin 003 mysqldatadir omnibook bin 004 mysql The number of remaining binary log files varies depending on the length of the timespan between the last backup and the time to which you want to bring the database up to date The longer the timespan the more remaining binary log files there may be All the binary log files containing all the continuous binary log positions in that timespan are required for a successful restore The master database is now recovered Shut down the master and edit my cnf to uncomment log Dim Start the master again Start replication in the slaves again mysql gt START SLAVE 111 112 Chapter 7 Performance Considerations for MySQL Enterprise Backup Table of Contents 7 1 Optimizing Backup Performance c ceceeeee cece eeee eect ee ee ee ee aa ee eee sees ee ee aa aaeeeeeeeeeeeaaaaeeeeeeseeeeaaa 113 7 2 Optimizing Restore Performance cccceccceeeeeeeee cece ee ae eae tect sees ee ae aa eae cesses nn nn nn nan rr nr rn rca 116 This chapter describes the performance considerations for backing up and restoring databases using MySQL Enterprise Backup 7 1 Optimizing Backup Performance This section describes the performance considerations for backing up a database with MySQL Enterprise Backup When optimizing and tuning the backup procedure measure b
191. ion for redo data dictate how often you must perform incremental backups 3 1 2 Grant MySQL Privileges to Backup Administrator For most backup operations the mysqlbackup command connects to the MySQL server through user and password options This user requires certain privileges You can either create a new user with a minimal set of privileges or use an administrative account such as the root user The minimum privileges for the MySQL user that mysqlbackup connects are RELOAD on all databases and tables CREATE INSERT DROP and UPDATE on the tables mysql backup_progress and mysql backup_history and also SELECT on mysql backup_history SUPER to enable and disable logging and to optimize locking in order to minimize disruption to database processing REPLICATION CLIENT to retrieve the binlog position which is stored with the backup To set these privileges for a MySQL user mysqlbackup in this example connecting from localhost issue statements like the following from the mysq1 client program GRANT RELOAD ON TO mysqlbackup localhost GRANT CREATE INSERT DROP UPDATE ON mysql backup progress TO mysqlbackup localhost GRANT CREATE INSERT SELECT DROP UPDATE ON mysql backup history TO mysqlbackup localhost GRANT REPLICATION CLIENT ON TO mysqlbackup localhost GRANT SUPER ON TO mysqlbackup localhost The following additional privileges are required for using tra
192. ion problems 124 crash recovery 49 171 cron jobs 46 CSM file 7 CSV file 7 D data dictionary 171 database 171 181 databases option 88 databases list file option 88 datadir directory 7 datadir option 74 data_home_dir option 74 decrypt option 103 decryption 119 disable manifest option 92 disk storage for backup data 6 43 downtime 171 dst entry option 91 E encrypt option 103 encrypted backups 119 encryption 119 error codes 123 exclude 172 exclude tables option 85 exec when locked option 105 extract 172 extract option 71 90 F FAQ 129 file format 172 files backed up 7 frequently asked questions 129 frm file 7 172 full backup 31 141 172 G GRANT statement 27 H history table 172 hot backup 5 173 l ibbackup_logfile file 7 ibd file 7 54 173 ibdata file 7 173 ibreset command 124 ibz file 7 173 ib_logfile file 7 image 173 image to backup dir option 70 90 90 image_files xml file 7 126 include 173 include option 36 87 include tables option 84 incremental backup 6 80 145 174 incremental option 81 incremental backup dir option 83 incremental base option 82 incremental with redo log only option 81 InnoDB 174 InnoDB tables 5 7 57 57 compressed backup feature 35 incremental backup feature 32 installing MySQL Enterprise Backup 19 instance 174 K key option 10
193. ion while binary logging is enabled 109 Backing up and Restoring a Slave Database 7 Use the CHANGE MASTER SQL command on the slave to initialize it properly For example CHANGE MASTER TO MASTER_LOG_FILE hundin bin 006 MASTER_LOG_POS 128760128 Set the statuses of any events that were copied from the master to SLAVESIDE_DISABLED For example mysql gt UPDATE mysql event SET status SLAVESIDE_DISABLED Remove the line skip slave start and event_scheduler off entries you added to the my cnf file of the slave in step 2 Restart the slave server Replication stars 6 2 Backing up and Restoring a Slave Database To backup a slave database add the slave info option to your backup command To restore the backup on a slave server follow the same steps outlined in Section 6 1 Setting Up a New Replication Slave Warning O In a statement based replication SBR setting see Replication Formats for details whenever the SQL thread for the slave is stopped for example during a slave shutdown that has to occur when you restore a backup to a slave server all temporary tables that are open then will not get replicated on the slave see Replication and Temporary Tables for details That means it is not always safe to backup a slave server in an SBR setting with mysqlbackup if temporary tables might be created on the master as the temporary tables might be missing from the backup making it in
194. ir mem dc_p_ string 47 datadir mem dc_p_string O Imi Yel el Gel tel el Wel Gel tel tel cy fOr DEAD DIED DDD O O w l ligh Toi tol hol ol ol al gl In S o el Ye rol Go Yoel el el Yel yo Imp tel Tol ol o o tng ol al ol 0 30 UO SW ND SAUS K p0 ibd plead p2 ibd j9S 5 wWerel p4 ibd pood p6 ibd PI oel p8 ibd ibd ibd bd bd bd bd bd bd bd p0 ibd Ei gel p2 ibd pee wbd p4 ibd Por dl p6 ibd 97 aisel p8 ibd 141 Sample Directory Structure for Full Backup Sw SS SS SSS SS SAS SAS SS SAS ASS SS SS SS SSS SSS SS ISS ASAS ISS SS SS SSS SS SAS SS SS eS 0 33 47 datadir mem dc_p_string frm 0 33 47 datadir mem dc_p_string par 0 33 47 datadir mem graph_dc_schedules frm 0 33 47 datadir mem graph_dc_schedules ibd 0 33 47 datadir mem graph_schedules frm 0 33 47 datadir mem graph_schedules ibd 0 33 47 datadir mem graph_series_v2 frm 0 33 47 datadir mem graph_series_v2 ibd 0 33 47 datadir mem graph_tags frm 0 33 47 datadir mem graph_tags ibd 0 33 47 datadir mem graph_variables_v2 frm 0 33 47 datadir mem graph_variables_v2 ibd 0 33 47 datadir mem graphs frm 0 33 47 datadir mem graphs ibd 0 33 47 datadir mem group_members_v2 frm 0 33 47 datadir mem group_members_v2 ibd 0 33 47 datadir mem group_names frm 0 33 47 datadir mem group_names ibd 0 33 47 datadir mem hilo_sequence_iia frm 0 33 47 datadir mem hilo_sequence_iia ibd 0 33 47 datadir mem hilo_sequ
195. irst adds one row of the progress report to the mysql backup_progress table and then updates the row afterwards with the latest progress indicator The progress indicator is stored in the current_status column of the table If the backup locks the MySQL instance for example by issuing a FLUSH TABLES WITH READ LOCK statement the progress reports are not delivered to the mysql backup_progress table until the MySQL instance is unlocked variable Progress indicators are sent to the system variable backup_progress Server Users need to create their own plugin to define the variable See The Warning The system variable backup_progress is not yet defined for the MySQL MySQL Plugin API for more information on user plugins When there is no argument specified for show progress progress indicators are sent to stderr Progress can be reported to multiple destinations by specifying the show progress option several times on the command line For example the following command line reports progress of the backup command to stderr and to a file called meb_output 100 Progress Report Options mysqlbackup show progress show progress file meb_output backup dir full backup backup The progress indicators are short strings that indicate how far the execution of amysqlbackup operation has progressed A progress indicator consists of one or more meters that measure the progress of the operation For example Pr
196. it Problems with other file types within a backup directory for example frm file corruptions are not detected e If any ibdor frmfiles are missing from a backup directory during a backup or have been deleted from a backup directory after the backup was made the validate operation will not be able to detect the problem 68 Subcommands e If a backup directory has been corrupted by removing or truncating pages from any of the ibd files inside the validate operation will not be able to detect the problem Here is a sample command for validating a backup directory mysqlbackup uroot backup dir logs backupext validate Here is asample command for validating a backup image mysqlbackup uroot backup image logs fullimage mi validate The following is a sample command for validating an encrypted backup image and the output for the successful validation mysqlbackup backup image meb backups image mbi decrypt key file meb enckeyfile validate 140219 11 22 44 mysqlbackup INFO Validating image logs img bi 140219 11 22 44 mysqlbackup INFO Validate Dir meta 140219 11 22 45 mysqlbackup INFO Total files as specified in image 44 mysqlbackup INFO datadir tpch tabnorm7 ibd Validated mysqlbackup INFO datadir tpch tabnorm8 ibd Validated mysqlbackup INFO datadir tpch tabnorm9 ibd Validated 140219 11 22 45 mysqlbackup INFO Validate operation completed successfully 140219 11 22 45
197. k which restores the prepared backup together with a single copy back and apply 1o0g command 5 1 1 3 Restore an Existing Backup Restores the data files from a backup to their original locations within the database server The MySQL instance must be shut down first before a restore operation The options datadir innodb_log_files_in_group and innodb_log_file_size must be specified either in the target server s configuration file in the file specified by the defaults file option or as command line options For usage and examples see Chapter 4 Recovering or Restoring a Database mysqlbackup STD OPTIONS SERVER REPOS I TORY OPTIONS backup dir PATH MESSAGE LOGGING OPTIONS PARTIAL BACKUP RESTORE OPTIONS PROGRESS REPORT OPTIONS CLOUD STORAGE OPTIONS copy back mysqlbackup STD OPTIONS SERVER REPOSITORY OPTIONS backup image IMAGE backup dir PATH MESSAGE LOGGING OPTIONS PARTIAL BACKUP RESTORE OPTIONS PROGRESS REPORT OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS copy back and apply Og Copy back Restores files from a backup to their original locations within the MySQL server Some clean up efforts on the target directory for restoration might be needed before preforming a full restore for example when the backup data is used to set up a new MySQL server or used to replace all data of an existing MySQL server See Section 4 2 Performing a Restore Operation 51
198. k up the InnoDB installation Run mysqlbackup apply log to create a consistent version of the backup database Start a second dummy mysqld server on the backup and let it clean up the ibd files in the backup Wait for the cleanup to end Shut down the dummy mysqid server Take aclean ibd file from the backup 4 5 Restoring a Backup with a Database Upgrade or Downgrade A Important Due to the changes to the InnoDB storage engine going from MySQL 5 5 to 5 6 restoring a backup of a MySQL 5 5 database to a MySQL 5 6 server requires some extra steps beyond the general restore and upgrade procedures the skipping of which will crash the target server For such a restoration follow the steps 56 described below You can back up a server running one MySQL version and restore on a server running a different MySQL version After the restore perform the appropriate upgrade steps as if you are running the new MySQL version for the first time Or if you installed on a server running an older MySQL perform the appropriate downgrade steps For information about upgrading and downgrading see Upgrading MySQL and Downgrading MySQL E Note After upgrading between certain combinations of MySQL versions you might see error messages about missing or mismatching definitions for system tables Use the mysql_upgrade command as directed in the upgrade instructions to correct such issues See mysql_upgrade Check and Upgrad
199. kup innodb_data_home_dir PATH Specifies the directory where InnoDB data files live Usually the same as datadi r but can be different This parameter together with innodb_data_file path SIZE determines where the InnoDB data files such as ibdatal ibdata2 and so on are situated within the MySQL server Typically you do not need to specify this option because its value is retrieved automatically using the database connection lts value is derived as follows e If innodb_data_home_dir is not specified it inherits the value of datadi r e If innodb_data_home_dir is a relative path that path is located relative to that is underneath the datadir value e An innodb_data_home_dir of refers to the root directory e If innodb_data_home_dir is an absolute path its value is used as is innodb_data_file_path VALUE Specifies InnoDB data file names and sizes Examples 74 Server Repository Options ibdatal 32M ibdata2 32M autoextend abs path ibdatal 32M autoextend innodb dir ibdatal 32M autoextend When a database connection exists the value is retrieved automatically and overrides any value you specify This parameter together with innodb_data_home_dir determines where the InnoDB data files such as ibdatal ibdata2 and so on live in server repository Typically you do not need to specify this option because its value is retrieved automatically using the database connection If no database connection is availa
200. kup mysqlbackup defaults file etc my cnf optimistic time now backup Example 3 21 Optimistic Backup Using the optimistic busy tables Option In this example tables in mydat abase that are suffixed by mytables in their names are treated as busy tables and backed up in the normal phase of an optimistic backup and all other tables are backed up in the optimistic phase mysqlbackup defaults file etc my cnf optimistic busy tables mydatabasel mytables backup When you use both the optimistic time and optimistic busy tables options and they come into conflict on determining which tables are to be busy tables optimistic busy tables takes precedence over optimistic time For example Example 3 22 Optimistic and Partial Backup Using both the optimistic busy tables and optimistic time Options In this example tables in mydatabase that are suffixed by mytables in their names are treated as busy tables and backed up in the normal phase even if they have not been modified since May 16 2010 the time specified by optimistic time mysqlbackup defaults file etc my cnf optimistic busy tables mydatabase mytables optimistic time 100516 backup 3 3 7 Making a Back Up of In Memory Database Data The xec when locked option of the mysqlbackup command lets you specify a command and arguments to run near the end of the backup while the database is still locked This command can copy or create additional files in the ba
201. kup Data These operations bring the backup files up to date with any changes to InnoDB tables that happened while the backup was in progress Although for convenience you can combine this operation with the initial backup using the backup and apply 10g option you must run the steps separately when performing incremental or compressed backups mysqlbackup STD OPTIONS limit memory MB uncompress backup dir PATH MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS apply log mysqlbackup STD OPTIONS incremental backup dir PATH backup dir PATH limit memory MB uncompress MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS apply incremental backup apply log 65 Subcommands Brings the InnoDB tables in the backup up to date including any changes made to the data while the backup was running apply incremental backup Brings the backup up to date using the data from an incremental backup Example 5 3 Apply Log to Full Backup mysqlbackup backup dir path to backup apply log It reads the backup my cnf file inside backup dir to understand the backup The my cnf default files have no effect other than supplying the 1imit memory MB value which limits usage of memory while doing the apply log operation Because the apply log operation does not apply to incremental backups no incremental backup dir is needed for this operation You can also perform apply log and copy bac
202. kup dir export backups 2011 06 21__8 36 58 apply log That command creates InnoDB log files ib_103fi1e within the backup directory and applies log records to the InnoDB data files ibdata and iba Example 4 2 Applying the Log to a Compressed Backup If the backup is compressed as in Section 3 3 3 Making a Compressed Backup specify the uncompress option to mysqlbackup when applying the log to the backup mysqlbackup backup dir export backups compressed uncompress apply log Example 4 3 Applying an Incremental Backup to a Full Backup After you take an incremental backup as in Section 3 3 2 Making an Incremental Backup the changes reflected in those backup files must be applied to a full backup to bring the full backup up to date in the same way that you apply changes from the binary log To bring the data files from the full backup up to date first run the apply log step so that the data files include any changes that occurred while the full backup was running Then apply the changes from the incremental backup to the data files produced by the full backup mysqlbackup backup dir export backups full apply log mysqlbackup backup dir export backups full A incremental backup dir export backups incremental apply incremental backup Now the data files in the ful1 backup directory are fully up to date as of the time of the incremental backup 4 2 Performing a Restore Operation The mysqibackup
203. kup files bd InnoDB file per table tablespaces each containing a single InnoDB table and associated indexes Used for tables created under the innodb_file_per_table Because the original files might change while the backup is in progress the apply log step applies the same changes to the corresponding backup files UDZ Compressed form of InnoDB data files from the MySQL data directory Produced instead of ibd files in a compressed backup The ibdata files representing the InnoDB system tablespace also receive this extension in a compressed backup The ibz files are uncompressed for the apply log step 3 TEM Hold metadata about all MySQL tables The database is put into a read only state while these files are copied These files are copied without changes MYD MyISAM table data The database is put into a read only state while these files are copied These files are copied without changes MYT MyISAM index data The database is put into a read only state while these files are copied These files are copied without changes CSM Metadata for CSV tables These files are copied without changes The backup_history and backup_progress tables created by mysqlbackup use the CSV format so the backup always includes some files with this extension CSV Data for CSV tables These files are copied without changes The backup_history and backup_pr
204. l backup makes restore faster or postponing it until right before the restore makes backup faster In an emergency restore performance is the most important consideration Thus the more crucial the data is the more important it is to run the apply log phase immediately after the backup Either combine the backup and apply log phases on the same server by specifying the backup and apply log option or perform the fast initial backup transfer the backup data to another server and then perform the apply log phase using one of the options from Section 5 1 1 2 Apply Log Operations for Existing Backup Data Section 5 1 1 2 Apply Log Operations for Existing Backup Data Network Performance For data processing operations you might know the conventional advice that Unix sockets are faster than TCP IP for communicating with the database Although the mysqlbackup command supports the options protocol tcp protocol socket and protocol pipe these options do not have a significant effect on backup or restore performance These processes involve file copy operations rather than client server network traffic The database communication controlled by the protocol option is low volume For example mysqlbackup retrieves information about database parameters through the database connection but not table or index data Parallel Restore The mysq1backup command can take advantage of modern multicore CPUs and operating system
205. l Notices This product may contain third party code For license information on third party code see Appendix E Licenses for Third Party Components Legal Notices Copyright 2003 2015 Oracle and or its affiliates All rights reserved This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws Except as expressly permitted in your license agreement or allowed by law you may not use copy reproduce translate broadcast modify license transmit distribute exhibit perform publish or display any part in any form or by any means Reverse engineering disassembly or decompilation of this software unless required by law for interoperability is prohibited The information contained herein is subject to change without notice and is not warranted to be error free If you find any errors please report them to us in writing If this is software or related documentation that is delivered to the U S Government or anyone licensing it on behalf of the U S Government then the following notice is applicable U S GOVERNMENT END USERS Oracle programs including any operating system integrated software any programs installed on the hardware and or documentation delivered to U S Government end users are commercial computer software pursuant to the applicable Federal Acquisition Regulation and agency specific supplement
206. l backup LSN Acronym for log sequence number This arbitrary ever increasing value represents a point in time corresponding to operations recorded in the redo log This point in time is regardless of transaction boundaries it can fall in the middle of one or more transactions lt is used internally by InnoDB during crash recovery and for managing the buffer pool In the MySQL Enterprise Backup product you can specify an LSN to represent the point in time from which to take an incremental backup The relevant LSN is displayed by the output of the mysq1backup command Once you have the LSN corresponding to the time of a full backup you can specify that value to take a subsequent incremental backup whose output contains another LSN for the next incremental backup See Also crash recovery hot backup incremental backup redo log 174 M MRG file A file containing references to other tables used by the MERGE storage engine Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product MYD file A file that MySQL uses to store data for a MyISAM table See Also MYI file MYI file A file that MySQL uses to store indexes for a MyISAM table See Also MYD file manifest The record of the environment for example command line arguments and data files involved in a backup stored in the files meta backup_create xml and meta backup_conte
207. l backup it is based on was created with the no 1ocking option As a workaround users should use the skip binlog option for an incremental backup performed in that situation 136 Limitations of MySQL Enterprise Backup The attempt to copy the binary log files from a server into a backup which is the default behavior of MySQL Enterprise Backup since 3 11 0 will cause an offline backup to fail As a workaround always use the skip binlog option for offline backups While it is possible to backup to or restore from a Network Attached Storage NAS device using MySQL Enterprise Backup due to networking issues that might arise the consistency of the backups and the performance of the backup or restore operations might be compromised When creating a backup using transportable tablespace TTS for a server containing tables with a mix of the Antelope and Barracuda file formats do not apply full locking on the tables that is do not specify use tts with full locking Instead just specify use tts or use tts with minimum locking both of which will apply minimum locking to the tables Bug 20583946 Tables created on the MySQL server with the ANSI_QUOTES SQL mode cannot be backed up using transportable tablespace TTS 137 138 Appendix B Compatibility Information for MySQL Enterprise Backup Table of Contents B 1 Cross Platform Compatibility sucios a E a EE AE a a AOE AES 139
208. l property which is normally used for personal family or household purposes or 2 anything designed or sold for incorporation into a dwelling In determining whether a product is a consumer product doubtful cases shall be resolved in favor of coverage For a particular product received by a particular user normally used refers to a typical or common use of that class of product regardless of the status of the particular user or of the way in which the particular user actually uses or expects or is expected to use the product A product is a consumer product regardless of whether the product has substantial commercial industrial or non consumer uses unless such uses represent the only significant mode of use of the product Installation Information for a User Product means any methods procedures authorization keys or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made If you convey an object code work under this section in or with or specifically for use in a User Product and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixe
209. l using the same start 1sn value Make sure to specify the precise end LSN of the previous backup as the start LSN of the next incremental backup do not use arbitrary values backups using this option Oracle recommends always using the incremental base option when you use the incremental with redo 1og on1y option Note Y To ensure the LSN values match up exactly between successive incremental To judge whether this type of incremental backup is practical and efficient for a particular MySQL instance e Measure how fast the data changes within the InnoDB redo log files Check the LSN periodically to see how much redo data accumulates over the course of some number of hours or days Compare the rate of redo log accumulation with the size of the redo log files Use this ratio to see how often to take an incremental backup to avoid the likelihood of the backup failing due to historical data not available in the redo log For example if you are producing 1GB of redo log data per day and the combined size of your redo log files is 7GB you would schedule incremental backups more frequently than once a week You might perform incremental backups every day or two to avoid a potential issue if a sudden flurry of updates produced more redo than usual Benchmark incremental backup times using both the incremental and incremental with redo 1og only options to confirm if the redo log backup technique performs faster and with le
210. ladmin shutdown Make sure the backup data is fully consistent by either using the backup and apply 10g option to perform the backup or running mysqlbackup with the app1y 10g option after the initial backup Use the mysqlbackup command with the copy back option This operation copies tables indexes metadata and any other required files back to their original locations as defined by the original MySQL configuration file For the different combinations of options that you can specify as part of this operation see Section 5 1 1 3 Restore an Existing Backup UV mysqlbackup defaults file path_to_my cnf datadir path_to_data_directory backup dir path_to backup directory copy back many nes CHE Oates mysqlbackup Finished copying backup files 101208 16 48 13 mysqlbackup mysqlbackup completed OK Now the original database directory is restored from the backup and you can restart the database server 3 3 Backup Scenarios and Examples All of the following tasks and examples make use of the mysqibackup command For detailed syntax information see Chapter 5 mysqlbackup Command Reference 3 3 1 Making a Full Backup Most backup strategies start with a complete backup of the MySQL server from which you can restore all databases and tables After you do one full backup you might do incremental backups which are smaller and faster for the next several backup jobs Periodically you then do another full backup to
211. lbackup access for S3 The storage bucket on Amazon S3 for the backup image cloud object key The Amazon S3 object key for the backup image cloud proxy Proxy address and port number for overriding the environment s default proxy settings for accessing cloud service cloud secret access key cloud service AWS secret access key Cloud service for data backup or restoration cloud trace Print trace information for cloud operations comments Specifies comments string comments file compress Specifies path to comments file Create backup in compressed format compress level Specifies the level of compression compress method Specifies the compression algorithm connect if online connect_timeout Use connection only if available Connection timeout in seconds databases Legacy Specifies the list of non InnoDB tables to back up databases list file Legacy Specifies the pathname of a file that lists the non InnoDB tables to be backed up datadir Path to mysql server data directory debug Print debug information decrypt Decrypt backup image written in an MEB Secure File default character set Set the default character set defaults extra file defaults file Read this file after the global files are read Only read default options from the given file defaults group suffix Also read op
212. leases In the discussions below we assume the new options are used for partial backups For reference purpose we have included information on the older options at the end of this section in Making a Partial Backup with Legacy Options By default all the files in the data directory are included in the backup so that the backup includes data from all MySQL storage engines any third party storage engines and even any non database files in that directory This section explains options you can use to selectively back up or exclude data There are various ways to create different kinds of partial backup with MySQL Enterprise Backup e Including or excluding specific tables by their names This uses the include tables or xclude tables option 36 Making a Partial Backup Each table is checked against the regular expression specified with the include tables or xclude tables option If the regular expression matches the fully qualified name of the table in the form of db_name table_name the table is included or excluded for the backup The regular expression syntax used is the extended form specified in the POSIX 1003 2 standard The options have been implemented with Henry Spencer s regular expression library Including some or all InnoDB tables but not other table types This uses the on1y innodb option e Leaving out files that are present in the MySQL data directory but not actually part of the MySQL in
213. ledgment This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit Link1 4 The names OpenSSL Toolkit and OpenSSL Project must not be used to endorse or promote products derived from this software without prior written permission For written permission please contact openssl corelopenssl org 5 Products derived from this software may not be called OpenSSL nor may OpenSSL appear in their names without prior written permission of the OpenSSL Project 6 Redistributions of any form whatsoever must retain the following acknowledgment This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit Link2 THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT I AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE This
214. license was granted prior to 28 March 2007 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law 2 No Surrender of Others Freedom f conditions are imposed on you whether by court order agreement or otherwise that contradict the conditions of this License they do not excuse you from the conditions of this License If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations then as a consequence you may not convey it at all For example if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program 3 Use with the GNU Affero General Public License Notwithstanding any other provision of this License you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work and to convey the resulting work The terms of this License will continue to apply to the part which is the covered work but the special requirements of the GNU Affero General Public License section 13 concerning interaction through a network will apply to the combination as
215. lly between different backup methods For example backup performance might be acceptable using mysqldump but mysqldump typically takes much longer than MySQL Enterprise Backup for a restore operation The restore operation is often performed during an emergency where it is critical to minimize the downtime of the application or web site The restore operation is always performed with the database server shut down The restore operation is mainly dependent on low level considerations such as I O and network speed for transferring files and CPU speed processor cores and so on for uncompressing data For the combination of options you can specify for a restore job see Section 5 1 1 3 Restore an Existing Backup 116 Restoring Different Classes of Backup Data Restoring Different Classes of Backup Data Restoring a partial backup takes less time than restoring a full backup because there is less data to physically copy See Section 5 1 9 Partial Backup and Restore Options for information about making partial backups Restoring a compressed backup takes more time than restoring an uncompressed backup because the time needed to uncompress the data is typically greater than any time saved by transferring less data across the network If you need to rearrange your storage to free up enough space to uncompress the backup before restoring it include that administration work in your estimate of the total time required In
216. log backup and apply log of copy back operation For restoration using the copy back subcommand the encrypted backup image has to be unpacked and decrypted first using the image to backup dir or extract subcommand together with the decrypt option e key STRING Command Line Format key KEY Permitted Values Type string The symmetric key for encryption and decryption of a backup image It should be a 256 bit key encoded as a string of 64 hexadecimal digits See Chapter 8 Encryption for Backups on how to create a key The option is incompatible with the key file option e key file PATH Command Line Format key file FILE Permitted Values Type file name The pathname to file that contains a 256 bit key encoded as a string of 64 hexadecimal digits for encryption and decryption of a backup image The option is incompatible with the key option 5 1 15 Cloud Storage Options These options are for creating or restoring a single file backup to or from cloud storage See Section 3 3 5 3 Backing Up to Cloud Storage for more information and instructions on using cloud storage with MySQL Enterprise Backup cloud servic Cloud service for data backup or restoration Currently only the Amazon S3 service is supported and s3 is the only value mysqlbackup accepts for this option cloud bucket The storage bucket on Amazon S3 for the backup image The option only
217. lp_topic frm 0 33 47 datadir mysql help_topic MYD 0 33 47 datadir mysql help_topic MYI 0 33 47 datadir mysql host frm 0 33 47 datadir mysql host MYD 0 33 47 datadir mysql host MYI 0 33 47 datadir mysql ibbackup_binlog_marker frm 7 datadir mysql ibbackup_binlog_marker ibd 0 33 47 datadir mysql inventory frm 0 33 47 datadir mysql inventory MYD 0 33 47 datadir mysql inventory MYI 0 33 47 datadir mysql ndb_binlog_index frm 0 33 47 datadir mysql ndb_binlog_index MYD 0 33 47 datadir mysql ndb_binlog_index MYI 0 33 47 datadir mysql plugin frm 0 33 47 datadir mysql plugin MYD 0 33 47 datadir mysql plugin MYI 0 33 47 datadir mysql proc frm 0 33 47 datadir mysql proc MYD 0 33 47 datadir mysql proc MYI 0 33 47 datadizymysql procs priv E 0 33 47 datadir mysql procs_priv MYD 0 33 47 datadizrymysql procs priv MYL 0 33 47 datadir mysql servers frm 0 33 47 datadir mysql servers MYD 0 33 47 datadir mysql servers MYI 0 33 47 datadir mysql slow_log CSM 0 33 47 datadir mysql slow_log CSV 0 33 47 datadir mysql slow_log frm 0 33 47 datadir mysql tables_priv frm 0 33 47 datadir mysql tables_priv MYD 0 33 47 datadir mysql tables_priv MYI 0 33 47 datadir mysql time_zone frm 0 33 47 datadir mysql time_zone MYD 0 33 47 datadir mysql time_zone MYI 0 33 47 datadir mysql time_zone_leap_second frm 0 33 47 datadir mysql time_zone_leap_second MYD 0 33 47 datadir mysql time_zone_leap_second MYI 0 33 47 datadir mysql time_zone_name frm 0 33 47 datadir mysql time
218. lso back up data from a slave server rather than the master to minimize any slowdown of the overall system See Also master replication streaming A backup technique that transfers the data immediately to another server rather than saving a local copy Uses mechanisms such as Unix pipes Requires a single file backup with the destination file specified as standard output See Also single file backup suspend An optional stage within the backup where the MySQL Enterprise Backup processing stops to allow for user specific operations to be run The mysqlbackup command has options that let you specify commands to be run while the backup is suspended Most often used in conjunction with backups of InnoDB tables only where you might do your own scripting for handling frm files See Also frm file InnoDB system backup to tape An API for media management software Abbreviated SBT Several mysqibackup options with sbt in their names pass information to media management software products such as Oracle Secure Backup See Also Oracle Secure Backup SBT system tablespace By default this single data file stores all the table data for a database as well as all the metadata for InnoDB related objects the data dictionary Turning on the innodb_file_per_table option causes each newly created table to be stored in its own tablespace reducing the size of and dependencies on the system tablespace 179 Keeping all table data i
219. lues supplied by defaults files and exit process threads Specifies the number of process threads for the backup operation progress interval Interval between progress reports in seconds protocol Connection protocol read threads Specifies the number of read threads for the backup operation relay log index Specifies the absolute path of the index file on the MySQL 3 11 0 server that lists all the used relay log files for offline backups of salve servers only relaylog info file Specifies the absolute path of the information file in which 3 11 0 a slave records information about the relay logs for offline backups of salve servers only sbt database name Used as a hint to the Media Management Software MMS for the selection of media and policies for tape backup sbt environment Comma separated list of environment variable assignments to be given to the SBT library sbt lib path secure auth Path name of the SBT library used by software that manages tape backups Refuse client connecting to server if it uses old pre 4 1 1 protocol shared memory base name It designates the shared memory name used by a Windows server to permit clients to connect using shared memory Windows only 62 mysqlbackup Command Line Options Format Description Introduced show progress Instructs mysqlbackup to periodically output short progress reports known as progres
220. lusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate 6 Conveying Non Source Forms You may convey a covered work in object code form under the terms of sections 4 and 5 provided that you also convey the machine readable Corresponding Source under the terms of this License in one of these ways a Convey the object code in or embodied in a physical product including a physical distribution medium accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange b Convey the object code in or embodied in a physical product including a physical distribution medium accompanied by a written offer valid for at least three years and valid for as long as you offer spare parts or customer support for that product model to give anyone who possesses the object code either 1 a copy of the Corresponding Source for all the software in the product that is covered by this License on a durable physical medium customarily used for software 153 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 interchange for a price no more than your reasonable cost of physically performing this conveying of source or 2 access to copy the Corresponding Source from a network server at no charge c Convey individual copies of the object code with a copy of the wri
221. ly puts the database into a read only state using the statement FLUSH TABLES WITH READ LOCK For best backup performance and minimal impact on database processing 1 Do not run long SELECT queries or other SQL statements at the time of the backup run 2 Keep your MyISAM tables relatively small and primarily for read only or read mostly work Then the locked phase at the end of a mysqibackup run is short maybe a few seconds and does not disturb the normal processing of mysqld much If the preceding conditions are not met in your database application use the only innodb or only innodb with frm option to back up only InnoDB tables or use the no 1ocking option to back up non InnoDB files Note that MyISAM frm and other files copied under the no 1ocking setting cannot be guaranteed to be consistent if they are updated during this final phase of the backup For a large database a backup run might take a long time Always check that mysqlbackup has completed successfully either by verifying that the mysqlbackup command returned exit code 0 or by observing that mysqlbackup has printed the text mysqlbackup completed OK e The mysqlbackup command is not the same as the former MySQL Backup open source project from the MySQL 6 0 source tree The MySQL Enterprise Backup product supersedes the MySQL Backup initiative Schedule backups during periods when no DDL operations involving tables are running See Se
222. m is 15 if you supply a negative value it is silently adjusted to 15 For appl y 1og operations the number of write threads is always 0 regardless of this option setting See Section 7 1 Optimizing Backup Performance and Section 7 2 Optimizing Restore Performance for advice about recommended combinations of values for read threads process threads and write threads for various hardware configurations such as RAID or non RAID storage devices 1imit memory MB Command Line Format limit memory MB Permitted Values Type numeric Default 100 for apply log without uncompression 300 for other operations Min 0 Value Max 999999 Value Specify maximum memory in megabytes that can be used by the mysqlbackup command Formerly applied only to app1y 10g9 operation but in MySQL Enterprise Backup 3 8 and higher it applies to all operations Do not include any suffixes such as mb or kb in the option value Default 100 for app1y 10g not used with uncompress 300 for all operations in megabytes The memory limit specified by this option also caps the number of 16MB buffers available for multithreaded processing For example with a 300 MB limit the maximum number of buffers is 18 If additional buffers are required because you increase the values for read threads process threads write threads and or number of buffers increase the 1imit memory value proportionally
223. mes or file names that contain special characters spaces dashes periods etc see this description in Appendix A MySQL Enterprise Backup Limitations for details mysqlbackup throws an error when the option is used without a regular expression being supplied with it While the option can be used for different kinds of backups selective restore is only supported for backups created using transportable tablespaces TTS that is backups created with the use tts option The option cannot be used together with the legacy include databases databases 1list file of only innodb with frm option When used together with the xclude tables option include tables is applied first meaning mysqlbackup first selects all tables specified by include tables and then excludes from the set those tables specified by xclude tables xclude tables REGEXP Command Line Format xclude tables REGEXP 84 Partial Backup and Restore Options Permitted Values Type string Exclude for backup or restoration all tables both innodb and non innodb whose fully qualified names in the form of db_name table_name match the regular expression REGEXP The regular expression syntax is the extended form specified in the POSIX 1003 2 standard For example exclude tables mydb t 12 matches the tables t1 and t2 in the database mydb On Unix like systems quote the regular expression appropriately to p
224. move the image file without losing or damaging the contents inside it then unpack it with the mysqlbackup command using the extract option and specifying the same image name with the backup image option Although some extra files such as backup my cnf and the meta subdirectory are present in the backup directory these files are also included in the image file and do not need to be moved along with it Any other files in the database subdirectories under the datadir directory that is under backup dir datadir data base name Copied from the database subdirectories under the MySQL data directory By default any unrecognized files in the database subdirectories under the MySQL data directory are copied to the backup To omit such files specify the on1y known file types option meta directory A subdirectory that stores files with metadata about the backup Created under the backup directory by the mysqlbackup command All files listed below go inside the meta subdirectory backup_variables txt image_files xml Holds important information about the backup For use by the mysqlbackup command only Prior to MySQL Enterprise Backup 3 6 this information was in a file named ibbackup_binlog_info Contains the list of all the files except itself that are present in the single file backup produced The mysqlbackup command consults and possibly updates this file during operations after t
225. must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution 3 All advertising materials mentioning features or use of this software must display the following acknowledgement This product includes cryptographic software written by Eric Young eay cryptsoft com The word cryptographic can be left out if the routines from the library being used are not cryptographic related 4 If you include any Windows specific code or a derivative thereof from the apps directory application code you must include an acknowledgement This product includes software written by Tim Hudson tjh cryptsoft com THIS SOFTWARE IS PROVIDED BY ERIC YOUNG AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF 165 Percona Multiple I O Threads Patch License THIS SOFTWARE EVEN IF ADVISED OF TH
226. mysql columns_priv frm 0 33 47 datadir mysql columns_priv MYD 0 33 47 datadir mysql columns_priv MYI 0 33 47 datadir mysql db frm 0 33 47 datadir mysql db MYD 0 33 47 datadir mysql db MYI 0 33 47 datadir mysql event frm 0 33 47 datadir mysql event MYD 0 33 47 datadir mysql event MYI 0 33 47 datadir mysql func frm 0 33 47 datadir mysql func MYD 0 33 47 datadir mysql func MYI 0 33 47 datadir mysql general_log CSM 0 33 47 datadir mysql general_log CSV 0 33 47 datadir mysql general_log frm 0 33 47 datadir mysql help_category frm 0 33 47 datadir mysql help_category MYD 0 33 47 datadir mysql help_category MYI 0 33 47 datadir mysql help_keyword frm 0 33 47 datadir mysql help_keyword MYD 0 33 47 datadir mysql help_keyword MYI 0 33 47 datadir mysql help_relation frm 0 33 47 datadir mysql help_relation MYD i ie i ie i Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 2011 06 Users cirrus backups 201
227. mysqlbackup STD OPTIONS backup image IMAGE backup dir PATH src entry PATH dst entry PATH MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS extract mysqlbackup STD OPTIONS SERVER REPOSITORY OPTIONS backup image IMAGE backup dir PATH MESSAGE LOGGING OPTIONS PARTIAL BACKUP RESTORE OPTIONS PROGRESS REPORT OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS copy back and apply log image to backup dir Unpacks a single file backup to a full backup directory structure You specify the paths to both the image file and the destination directory in which to unpack For usage and examples see Section 3 3 5 Making a Single File Backup backup dir to imag Packs an existing backup into a single file Specify a backup image value of standard output to stream an existing backup directory structure to a tape device or a command that transfers the backup to another server The backup image parameter is either or an absolute path outside the backup dir directory For usage and examples see Section 3 3 5 Making a Single File Backup 70 Standard Options e list image Display the contents of a single file backup Lists all files and directories in the image The src ent ry name Can be used to list a specific file or directory If the name is a directory all its files and subdirectories inside the image are re
228. mysqlbackup on the shared library libz so 5 which can be installed on your system by installing for example the compatsx libraries For certain Linux distributions the product is also available as an RPM archive When you install the RPM using the command sudo rpm i package_name rpm the mysqlbackup command is installed in the directory opt mysql meb 3 11 You must add this directory to your PATH setting Installing on Windows Systems The product can be installed together with other MySQL products with the MySQL Installer for Windows It can also be installed separately with either an individual msi installer or zip file When installing with a msi installer specify the installation location preferably under the same directory where other MySQL products have been installed Choose the option Include directory in Windows PATH so that you can run the mysqlbackup command from any directory When installing with a zip file simply unzip the file and put mysqlbackup exe at the desired installation location You can add that location to the PATH variable so that you can run the mysqlbackup command from any directory Verify the installation by selecting the menu item Start gt Programs gt MySQL Enterprise Backup 3 11 gt MySQL Enterprise Backup Command Line The menu item displays version information and opens a command prompt for running the mysqlbackup command 19 20 Part Il Using MySQL Enterprise Ba
229. n extra privileges are required of the user through which mysqlbackup connects to the server see Section 3 1 2 Grant MySQL Privileges to Backup Administrator for details There are some special requirements for restoring backups created with the use tts option see Restoring Backups Created with the use tts Option for details Legacy Partial Backup Options Important A Information in this subsection is only for using the legacy options of include databases databases list file and only innodb with frm which will be deprecated in the upcoming issues For creating partial backups it is strongly recommended that the new options of include tables and xclude tables be used instead Note that you cannot combine the legacy and the new partial backup options in a single command Besides the legacy options some other options are also discussed below but the information is only for using the options together with the legacy partial backup options For an overview of partial backups and usage information about these legacy options see Making a Partial Backup with the Legacy Options e include REGEXP This option is for filtering InnoDB tables for backup The InnoDB tables fully qualified names are checked against the regular expression specified by the option If the REGEXP matches db_name table_name the table is included The regular expression syntax used is the extended form specified in the POSIX 100
230. n Files Stored with the Backup Data Each set of backup data includes a configuration file backup my cnf containing a minimal set of configuration parameters The mysqlbackup command generates this file to record the settings that apply to this backup data Subsequent operations such as the appl y log process read options from this file to determine how the backup data is structured Example 5 5 Example backup my cnf file Here is an example backup my cnf file generated by mysqlbackup mysqld innodb_data_file_path ibdatal 256M ibdata2 256M autoextend innodb_log_file_size 256M innodb_log_files_in_group 3 All paths in the generated backup my cnf file point to a single backup directory For ease of verification and maintenance you typically store all data for a backup inside a single directory rather than scattered among different directories During a backup the configuration parameters that are required for later stages such as the restore operation are recorded in the backup my cnf file that is generated in the backup directory 106 Configuration Files Stored with the Backup Data Only the minimal required parameters are stored in backup my cnf to allow you to restore the backup to a different location without extensive changes to that file For example although the innodb_data_home_dir and innodb_log_group_home_dir options can go into backup my cnf they are omitted when those values are the same as the ba
231. n Version 3 1 31 March 2009 ccccecececece cece ce eeee ee ee eee eeaeeeeeeeeesaeeeeaaeeeseeeeaaes 149 E 3 GNU Standard C Library libstdc License ooononocccccnnicccnconncaconnnnnonnnonncncnnncnncnnns 161 E 4 Google Controlling Master Thread I O Rate Patch License ccceeeeeeeeeeeeeeeeeeeeees 162 E 5 Google SMP Patch License mio ee i indie 163 FG LZE ECONS dia 164 E7 OpenSSL vV EO CC NSE shsgusstideberesleoveasdl dene A A ea A lasek dens 164 E 8 Percona Multiple I O Threads Patch License ccccceeeeeeeeeeeeeeeaeeeteeeeeeeeeeeaaaaeeeees 166 E 9 RegEX Spencer Library License oooocoicinncncoconoccconncnconononnnncnncnncn nn nn nnanannrnn nn nc nn rra 166 E 10 RFC 3174 US Secure Hash Algorithm 1 SHA1 License ooocicnnnconnconiccccnncnccnnnnninn 167 Belt A O NO 167 MySQL Enterprise Backup Glossary oooooccccccoconccnnconccccnnnoncnnnnancnccnncn nono nnnnancrnnnnnnnnnnanannennnnnnnnns 169 INDEX A sisiedeine di Gs EEEE E E E E E E O E E E E E E E histatins eee ieee 181 List of Tables 1 1 Files in a MySQL Enterprise Backup Output Directory 0ccceceeeeeee eee eeeeeeeeeeeeaaeaeeeeeeeeeeeeaeaaeaees 3 1 Information Needed to Back Up a Database cece eter eee tee eee eee eeeeeeaeeeeeeeaeeeeeaaaaeeeeaeaees Sa List Of All oi lola e A e qt vi List of Examples 3 1 Making an Uncompressed Partial Backup of InnoDB Tables cceeceeeeeeeeeeneeeeeeeeeeeee
232. n nn nn nnanancin 42 3 13 Dealing with Absolute Path Names ccccceeeeeeeeecceeeeeeeeee ee ae aaa teeeeeeeeeaeaaeaeeeeeeeeeeeaaaaeeeeeeeeeees 43 3 14 Single File Backup to a Remote Host ccccceceeeeeee ee eee eeeeeeeeeeeeee aa ee eeceeeeeeeeeaaaaeeeeeseeeeesaeaaeaees 43 3 15 Single file Backup to a Remote MySQL Server c ccceeeeeeeeeeeeeeeeeeeeeceaaeaeeeeeeeeeeeeaaaaeeeeeseeeees 43 3 16 Stream a Backup Directory to a Remote MySQL Server ooocccccocccccccononoccnononnccnnnnnncnnnannncnnnnnnnnnns 43 3 17 Creating a Cloud Backup ccccceccceceee teeter ee ee eee te tenets ee eae dete nese ee ee aa eeeeeeeeaaaaaaneeeeeeeeeaea 44 3 18 Extract an Existing Image from Cloud Storage to Backup Directory 0 ccceceeeceeeeeeeeeeeeeeeeaaes 44 3 19 Optimistic Backup Using the Option opt imistic time YYMMDDHHMMSS cocoonnccnnnnnnncnnnnnnnnnnonnnons 45 3 20 Optimistic Backup Using the Option optimistic time now cooooccnonnnnncnnnnannnnnonannnnnnnannnnnnnannnnns 46 3 21 Optimistic Backup Using the optimistic busy tables OPTION ococoooccnnccnnccnnnnnncnnnnnnncnnnonnnens 46 3 22 Optimistic and Partial Backup Using both the opt imistic busy tables and optimistic eime Options iii ad i aadA 46 4 1 Applying the Log toa Backup ooo ai 50 4 2 Applying the Log to a Compressed Backup cccccecceeeeeeeeeeeee ee aeeaeeeeeeeeeeeeaeaaeeceeeeeeeeeaeaaeaneneeeees 50 4 3 Applying an Incremental Backup to a Full Backup
233. n the system tablespace has implications for the MySQL Enterprise Backup product backing up one large file rather than several smaller files and prevents you from using certain InnoDB features that require the newer Barracuda file format on the See Also Barracuda data dictionary file format ibdata file tablespace T TRG file A file containing trigger parameters Files with this extension are always included in backups produced by the mysqlbackup command of the MySQL Enterprise Backup product table Although a table is a distinct addressable object in the context of SQL for backup purposes we are often concerned with whether the table is part of the system tablespace or was created under the file per table setting and so resides in its own tablespace See Also backup system tablespace tablespace tablespace For InnoDB tables the file that holds the data and indexes for a table Can be either the system tablespace containing multiple tables or a table created with the file per table setting that resides in its own tablespace file See Also InnoDB system tablespace transportable tablespace A feature that allows a tablespace to be moved from one instance to another Traditionally this has not been possible for InnoDB tablespaces because all table data was part of the system tablespace In MySQL 5 6 and higher the FLUSH TABLES FOR EXPORT syntax prepares an InnoDB table for copying to another server running ALTER TABLE DI
234. nal IDs and other data values that can only be restored to the same instance not a different MySQL server Always fully test the recovery procedure for any partial backups to understand the relevant procedures and restrictions With its include option mysqlbackup can make a backup that includes some InnoDB tables but not others 38 Making a Partial Backup A partial backup with the include option always contains the InnoDB system tablespace and all the tables inside it For the InnoDB tables stored outside the system tablespace the partial backup includes only those tables whose names match the regular expression specified with the include option This operation requires the tables being left out to be stored in separate table_name ibd files To put an InnoDB table outside the system tablespace create it while the innodb_file_per_table MySQL configuration option is enabled Each ibd file holds the data and indexes of one table only Those InnoDB tables created with innodb_file_per_table turned off are stored as usual in the InnoDB system tablespace and cannot be left out of the backup For each table with a per table data file a string of the form db_name table_name is checked against the regular expression specified with the include option If the regular expression matches the complete string db_name table_name the table is included in the backup The regular expression syntax used is the extended form spec
235. ng a backup the following examples show how to do a full backup examine the data files in the backup directory and then restore the backup to correct an issue with corruption or lost data 3 2 1 Backing Up an Entire MySQL Instance In this example we specify all required options on the command line for illustration purposes After testing and standardizing the backup procedure we could move some options to the MySQL configuration file The options specify connection information for the database and the location to store the backup data The final option backup specifies the type of operation because mysqlbackup can perform several kinds of backup restore and pack unpack operations For this example we specify the final option as backup and apply log This option performs an extra stage after the initial backup to bring all InnoDB tables up to date with any changes that occurred during the backup operation so that the backup is immediately ready to be restored For backups of huge or busy databases you might split up these stages to minimize load on the database server That is run mysqlbackup first with the backup option transfer the backup to another server then run mysqlbackup with the apply log option to perform the final processing The output echoes all the parameters used by the backup operation including several that are retrieved automatically using the database connection The unique ID for this backup job is recorded in special
236. ng format MEB_timestamp_operation log where operationis the mysqlbackup operation that was run e g backup apply log etc and timestamp is the date and time at which the operation was run Here are some examples of names for the log files MEB_2013 06 24 16 32 43_backup log Mira OS UGG A Ol Ss aay oe oE MEBR2 OS 00201030806 aise nee oe The following options control the message logging function 7 skip messages logdir 98 Progress Report Options Skip message logging Logging is turned on by default except for the 1ist image and validate operations see the description for the messages logdir option for details and it is turned off by this option e messages logdir path Command Line Format messages logdir PATH Permitted Values Type directory name Default backup_dir meta Specifies the path name of an existing directory for storing the message log If the specified directory does not exist message logging fails and returns an error message When this option is omitted the default directory of backup_dir meta is used Note Y Use this option to turn on message logging for the 1ist image and validate operations Message logging is turned off by default for the two operations because they do not modify any files and a message log is usually not required for debugging them And because the default path name of backup_dir meta is not meaningful for the two operations this
237. nnection if available e Else the innodb_log_files_in_group value from the command line or configuration file backup_innodb_log_file_size SIZE Specifies maximum single InnoDB log file size in backup before switching to next log file Example 20M Usually the same as innodb_log_file_size but can be different The value for this parameter is derived as e Specified backup_innodb_log_file_size value from command line or configuration file e Else innodb_log_file_size value from database connection if available e Else specified innodb_log_file_size value from command line or configuration file backup_innodb_page_size SIZE The page size for all InnoDB tablespaces in a MySQL instance The page size must be the same value as in MySQL instance By default it assumes the innodb page size in server backup_innodb_checksum_algorithm NAME The name of the checksum algorithm used for validating InnoDB tablespaces Default is innodb backup_innodb_undo_directory PATH The relative or absolute directory path where InnoDB creates separate tablespaces for the undo logs Typically used to place those logs on a different storage device backup_innodb_undo_logs NUMBER Number of rollback segments in the system tablespace that InnoDB uses within a transaction This setting is appropriate for tuning performance if you observe mutex contention related to the undo logs backup_innodb_undo_tablespaces NUMBER The number of tablespace files that th
238. noDB log to a file called ibbackup_logfile This log file is used to roll forward the backed up data files so that every page in the data files corresponds to the same log sequence number of the InnoDB log This phase also creates new ib_logfiles that correspond to the data files The mysgqibackup option for turning a raw backup into a prepared backup is appl y log You can run this step on the same database server where you did the backup or transfer the raw backup files to a different system first to limit the CPU and storage overhead on the database server Note Y Since the apply log operation does not modify any of the original files in the backup nothing is lost if the operation fails for some reason for example insufficient disk space After fixing the problem you can safely retry apply log and by specifying the force 72 option which allows the data and log files created by the failed app1y 10g operation to be overwritten 49 Performing a Restore Operation For simple backups without compression or incremental backup you can combine the initial backup and the apply log step using the option backup and apply log You can also perform app1y 1og and copy back which restores the prepared backup with a single copy back and apply log command Example 4 1 Applying the Log to a Backup This example runs mysqlbackup to roll forward the data files so that the data is ready to be restored mysqlbackup bac
239. nonocnccnnnnncnnnnnnancnnnnn nn cnn nana n rr rra n cn nn nn 59 52121 SUDCOMMANS 2 A A At died 64 51 2 Standard Options wc cw ketene ei A ede ed 71 5 13 Connection OPUONS airea ya td e t a eae aetna penchant La A 72 5 1 4 Server Repository Options ccceeeeeeeeeeeee eee cece eeee sete ee aaaaeeeeeeeeeeeaeaaaeeeeeeeeeeeaeaaaaees 74 5 1 5 Backup Repository Options oooooccccccccccconccoconcnnconononnnnnoncnncononnnnancnncnnnannnnnnanancinncnnnnnns 76 5 16 Metadata Options aia A IA K 79 5 1 7 Compression Options c cece cece ee cece cece eee ee eter tees ae aa eee eeeeeeeeaeaaeaneeeeeeeeeaeaaaaneneeeees 79 5 1 8 Incremental Backup Options oooooocococccccnnoncnononncnncnnnnnonononnnncnnnnn ccoo rra a rra nan cn narra mann 80 5 1 9 Partial Backup and Restore Options 00 ccccceeeceaeceeeeeeeeeeeeeeeaaeeeeeeeeeeeeeeaaaaeeeeseeeees 84 5 1 10 Single File Backup Options 00ooocccccccocccononcccccnnnoncnnnonncnccnnnnnnnnnnnnancnnnnnnonnnnnnancrncancnnns 90 5 1 11 Performance Scalability Capacity Options 0oooooccicccncoccconccnconnoncnnnnonnanconcancnnnnnnnanos 92 5 1 12 Message Logging Options ccceeeeeeeeneeeeeeeeeee tees ae aa eeeeeeeeeeeeaeaaeaeeeeeeeeeeaeaaaaneneeeees 98 5 1 13 Progress Report Options 0 ccccceeeeeeaeeeeeeeeeeeee ee ae ea eeeeeeeeeeeeaaaaaeeeeeeseeeeaeaaeeeeeseeeees 99 511 14 Encryption Options 22 tweia tte A ahaa 102 5 1 15 Cloud Storage Options ge siei Tenian acia a
240. ns for the table to be restored This prevents users from modifying the table while the restore is in progress LOCK TABLES tbl name WRITE Issue this ALTER TABLE statement ALTER TABLE tbl_name DISCARD TABLESPACE Caution This deletes the current ibd file Copy the backup ibd file back to the appropriate database directory Issue this ALTER TABLE statement ALTER TABLE tb1_name IMPORT TABLESPACE Release the write lock to complete the restore procedure UNLOCK TABLES In this context a clean ibd file backup means e There are no uncommitted modifications by transactions in the ibd file 54 Restoring a Backup with a Database Upgrade or Downgrade There are no unmerged insert buffer entries in the ibd file e Purge has removed all delete marked index records from the ibd file mysqld has flushed all modified pages of the ibd file from the buffer pool to the file You can make such a clean backup ibd file with the following method 1 2 Stop all activity from the mysqld server and commit all transactions Wait until SHOW INNODB STATUS shows that there are no active transactions in the database and the main thread status of InnoDBis Waiting for server activity Then you can make a copy of the ibd file Another method for making a clean copy of an ibd file is to use mysqlbackup 1 Use mysqlbackup with the only innodb or only innodb with frm option to bac
241. nsportable tablespaces TTS to back up and restore InnoDB tables e LOCK TABLES and SELECT for backing up tables CREATE and ALTER for restoring tables To set these privileges issue a statement like the following from the mysql client program GRANT LOCK TABLES SELECT CREATE ALTER ON TO mysqlbackup localhost 27 Designate a Location for Backup Data 3 1 3 Designate a Location for Backup Data All backup related operations either create new files or reference existing files underneath a specified directory that holds backup data Choose this directory in advance on a file system with sufficient storage It could even be remotely mounted from a different server You specify the path to this directory with the backup di r option for many invocations of the mysqlbackup command Once you establish a regular backup schedule with automated jobs it is preferable to keep each backup within a timestamped subdirectory underneath the main backup directory To make the mysqlbackup command create these subdirectories automatically specify the with timestamp option each time you run mysgqlbackup For one time backup operations for example when cloning a database to set up a replication slave you might specify a new directory each time or specify the force 72 option of mysq1backup to overwrite older backup files 3 2 The Typical Backup Verify Restore Cycle To illustrate the basic steps in making and usi
242. nt xml respectively This data can be used by management tools during diagnosis and troubleshooting procedures master In a replication configuration a database server that sends updates to a set of slave servers It typically dedicates most of its resources to write operations leaving user queries to the slaves With MySQL Enterprise Backup typically you perform backups on the slave servers rather than the master to minimize any slowdown of the overall system See Also replication slave media management software A class of software programs for managing backup media such as libraries of tape backups One example is Oracle Secure Backup Abbreviated MMS See Also Oracle Secure Backup my cnf The typical name for the MySQL configuration file on Linux Unix and OS X systems See Also configuration file my ini my ini The typical name for the MySQL configuration file on Windows systems See Also configuration file my cnf MyISAM A MySQL storage engine formerly the default for new tables In MySQL 5 5 and higher InnoDB becomes the default storage engine MySQL Enterprise Backup can back up both types of tables and tables from other storage engines also The backup process for InnoDB tables hot backup is less disruptive to database operations than for MyISAM tables warm backup See Also hot backup InnoDB warm backup MySQL Enterprise Backup A licensed products that performs hot backups of MySQL databases It offers the most
243. nterrupted e 11 5 130 Why is the option defaults file not recognized e 11 6 130 Can back up a database on one OS platform and restore it on another one using MySQL Enterprise Backup Questions and Answers 11 1 Does MySQL Enterprise Backup work with MySQL Server version x y z See Section B 2 Compatibility with MySQL Versions for details of compatibility between different releases of MySQL Enterprise Backup and MySQL Server 11 2 What is the big ibdata file that is in all the backups You might find your backup data taking more space than expected because of a large file with a name such as ibdatal This file represents the InnoDB system tablespace which grows but never shrinks and is included in every full and incremental backup To reduce the space taken up by this file in your backup data e After doing a full backup do a succession of incremental backups which take up less space The ibdatal file in the incremental backups is typically much smaller containing only the portions of the system tablespace that changed since the full backup e Set the configuration option innodb_file _per_table 1 before creating your biggest or most active InnoDB tables Those tables are split off from the system tablespaces into separate ibd files which are more flexible in terms of freeing disk space when dropped or truncated and can be individually included or excluded from backups e If your system tablespace is very large
244. o MySQL Enterprise Backup coooococcccnccnconcnnnnnnccnnnnnnncnnnnananccnnnn ccoo nnnnan cerrar ccnnnnnnanes 5 1 1 Types of Backups ocio eed ees eee eee eee eee eed dada 5 1 2 The mysqlbackup Command ccceceeeeeee ee eeeteeeeeeee tees aeaaeeceeeeeeeeeaeaaeaneeeeeeeeeaeaaaaenees 6 1 3 Overview of Backup Performance and Capacity Considerations c cseeeeeeeeeeeeeeeeee 6 1 4 Files that Are Backed Up 0 cccceceeeee cece cece einer AANEEN Kia ere ENA EN Kiwa KRENUO KE ENEAN ANER E 7 1 5 Overview of Restoring a Database oooccccncococococnccncnncononononnnnncanco aeaaeeeeeeeeeeeeaeaaeeeeeeeeees 17 2 Installing MySQL Enterprise Backup cccceceeeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaaaaeaeeeeeeeeeeaeaaaaneneeeees 19 Il Using MySQL Enterprise Backup ccc ccc eeeeee cece ee eee eee e eee tees eaten rete ee ae aa eae eeeeeeeeeeaaaaeeeeeeeeeeeaea 21 3 Backing Up a Database Server 0 ccccecece ce ceeeeeeeeeee ee eee ee stetu sees ee aa aaeneeeeeeeeeaeaaaaneeeeeeeeeaeaaed 25 3 1 Before the First Backup aeir aiia e a ee en ea e AURE EANA ANNY KAA A a rar 25 3 1 1 Collect Database Information ooooocccnnncicoconococonnnnncnnnonncnnonnnncnnnnnnnan cnn nan cn nn nnnnnns 25 3 1 2 Grant MySQL Privileges to Backup Administrator ooocccccnnnnnnnconncoccnnnnccnnninacnnnnn 27 3 1 3 Designate a Location for Backup Data 2 00 0 cc ceeeeeceneeeeeeaeeeeeeeaaeeeeeeaaeeeeeeaaieees 28 3 2 The Typical Backup
245. o binary log C cold backup A backup taken while the database is shut down For busy applications and web sites this might not be practical and you might prefer a warm backup or a hot backup See Also backup connection hot backup warm backup compression A technique that produces smaller backup files with size reduction influenced by the compression level setting Suitable for keeping multiple sets of non critical backup files For recent backups of critical data you might leave the data uncompressed to allow fast restore speed in case of emergency MySQL Enterprise Backup can apply compression to the contents of InnoDB tables during the backup process turning the ibd files into ibz files 170 Compression adds CPU overhead to the backup process and requires additional time and disk space during the restore process See Also backup compression level ibd file ibz file InnoDB restore compression level A setting that determines how much compression to apply to a compressed backup This setting ranges from 0 none 1 default level when compression is enabled to 9 maximum The amount of compression for a given compression level depends on the nature of your data values Higher compression levels do impose additional CPU overhead so ideally you use the lowest value that produces a good balance of compression with low CPU overhead See Also compression configuration file The file that holds the startup op
246. o meet all of these conditions a The work must carry prominent notices stating that you modified it and giving a relevant date b The work must carry prominent notices stating that it is released under this License and any conditions added under section 7 This requirement modifies the requirement in section 4 to keep intact all notices c You must license the entire work as a whole under this License to anyone who comes into possession of a copy This License will therefore apply along with any applicable section 7 additional terms to the whole of the work and all its parts regardless of how they are packaged This License gives no permission to license the work in any other way but it does not invalidate such permission if you have separately received it d If the work has interactive user interfaces each must display Appropriate Legal Notices however if the Program has interactive interfaces that do not display Appropriate Legal Notices your work need not make them do so A compilation of a covered work with other separate and independent works which are not by their nature extensions of the covered work and which are not combined with it such as to form a larger program in or on a volume of a storage or distribution medium is called an aggregate if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation s users beyond what the individual works permit Inc
247. oDB tables e only innodb with frm a11 includes the frm files for all InnoDB tables in the backup 88 Partial Backup and Restore Options e only innodb with frm related in combination with the include option copies only the frm files for the tables that are included in the partial backup e only innodb with frm with no argument is the same as only innodb with frm related Note Y For incremental backups even only changed ibd files are backed up frm files associated with all specified InnoDB tables are included This option saves you having to script the backup step for InnoDB frm files which you would normally do while the server is put into a read only state by a FLUSH TABLES WITH READ LOCK statement The frm files are copied without putting the server into a read only state so that the backup operation is a true hot backup and does not interrupt database processing You must ensure that no ALTER TABLE or other DDL statements change frm files for InnoDB tables while the backup is in progress If the mysqlbackup command detects changes to any relevant frm files during the backup operation it halts with an error If it is not practical to forbid DDL on InnoDB tables during the backup operation use the on1y innodb option instead and use the traditional method of copying the frm files while the server is locked All files created by other storage engines are excluded Typically used w
248. ocalhost user mysqluser protocol TCP port 3306 backup dir MEB_BACKUPS_DIR backupdir include tables emp backup Taking a backup of all tables except tables from the mysql and performance_schema databases mysqlbackup host localhost user mysqluser protocol TCP port 3306 backup dir SMEB_BACKUPS_DIR backupdir exclude tables mysql performance_schema backup Taking a backup of all tables in the sales database but excludes the table with the name hardware mysqlbackup host localhost user mysqluser protocol TCP port 3306 37 Making a Partial Backup backup dir MEB_BACKUPS_DIR backupdir include tables sales exclude tables sales hardware backup Backing up all InnoDB tables but not frm files mysqlbackup defaults file home pekka my cnf only innodb backup You can also make compressed single image and other kinds of selective backups by adding the appropriate options Next Steps e Make a note of the LSN value in the message at the end of both full and incremental backups for example mysqlbackup Was able to parse the log up to lsn LSN_number You specify this value when performing incremental backups of changes that occur after this full backup Apply the log to the uncompressed backup files so that the full backup is ready to be restored at any time You can move the backup data to a diff
249. of the MySQL Enterprise Backup and MySQL Enterprise Monitor products you can monitor the progress and history of backup jobs without writing your own queries or scripts e The MySQL Enterprise Monitor graphs Backup Run Time and Backup Locked Time chart how long the phases of backup jobs take e The MySQL Enterprise Monitor rules MySQL Enterprise Backup Failed MySQL Enterprise Backup Succeeded MySQL Enterprise Backup Lock Time Excessive Incremental MySQL Enterprise Backups Not Enabled and Last Full MySQL Enterprise Backup Too Old alert you to issues related to backup jobs The monitoring capability requires MySQL Enterprise Backup 3 5 3 and higher and MySQL Enterprise Monitor 2 3 4 and higher For information about these MySQL Enterprise Monitor features see the MySQL Enterprise Monitor User s Guide 10 2 Error codes of MySQL Enterprise Backup 123 Working Around Corruption Problems The return code of the MySQL Enterprise Backup mysqlbackup process is 0 if the backup or restore run succeeds If the run fails for any reason the return code is 1 10 3 Working Around Corruption Problems Sometimes the operating system or the hardware can corrupt a data file page in a location that does not cause a database error but prevents mysqlbackup from completing mysqlbackup Re reading page at offset 0 3185082368 in sqldata mts ibdatal5 mysqlbackup Re reading page at offset 0 3185082368 in sqldata mts ibdatal5 mys
250. of the backup file format The format used by InnoDB for its data files named ibdatal ibdata2 and so on Each file format supports one or more row formats See Also Antelope Barracuda ibdata file row format full backup A backup that includes all the tables in each MySQL database and all the databases in a MySQL instance Contrast with partial backup and incremental backup Full backups take the longest but also require the least amount of followup work and administration complexity Thus even when you primarily do partial or incremental backups you might periodically do a full backup See Also backup incremental backup partial backup table H history table The table mysql backup_hi story that holds details of completed backup operations While a backup job is running the details especially the changing status value are recorded in the progress table 172 See Also backup progress table hot backup A backup taken while the MySQL instance and is running and applications are reading and writing to it Contrast with warm backup and cold backup A hot backup involves more than simply copying data files it must include any data that was inserted or updated while the backup was in process it must exclude any data that was deleted while the backup was in process and it must ignore any changes started by transactions but not committed The Oracle product that performs hot backups of InnoDB tables espe
251. ogress 100 of 1450 MB state Copying ibd files This shows that 100 megabytes of a total of 1450 megabytes have been copied or processed so far and mysqlbackup is currently copying InnoDB data files ibd files The progress indicator string begins with Progress followed by one or more meters measuring the progress If multiple meters are present they are separated by semicolons The different types of meters include e Total data meter It is always the first meter in the progress indicator It is in the format of DATA of TOTAL UNIT DATA and TOTAL are unsigned decimal integers and UNIT is either MB megabytes KB kilobytes or bytes 1MB 1024KB and 1KB 1024 bytes The total data meter has two slightly different meanings depending on the mysqibackup operation e The amount of data copied or processed and the total amount of data to be copied or processed by the mysqlbackup operation For example Progress 200 of 1450 MB When the operation is for e g backup the indicator means 200MB is copied of 1450MB But when the operation is for e g validate or incremental it means 200MB is processed out of 1450MB Total amount of data copied or processed and an estimate for the total that will be copied by the end of the operation The estimated total is updated as per the data on the server as the execution of the command progresses For some operations such as backup it is not possible to know exactly at the start of t
252. ogress tables created by mysqlbackup use the CSV format so the backup always includes some files with this extension MRG MERGE storage engine references to other tables The database is put into a read only state while these files are copied These files are copied without changes Files that Are Backed Up File Name Pattern or Extension Relation to Original Data Files Notes PERG TRN Trigger parameters Trigger namespace information The database is put into a read only state while these files are copied These files are copied without changes The database is put into a read only state while these files are copied These files are copied without changes Opt Database configuration information The database is put into a read only state while these files are copied These files are copied without changes Definitions for partitioned tables The database is put into a read only state while these files are copied These files are copied without changes ARM ARZ Archive storage engine metadata Archive storage engine data The database is put into a read only state while these files are copied These files are copied without changes The database is put into a read only state while these files are copied These files are copied without changes backup my cnf Records the configuration parameters that specify the l
253. ompress option backup to image Produces a single file backup rather than a directory structure holding the backup files Requires the backup image option to specify the destination file Can be used to stream the backup to a storage device or another system without ever storing the data on the database server You can specify backup image representing standard output allowing the output to be piped to another command To avoid mixing normal informational messages with backup output the help message errors alerts and normal informational messages are always printed to standard error Example 5 1 Simple Backup with Connection Parameters from Default Configuration File The following example shows a minimal backup with the mysqlbackup command with any necessary connection parameters for the database in the mysqlbackup section of the default MySQL configuration file mysqlbackup backup dir export backups latest backup Example 5 2 Basic Incremental Backup mysqlbackup incremental start lsn 12345 incremental backup dir path to incbackup backup There is a separate directory dedicated to incremental backup Both this directory and the one for full backups can be specified in the my cnf file and the appropriate directory is used depending on the type of backup Both the incremental backup data and an earlier full backup are needed to do a successful restore operation 5 1 1 2 Apply Log Operations for Existing Bac
254. on MySQL 5 1 Install MySQL 5 5 Restore on MySQL 5 5 Run upgrade steps as documented in the MySQL reference manual Check data 56 Chapter 5 mysqlbackup Command Reference Table of Contents 5 1 mysqlbackup Command Line Options oooocoocccnccnccncnnnnnncnccnnnnncnnnnnnanccnnnnnnnnnnnnancennnnnnnnnnnnanrinnancinns 59 51 1 SUDCOMMAMNGS oa 64 5 1 2 Standard Optlons stas td 71 5 1 3 GOMNECHON OPINAS aroma 72 5 1 4 Server Repository Options ccccececeeeeeeeeeae ee eeeeeeeeeeeeaeaaaeaaeeeeeeeeseaaaaaaeeeeeeeseaaaaaaseeseeeees 74 5 1 5 Backup Repository Options ccccceeeeeeeee cece ee eeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaeaaeeeeeeeeseeaeaaaaneeeeeees 76 5 1 6 Metadata Optio sois da 79 5 1 7 GOMPFESSION OPTIONS scaricare 79 5 1 8 Incremental Backup Options cccce naiinitan ee ee aa eee tees sees aiana i iaai aaa Aaaa 80 5 1 9 Partial Backup and Restore Options ccccceeeeeeeeeeee ee ae ea eeeeeeeeeeeeaeaaaeneeeeeeeeeaeaaeeneeneeeees 84 5 1 10 Single File Backup Options 0 cc ccceeeeeeeceeeeeeeeeeeeeeeeeaeaaaaaaeeeeeeseaeaaaaaaeeeeeeseaaaaaaaaeeeeeeas 90 5 1 11 Performance Scalability Capacity Options ooooococcncccononnccncnnnoncnnnannnncnnncnncnnnnnnancnnncnnnnnns 92 5 1 12 Message Logging OptiOns s creoia cotorra piata niaan aaan aeaa S K iaaa 98 5 1 13 Progress Report Options ssania anina iA E EEEE 99 51 14 Encryption Options meiosis did bid ais 102 5 1 15 Cloud Storage
255. on options can be used with cloud backup or restoration Currently Amazon S3 is the only cloud service supported by MySQL Enterprise Backup A cloud backup is created using the cloud options for mysqibackup which are described in details in Section 5 1 15 Cloud Storage Options This is a sample command for creating a cloud backup Example 3 17 Creating a Cloud Backup mysqlbackup cloud service s3 cloud aws region lt aws region gt cloud access key id lt aws access key 1d gt cloud secret access key lt aws secret access key gt cloud bucket lt s3 bucket name gt cloud object key lt aws object key gt backup dir home user dba s3backuptmpdir backup image backup to image Besides backup to image all other mysqlbackup operations for single file backups backup dir to image list image validate image to backup dir extract copy back and copy back and apply 10g can also be performed using cloud storage Example 3 18 Extract an Existing Image from Cloud Storage to Backup Directory Extract a backup image from cloud storage using the backup di r option to specify the directory into which the image will be extracted mysqlbackup cloud service s3 cloud aws region lt aws region gt cloud access key id lt aws access key id gt cloud secret access key lt aws secret access key gt cloud bucket lt s3 bucket name gt cloud object key lt aws object key gt
256. oncnncnnnnnnnannnnnancn nono nnanaan nano 135 A 1 Limitations of MySQL Enterprise Backup ooooccccccccccnnonococcnnnononnnonncnccnnnnncnnnnnnanccnncnnnnnns 135 B Compatibility Information for MySQL Enterprise Backup ccocccoconoccconcnncononononaconnnnconcnnnnancnnnanos 139 B 1 Cross Platform Compatibility oooconnnnnnnnnonncncincnncincooncnnccncnnnnnonnnonncncnnnnnnn nono nnancnnnancnnns 139 B 2 Compatibility with MySQL Versions 0ooonoocccccnnccccnnnonocnconnnncnnnnonnnncancnnnonnnnnnanancrnnnnnnnnns 139 B 3 Compatibility with Older MySQL Enterprise Backup 00ooocccccccicccoconccoccnncnccnnnnnnanccncnncnnns 139 B 4 Compatibility Notes for Specific MySQL Versions ooooonocccicccncincnonocnconcnnconononnnncnnnancnnns 139 G Extended Examples cion ad 141 C 1 Sample Directory Structure for Full Backup oocccccoccnnccccnonnccnnnonnnonononnnnnnannnononanannnnns 141 C 2 Sample Directory Structure for Compressed Backup ooccccccccccconococoncnnconcnnnnnncnncnncnncnnns 145 C 3 Sample Directory Structure for Incremental Backup ooooccicccnccccconcccconcnncononononacannancnnns 145 D MySQL Enterprise Backup Release Notes ooocccoconocccccccoconnnonnnaconcnnconononnancnnnanconnnnnnancnncancinns 147 E Licenses for Third Party Component 0 ceceeeeeeeeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaaaaeeneeeeeeeeeaeaaea 149 El CURL ibc rl LIC6nSe iia talca 149 E 2 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exceptio
257. one of the original database in another location typically to run report queries or to create a new replication slave This section describes the procedures to handle those various scenarios After a serious database issue you might need to perform a recovery under severe time pressure It is critical to confirm in advance e How long the recovery will take including any steps to transfer unpack and otherwise process the data That you have practiced and documented all steps of the recovery process so that you can do it correctly in one try If a hardware issue requires restoring the data to a different server verify all privileges storage capacity and so on on that server ahead of time That you have periodically verified the accuracy and completeness of the backup data so that the system will be up and running properly after being recovered 4 1 Preparing the Backup to be Restored Immediately after the backup job completes the backup files might not be in a consistent state because data could be inserted updated or deleted while the backup is running These initial backup files are known as the raw backup You must update the backup files so that they reflect the state of the database corresponding to a specific InnoDB log sequence number The same kind of operation as crash recovery When this step is complete these final files are known as the prepared backup During the backup mysqlbackup copies the accumulated In
258. options to perform a restore operation are copy back and copy back and apply log The restoration process requires the database server to be already shut down except for restorations of backups created with the use tts option see explanations below The process copies the data files logs and other backed up files from the backup directory back to their original locations and performs any required post processing on them For any restore operation the options datadi r innodb_log_files_in_group innodb_log_file_size and innodb_data_file_path must be specified either in the target server s configuration file in the file specified by the defaults file option or as command line options Example 4 4 Shutting Down and Restoring a Database 50 Performing a Restore Operation mysqladmin user root password shutdown mysqlbackup defaults file usr local mysql my cnf backup dir export backups full copy back Backup records details of each backup Restoring this table to its earlier state removes information about any subsequent backups that you did This is the correct starting point for future incremental backups particularly those using the incremental base option Note Y The restored data includes the backup_history table where MySQL Enterprise Important A When performing a full restore for example when the backup data is used to set up a new MySQL server or used to replace all data of an existing MySQ
259. ot needed when doing an offline cold backup which works directly on the files using OS level file permissions Path to MySQL data directory MySQL configuration file or mysqld startup script Used to retrieve files from the database instance during backup operations and to copy files back to the database instance during restore operations Automatically retrieved from database connection for hot and warm backups Taken from MySQL configuration file for cold backups ID and password of privileged MySQL user You record this during installation of your own databases or get it from the DBA when backing up databases you do not own Not needed when doing an offline cold backup which works directly on the files using OS level file permissions For cold backups you log in as an administrative user Specified via the password option of the mysqlbackup Prompted from the terminal if the password option is present without the password argument Path under which to store backup data You choose this See Section 3 1 3 Designate a Location for Backup Data for details By default this directory must be empty for mysqlbackup to write data into it to avoid overwriting old backups or mixing up data from different backups Use the with timestamp option to automatically create a subdirectory with a unique name when storing multiple sets of backup data under the same main directory Owner
260. oth the raw performance how long it takes the backup to complete and the amount of overhead on the database server When measuring backup performance consider e The limits imposed by your backup procedures For example if you take a backup every 8 hours the backup must take less than 8 hours to finish The limits imposed by your network and storage infrastructure For example if you need to fit many backups on a particular storage device you might use compressed backups even if that made the backup process slower The tradeoff between backup time and restore time You might choose a set of options resulting in a slightly slower backup if those options enable the restore to be much faster See Section 7 2 Optimizing Restore Performance for performance information for the restore process Full or Incremental Backup After taking a full backup subsequent backups can be performed more quickly by doing incremental backups where only the changed data is backed up For an incremental backup specify the incremental or incremental with redo 1og on1y option to mysq1backup See Section 5 1 8 Incremental Backup Options for information about these options For usage instructions for the backup and apply stages of incremental backups see Section 3 3 2 Making an Incremental Backup and Example 4 3 Applying an Incremental Backup to a Full Backup Compressed Backup Compressing the backup data before transmitt
261. ow an error This option is not compatible with the only innodb or only innodb with frm options suspend at end This option pauses the mysqlbackup command when the backup procedure is close to ending It creates a file called ibbackup_suspended in the backup log group home directory and waits until you delete that file before proceeding This option is useful to customize locking behavior and backup of non InnoDB files through custom scripting All tables are locked before suspending putting the database into a read only state unless you turn off locking with the no locking or no connection option The only innodb and only innodb with frm options also prevent the locking step Because locking all tables could be problematic on a busy server you might use a combination of only innodb and suspend at end to back up only certain non InnoDB tables xec when locked utilityargl arg2 Command Line Format xec when locked utility argl arg2 a Permitted Values Type string You can use this option to run a script that backs up any information that is not included as part of the usual backup For example with xec when locked you can use mysqldump to back up tables from the MEMORY storage engine which are not on disk Set any variable you want to use within your script before you run mysqlbackup In the following example the BACKUP_DIR environment variable is set to point to the current b
262. p before applying log use tts Enable selective backup of InnoDB tables using transportable tablespaces TTS user Database user name to connect verbose Print more verbose information version Display version information with timestamp write threads Create a subdirectory underneath the backup directory with a name formed from the timestamp of the backup operation Specifies the number of write threads for the backup operation 63 Subcommands 5 1 1 Subcommands These options represent the major operations or modes for the mysq1backup command Only one can be specified for each mysqlbackup invocation and the name is not preceded by any dashes Each of these major options has its own set of required or allowed command parameters For example the backup options require connection information to the database server The apply 1log and other options that operate on the backup data after it is produced require options to specify where the backup data is located The major groups of subcommands are e Backup operations backup backup and apply log backup to image Apply operations apply log apply incremental backup e Restore operations copy back copy back and apply log e Validation operation validate Single file backup operations image to backup dir backup dir to image list image extract 5 1 1 1 Backup Operations The backup operations are the mos
263. p dir backup tmp backup to image Example 3 4 Single File Backup to Relative Path This command specifies backup image with a relative path underneath the backup directory The resulting single file backup is created as backups sales mbi mysqlbackup backup image sales mbi backup dir backups backup to image Example 3 5 Single File Backup to Standard Output The following command dumps the backup output to standard output Again the backup di r directory specified in my cnf is used as a temporary directory mysqlbackup backup dir backups backup image backup to image gt backup mybackup mbi Example 3 6 Convert Existing Backup Directory to Single Image The backup di r directory specified in my cnf is bundled into the backup my mbi file The directory can contain anything not necessarily a backup produced by MySQL Enterprise Backup mysqlbackup backup image backup my mbi backup dir var mysql backup backup dir to image 41 Making a Single File Backup Example 3 7 Extract Existing Image to Backup Directory The image contents are unpacked into backup dir mysqlbackup backup dir var backup backup image backup my mbi image to backup dir Example 3 8 List Single File Backup Contents The image contents are listed with each line indicating a file or directory entry mysqlbackup backup image backup my mbi list image Example 3 9 Extract Single File Backup into Current Directory The following command
264. page_size SIZE Specifies the page size for all InnoDB tablespaces Typically you do not need to specify this option because its value is retrieved automatically using the database connection If no database connection is available you must specify it 75 Backup Repository Options When a database connection exists the value is retrieved automatically and overrides any value you specify e innodb_checksum_algorithm NAME Specifies the name of the checksum algorithm used for validating InnoDB tablespaces Default is innodb Typically you do not need to specify this option because its value is retrieved automatically using the database connection If no database connection is available you must specify it When a database connection exists the value is retrieved automatically and overrides any value you specify 5 1 5 Backup Repository Options These options specify various parameters related to the layout of the backup directory The backup dir option is the only one from this group that you typically specify Values for all the backup_innodb_ options can be derived automatically from the corresponding configuration options without the backup_ prefix See descriptions for individual options below Those options need to be specified only if during a backup the user wants to specify particular values for those options that are to be used during restorations of the backup Values specified by backup_innodb_ options are s
265. pecified by those other options See Section 7 1 Optimizing Backup Performance and Section 7 2 Optimizing Restore Performance for additional advice about recommended combinations of values for this and other performance related options for various hardware configurations such as RAID or non RAID storage devices read threads num_threads 92 Performance Scalability Capacity Options Command Line Format read threads NUMBER Permitted Values Type numeric Default 1 Min 1 Value Max 15 Value Specifies the number of threads to use for reading data from disk Default currently 1 This default applies to these kinds of operations copy back extract and backup If you specify a value of 0 it is silently adjusted to 1 The maximum is 15 if you supply a negative value it is silently adjusted to 15 For app1y 10g operations the number of read threads is always 1 regardless of this option setting See Section 7 1 Optimizing Backup Performance and Section 7 2 Optimizing Restore Performance for advice about recommended combinations of values for read threads process threads and write threads for various hardware configurations such as RAID or non RAID storage devices process threads num_threads Command Line Format process threads NUMBER Permitted Values Type numeric Default 6 Min 1 Value Max 15 Value Specifies th
266. ppl1y 10g option as in the previous example the backup data is fully consistent and ready to verify If you only ran the first stage by using the backup option run mysqlbackup a second time with the apply log option before doing this verification Typically you run this second phase on the other server after transferring the backup data there to minimize the load on the original database server See Chapter 4 Recovering or Restoring a Database for the procedure to restore the database files ona different server Running the mysqid daemon on the restored data requires a valid configuration file which you specify with the defaults file option of the mysqld command You can reuse most of the settings from the original my cnf file combined with the backup my cnf file in the backup directory which contains only the small subset of parameters required by mysqibackup Create a new configuration file by concatenating those two files into a new one and use that configuration file on the server where you do the verification Edit the resulting file to make sure the datadi r parameter points to the right location on the verification server directory Edit the values for port socket and so on if you need to use different connection settings on the verification server 3 2 3 Restoring a Database at its Original Location To restore a MySQL instance from a backup Shut down the database server using your usual technique such as the command mysq
267. pplicable only for backup operations not restore 76 Backup Repository Options For the backup operations such as backup backup and apply log backup to image the value of the backup destination directory is derived as follows e If backup_innodb_data_home_dir is not specified it inherits the value of backup di r e If backup_innodb_data_home_dir is a relative path that path is located relative to that is underneath the backup di r value e An backup_innodb_data_home_dir of refers to the root directory e If backup_innodb_data_home_dir is an absolute path its value is used as is To make it easy to relocate the backup directory and avoid editing the backup my cnf file the backup operation writes this value into backup my cnf only if it is different than the backup di r value and using a relative path if possible For backup to image operations the final value of the backup_innodb_data_home_dir option must be a relative path so that the single file backup is machine independent backup_innodb_data_file_path VALUE Specifies InnoDB data file names and sizes Examples ibdatal 32M ibdata2 32M autoextend abs path ibdatal 32M autoextend innodb dir ibdatal 32M autoextend This parameter together with backup_innodb_data_home_dir determines where the InnoDB data files such as ibdatal ibdata live in the backup repository Within the backup directory any data files specified with relative paths are
268. pplications and web sites operating and responsive while the backup is in progress Hot backups are performed while the database is running This type of backup does not block normal database operations It captures even changes that occur while the backup is happening For these reasons hot backups are desirable when your database grows up when the data is large enough that the backup takes significant time and when your data is important enough to your business so that you must capture every last change without taking your application web site or web service offline MySQL Enterprise Backup does a hot backup of all InnoDB tables MyISAM and other non InnoDB tables are backed up last using the warm backup technique the database continues to run but the system is in a read only state during that phase of the backup You can also perform cold backups while the database is stopped To avoid service disruption you would typically perform such a backup from a replication slave which can be stopped without taking down the entire application or web site Points to Remember Points to Remember To back up as much data as possible during the hot backup phase you can designate InnoDB as the default storage engine for new tables or convert existing tables to use the InnoDB storage engine In MySQL 5 5 and higher InnoDB is now the default storage engine for new tables During hot and warm backups information about the structure
269. ption 7 incremental with redo log only Specifies an alternative form of incremental backup for a backup or backup to image operation Also requires either the incremental base option or the combination of the start 1sn and incremental backup dir options The incremental backup performed by this option has different performance characteristics and operational limitations than with the incremental option e The changes to InnoDB tables are determined based on the contents of the InnoDB redo log Since the redo log files have a fixed size that you know in advance it can require less I O to read the changes from them than to scan the InnoDB tablespace files to locate the changed pages depending on the size of your database amount of DML activity and size of the redo log files e Since the redo log files act as a circular buffer with records of older changes being overwritten as new DML operations take place you must take new incremental backups on a predictable schedule that depends on the size of the log files and the amount of redo data generated for your workload Otherwise the redo log might not reach back far enough to record all the changes since the previous incremental backup In this case the mysqlbackup command quickly determines it cannot proceed and returns an error Your backup script can catch the error and do an incremental backup with the incremental option instead options For example To calculat
270. qlbackup Error page at offset 0 3185082368 in sqldata mts ibdatal5 seems corrupt A corruption problem can have different causes Here are some suggestions for dealing with it The problem can occur if the MySQL server is too busy Before trying other solutions you might want to perform the backup again using some non default settings for the following mysq1backup options page reread time MS Try set the value to for example 0 05 for faster rereads during checksum failures page reread count retry_limit Try set the value to for example 1000 to allow more rereads during checksum failures before MySQL Enterprise Backup gives up and throws an error Scrambled data in memory can cause the problem even though the data on disk is actually uncorrupted Reboot the database server and the storage device to see if the problem persists If the problem persists after the database server and the storage device have been restarted you might really have a corruption on your disk You might consider restoring data from an earlier backup and roll forward the recent changes to bring the database back to its current state e If you want to make MySQL Enterprise Backup finish a backup anyway before you go and investigate the root cause of the issue you can rewrite the checksum values on the disk by running the innochecksum utility on the server innochecksum no checksum write crc32 The option no checksum disabl
271. qlbackup command is not the same as the former MySQL Backup open source project from the MySQL 6 0 source tree The MySQL Enterprise Backup product supersedes the MySQL Backup initiative 58 mysqlbackup Command Line Options restrictions o n backups at the same time as DDL operations 5 1 mysqlbackup Command Line Options Schedule backups during periods when no DDL operations involving tables are running See Section A 1 Limitations of MySQL Enterprise Backup for The following sections describe the different modes of operation for mysqibackup and explain in details the applicable options for each of the modes of operation and for different situations The table below list all the command options for mysqlbackup Use the hotlinks at the option names to jump to the detailed descriptions for the options Note Y The command options can also be specified in configuration files see explanations in Section 5 2 Configuration Files and Parameters The mysqlbackup command follows MySQL standard practice for handling duplicate options whether specified in a configuration file on the command line or both Options are processed first from configuration files then from the command line If an option is specified more than once the Table 5 1 List of All Options last instance takes precedence Format backup dir Description The directory to store the backup data Introduced backup ima
272. r e The system tablespace is not backed up saving disk space and I O resources e Data consistency of the tables is managed by MySQL Enterprise Backup However the option has the following limitations e Supports only MySQL version 5 6 and after as earlier versions of MySQL do not support TTS e Can only backup tables that are stored in their own individual tablespaces i e tables created with the innodb_file_per_table option enabled e Cannot back up partitioned tables e Cannot be used for incremental backups Does not include the binary log or the relay log in the backup There are two possible values for the option e with minimum locking Hot copies of the selected tables are backed up and the tables are then locked in read only mode while the redo log with only the portion containing the relevant changes made after the hot backup is being included in the backup Any tables created during the locking phase are ignored e with full locking The selected tables are locked in read only mode while they are being backed up The redo log is not included in the backup Any tables created during the locking phase are ignored 86 Partial Backup and Restore Options Note Y Due to a known issue when creating a backup using TTS for a server containing tables with a mix of the Antelope and Barracuda file formats do NOT apply full locking on the tables Default back up with minimum locking To use the use tts optio
273. rage engine data e CSM CSV storage engine data e CSV CSV storage engine data e frm table definitions e ibd InnoDB tablespace created using the file per table mode e MRG Merge storage engine references to other tables e MYD MyISAM data e MYI MyISAM indexes opt database configuration information e par partition definitions e TRG trigger parameters TRN trigger namespace information only innodb 85 Partial Backup and Restore Options For back up only Back up only InnoDB data and log files All files created by other storage engines are excluded Typically used when no connection to mysqld is allowed or when there is no need to copy MyISAM The option is not compatible with the slave info option Default backups include files from all storage engines use tts with minimum locking with full locking Command Line Format use tts with minimum locking with full locking Permitted Values Type enumeration Default with minimum locking Valid with minimum locking Values with full locking Enable selective backup of InnoDB tables using transportable tablespaces TTS This is to be used in conjunction with the include tables and xclude tables options to select the InnoDB tables to be backed up by regular expressions Using TTS for backups offers the following advantages e Backups can be restored to a different serve
274. rall backup time lt can result in reduced restoration time as well In general we recommend LZ4 compression over no compression for most users as LZ4 based backups often finish in a shorter time period However test out MySQL Enterprise Backup within your environment to determine what is the most efficient approach 3 3 2 Making an Incremental Backup An incremental backup only backs up data that changed since the previous backup This technique provides additional flexibility in designing a backup strategy and reduces required storage for backups 32 Making an Incremental Backup Incremental backups are typically smaller and take less time than a full backup making them a good choice for frequent backup jobs Taking frequent incremental backups ensures you can always restore the database to the same state as a few hours or days in the past without as much load or storage overhead on the database server as taking frequent full backups Note Y Because an incremental backup always adds to an existing set of backup files make at least one full backup before doing any incremental backups Incremental backup is enabled through an option to the mysqlbackup command For straightforward incremental backups specify the incremental option An alternative method uses the incremental with redo log on1ly option requiring additional planning on your part You also indicate the point in time of the previous full or incremental backup
275. rchive and clear out your oldest backup data 3 3 3 Making a Compressed Backup To save disk space you can compress InnoDB backup data files by using the compress option of mysqlbackup Compression lets you keep more sets of backup data on hand and save on transmission time when sending the backup data to another server The downside includes the extra CPU overhead during the backup itself and the extra time needed for the restoration process for uncompressing the data The backup compression feature works only for InnoDB tables After the InnoDB tablespace files are compressed during backup they receive the ibz extension rather than the usual ibd extension To avoid wasting CPU cycles without saving additional disk space compress does not attempt to compress already compressed tables that use the Barracuda file format such tablespace files keep the usual ibd extension 35 Making a Partial Backup copied during an uncompressed backup Perform a compressed backup to avoid Note Y When there is unused space within an InnoDB tablespace file the entire file is the storage overhead for the unused space You can only use the compress option for full backups but not for incremental backups You can also select the compression algorithm to use by the compress method option and when using the ZLIB or LZMA compression algorithm the level of compression by the compress level option See Section 5 1 7 Compre
276. re and documentation may provide access to or information about content products and services from third parties Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third party content products and services unless otherwise set forth in an applicable agreement between you and Oracle Oracle Corporation and its affiliates will not be responsible for any loss costs or damages incurred due to your access to or use of third party content products or services except as set forth in an applicable agreement between you and Oracle Legal Notices Documentation Accessibility For information about Oracle s commitment to accessibility visit the Oracle Accessibility Program website at http www oracle com pls topic lookup ctx acc amp id docacc Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support For information visit http www oracle com pls topic lookup ctx acc amp id info or visit http www oracle com pls topic lookup ctx acc amp id trs if you are hearing impaired This documentation is NOT distributed under a GPL license Use of this documentation is subject to the following terms You may create a printed copy of this documentation solely for your own personal use Conversion to other formats is allowed as long as the actual content is not altered or edited in any way You sh
277. read attempts when a page fails a checksum test A busy server could be writing a page at the same moment that mysq1backup is reading it If the same page fails this many checksum tests consecutively with a pause based on the page reread time option between each attempt the backup fails Default is 500 on disk full abort abort_and_remove warn Command Line Format on disk full option Permitted Values Type enumeration Default abort Valid abort Values a abort_and_remove Specifies the behavior when a backup process encounters a disk full condition This option is only for backup operations backup backup and apply log and backup to image abort Abort backup without removing the backup directory The disk remains full abort_and_remove Abort backup and remove the backup directory e warn Write a warning message every 30 seconds and retry backup until disk space becomes available Default abort skip unused pages 95 Performance Scalability Capacity Options Skip unused pages in tablespaces when backing up InnoDB tables This option is applicable to the backup and backup to image operations but not to incremental backups The option is ignored by the backup and apply log operation Note that backups created with the skip unused pages option cannot be restored using copy back and apply log Unused pages are free pages often caused by bulk
278. reh 2009 Copyright 2009 Free Software Foundation Inc lt http fsf org gt Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed This GCC Runtime Library Exception Exception is an additional permission under section 7 of the GNU General Public License version 3 GPLv3 It applies to a given file the Runtime Library that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception When you use GCC to compile a program GCC may combine portions of certain GCC header files and runtime libraries with the compiled program The purpose of this Exception is to allow compilation of non GPL including proprietary programs to use in this way the header files and runtime libraries covered by this Exception 0 Definitions A file is an Independent Module if it either requires the Runtime Library for execution after a Compilation Process or makes use of an interface provided by the Runtime Library but is not otherwise based on the Runtime Library GCC means a version of the GNU Compiler Collection with or without modifications governed by version 3 or a specified later version of the GNU General Public License GPL with the option of using any subsequent versions published by the FSF GPL compatible Software is software whose conditions of propagation modification and use would pe
279. revent interpretation of shell meta characters Some limitations apply when using the option to select database names or file names that contain special characters spaces dashes periods etc see this description in Appendix A MySQL Enterprise Backup Limitations for details mysqlbackup throws an error when the option is used without a regular expression being supplied with it While the option can be used for different kinds of backups selective restore is only supported for backups created using transportable tablespaces TTS that is backups created with the use tts option The option cannot be used together with the include databases databases list file or only innodb with frm option When used together with the include tables option include tables is applied first meaning mysqlibackup first select all tables specified by include tables and then exclude from the set those tables specified by xclude tables for backup s only known file types For back up only By default all files in the database subdirectories under the data directory of the server are included in the backup see Section 1 4 Files that Are Backed Up for details If the only known file types option is specified mysqlbackup only backs up those types of files that are data files for MySQL or its built in storage engines which have the following extensions e ARM Archive storage engine metadata e ARZ Archive sto
280. rmit combination with GCC in accord with the license of GCC Target Code refers to output from any compiler for a real or virtual target processor architecture in executable form or suitable for input to an assembler loader linker and or execution phase Notwithstanding that Target Code does not include data in any format that is used as a compiler intermediate representation or 160 GNU Standard C Library libstdc License used for producing a compiler intermediate representation The Compilation Process transforms code entirely represented in non intermediate languages designed for human written code and or in Java Virtual Machine byte code into Target Code Thus for example use of source code generators and preprocessors need not be considered part of the Compilation Process since the Compilation Process can be understood as starting with the output of the generators or preprocessors A Compilation Process is Eligible if it is done using GCC alone or with other GPL compatible software or if it is done without using any work based on GCC For example using non GPL compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process 1 Grant of Additional Permission You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules even if such propagation would otherwise violate the terms of GPLv
281. roduces a directory structure containing a subset of the files from a full backup All non InnoDB files such as frm MYD and so on are included ibd files are included only if they changed since the full backup that is if their maximum logical sequence number is higher than the value specified by the start 1sn option find tmp backups tmp backups tmp backups backup my cnf 145 Sample Directory Structure for Incremental Backup tmp tmp tmp tmp tmp tmp tmp tmp tmp tmp tmp tmp tmp tmp pac pac pac pac pac pac pac pac pac pac pac pac pac pac kups datadir kups datadir ibbackup_ibd_files kups datadir ibbackup_logfile kups datadir ibdatal kups datadir mem kups datadir mem db opt kups datadir mem dc_p_double frm kups datadir mem dc_p_double par kups datadir mem dc_p_long frm kups datadir mem dc_p_long par kups datadir mem dc_p_string frm kups datadir mem dc_p_string par kups datadir mem graph_dc_schedules frm kups datadir mem graph_schedules frm many more files 146 Appendix D MySQL Enterprise Backup Release Notes Release notes for MySQL Enterprise Backup are published separately See MySQL Enterprise Backup 3 11 Release Notes 147 148 Appendix E Licenses for Third Party Components Table of Contents EAlscURE hlocurl License icc wind atti ia aii Aelia een E 2 GNU General Public License Version 3 0 29 June 2007
282. roxy proxy url port Proxy address and port number for overriding the environment s default proxy settings for accessing Amazon S3 Note Y The l1ist image operation can be performed on a cloud backup only if the cloud proxy supports range headers 5 1 16 Options for Special Backup Types These options are for backing up database servers that play specific roles in replication or contain certain kinds of data that require special care in backing up e slave info When backing up a replication slave server this option captures information needed to set up an identical slave server lt creates a file meta ibbackup_slave_info inside the backup directory containing a CHANGE MASTER statement with the binary log position and name of the binary log file of the master server This information is also printed in the mysqibackup output To set up a new slave for this master restore the backup data on another server start a slave server on the backup data and issue a CHANGE MASTER command with the binary log position saved in the ibbackup_slave_info file See Section 6 1 Setting Up a New Replication Slave for instructions 104 Configuration Files and Parameters Note Y Only use this option when backing up a slave server lts behavior is undefined when used on a master or non replication server This option is not compatible with the no 1ocking option using both options together will make mysq1backup thr
283. ry option to put the undo logs outside of the data directory when using the file server my cnf or server all cnf for the defaults file option with copy back or copy back and apply log care should be taken to configure correctly the innodb_undo_directory option in the file Otherwise the data or log files on the original server might be overwritten by accident 5 1 1 4 Validating a Backup To ensure the integrity of the backup data MySQL Enterprise Backup provides a validate subcommand for validating a backup by the checksum values of its data pages after the backup is created or transferred to another system mysqlbackup STD OPTIONS backup dir PATH backup image IMAGE MESSAGE LOGGING OPTIONS PROGRES S REPORT OPTIONS CLOUD STORAGE OPTIONS validate e validate Verifies that a backup is not corrupted truncated or damaged This operation validates the checksum value for each data page in a backup To avoid spending excessive time and resources on files that are too heavily corrupted mysqlbackup stops validating a ibd file after more than twenty corrupted pages are found in it and proceeds to the next file instead In that case the operation s summary will not give a full count of corrupted pages but only says at least 20 pages are corrupted The operation also has the following limitations e For any backup directory the operation can only validate the InnoDB data files ibdata and ibd files in
284. s 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 kups 20 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 A A A A A A A A a A a N EN I EN IN N EN A N 7 7 backup my cnf 7 datadir 7 datadir ib_logfile0 7 datadir ib_logfilel 7 datadir ibbackup_logfile 7 datadir ibdatal 7 datadir mem 7 datadir mem db opt 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_doubl 7 datadir mem dc_p_1 7 datadir mem dc_p_1 long 7 datadir mem dc_p_1 7 datadir mem dc_p_1 long 7 datadir mem dc_p_1 7 datadir mem dc_p_1 long ong 7 datadir mem dc_p 7 datadir mem dc_p 7 datadir mem dc_p 7 datadir mem dc_p_1 7 datadir mem dc_p_1 ong ong ong ong ong ong ong 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datadir mem dc_p_ string 7 datad
285. s excludes the two tables in the backup However the suggested workaround does not work for TTS backups therefore do not use TTS if you want to do a partial backup that includes tables with special characters in their names Hot backups for large databases with heavy writing workloads say in the order of gigabytes per minute can take a very long time to complete due to the huge redo log files that are generated on the server when the backup is in progress And if the redo log files grow faster than they can be processed by mysqlbackup the backup operation can actually fail wnen mysqlbackup cannot catch up with the redo log cycles and LSNs get overwritten by the server before they are read by mysqlbackup The problem is intensified when the I O resources available for reading and writing the redo logs are scarce during the backup process However if only a small number of tables of the database are modified frequently the Optimistic Backup feature might alleviate the problem See Section 3 3 6 Making an Optimistic Backup for details Compressed InnoDB tables from MySQL server 5 6 10 and earlier cannot be restored with MySQL Enterprise Backup 3 9 0 or later due to a bug with the InnoDB storage engine see Bug 72851 on the MySQL Bug System The attempt to copy the binary log files from a server into a backup which is the default behavior of MySQL Enterprise Backup since 3 11 0 will cause an incremental backup to fail if the ful
286. s indicators on its operation skip binlog Do not include binary log files during backup or do not 3 11 0 restore binary log files during restore skip messages logdir Disable logging to teelog file skip relaylog Do not include relay log files during backup or do not 3 11 0 restore relay log files during a restore skip unused pages Skip unused pages in tablespaces when backing up InnoDB tables slave info Capture information needed to set up an identical slave server sleep Time to sleep in milliseconds after copying each 1MB of data socket Socket file to use to connect src entry Identifies a file or directory to extract from a single file backup ssl Enable SSL for connection automatically enabled with other ssl flags ssl ca CA file in PEM format implies ssl ssl capath CA directory check OpenSSL docs implies ssl ssl cert X509 cert in PEM format implies ssl ssl cipher SSL cipher to use implies ssl ssl key X509 key in PEM format implies ssl ssl verify server cert Verify server s Common Name in its cert against hostname used when connecting Start Isn suspend at end Specifies the highest LSN value included in a previous backup Pauses the mysqlbackup command when the backup procedure is close to ending trace 72 Trace level of messages by mysqlbackup uncompress Uncompress the compressed backu
287. s prohibiting or restricting circumvention of such measures When you convey a covered work you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work and you disclaim any intention to limit operation or modification of the work as a means of enforcing against the work s users your or third parties legal rights to forbid circumvention of technological measures 4 Conveying Verbatim Copies You may convey verbatim copies of the Program s source code as you receive it in any medium provided that you conspicuously and 152 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 appropriately publish on each copy an appropriate copyright notice keep intact all notices stating that this License and any non permissive terms added in accord with section 7 apply to the code keep intact all notices of the absence of any warranty and give all recipients a copy of this License along with the Program You may charge any price or no price for each copy that you convey and you may offer support or warranty protection for a fee 5 Conveying Modified Source Versions You may convey a work based on the Program or the modifications to produce it from the Program in the form of source code under the terms of section 4 provided that you als
288. s to the user To set up a system cron job which is owned and run by root create a file under the etc cron d folder and put into it a similar crontab entry as the one above adding the user root in the following example before the mysqlbackup command daily root path to mysqlbackup mysqlbackup uroot backup dir path to backup folder cronbackups with Check your platform s documentation on further details on the different ways to set up cron jobs for various types of schedules For Windows platforms Use the Task Scheduler for the purpose Check the documentation for you Windows platform for instructions 47 48 Chapter 4 Recovering or Restoring a Database Table of Contents 4 1 Preparing the Backup to be Restored c ccceceeeceee eee eeeeeeeeeeeeeeaaeeeeeeeeeeeeaeaaaaeeeeeeeeeeaeaaaaeeeseeees 49 4 2 Performing a Restore Operation cccccececeeeeeeeeeeeee ae aa eeee cesses ae aaa eeeeeeeeeeaeaaeaeeeeeeeeeaeaaaaneeeeeees 50 4 3 Point in Time Recovery from a Hot Backup 0 cccececeeeeeeeeeeeee cece aa ee teeeeeeeeeaeaaeaeeceeeeeeeaeaaaaneneeeees 53 4 4 Backing Up and Restoring a Single ibd File ccc cece ceeeeeee cece eeeeeeee sees nono nnnncn cra nnn cnn nnnnnancnnn 54 4 5 Restoring a Backup with a Database Upgrade or Downgrade ooccccococccoccnncccnnnnnccnnnnnncnnnnnnncnnnnnnnens 55 The ultimate purpose of backup data is to help recover from a database issue or to create a cl
289. same purpose Repeat the step with other incremental backup images that you have until the data has been restored to a desired point in time Alternatively you can bring your full backup up to date with your incremental backup First apply to the full backup any changes that occurred while the backup was running mysqlbackup backup dir full backup 2010 12 08_17 14 11 apply log gt many lines of output 101208 17 15 10 mysqlbackup Full backup prepared for recovery successfully 101208 17 15 10 mysqlbackup mysqlbackup completed OK Then we apply the changes from the incremental backup mysqlbackup incremental backup dir incr backup 2010 12 08_17 14 48 backup dir full backup 2010 12 08_17 14 11 apply incremental backup many lines of output 101208 17 15 12 mysqlbackup mysqlbackup completed OK Now the data files in the full backup directory are fully up to date as of the time of the last incremental backup You can keep updating it with more incremental backups so it is ready to be restored anytime See Section 3 3 2 Making an Incremental Backup and Section 5 1 8 Incremental Backup Options for more details on incremental backups Example 4 8 Restoring Selected Tables from a TTS Backup Selected tables can be restored from a backup created with transportable tablespaces TTS that is a backup created with the use tts option using the include tables and xclude tables options The
290. sented by ibd files created in the innodb_file_per_table mode Incremental backups are faster than full backups save storage space on the database server and save on network traffic to transfer the backup data on a different server Incremental backup requires additional processing to make the backup ready to restore which you can perform on a different system to minimize CPU overhead on the database server Files that Are Backed Up e Compressed backups save on storage space for InnoDB tables and network traffic to transfer the backup data on a different server They do impose more CPU overhead than uncompressed backups During restore you need the compressed and uncompressed data at the same time so take into account this additional storage space and the time to uncompress the data In addition to compressing data within InnoDB tables compressed backups also skip unused space within InnoDB tablespace files Uncompressed backups include this unused space e When space is limited or you have a storage device such as tape that is cheap large but also slow the performance and space considerations are different Rather than aiming for the fastest possible backup you want to avoid storing an intermediate copy of the backup data on the database server MySQL Enterprise Backup can produce a single file backup and stream that file directly to the other server or device Since the backup data is never saved to the local system you avoid th
291. sing the backup image parameter with the prefix sbt in front of the filename and optionally pass other sbt parameters to the mysqlbackup command to control various aspects of the SBT processing The sbt options are listed in Section 5 1 10 Single File Backup Options On the OSB side you can schedule MySQL Enterprise Backup jobs by specifying a configurable command that calls mysqlbackup You control OSB features such as encryption by defining a storage selector that applies those features to a particular backup and passing the name of the storage selector to OSB using the MySQL Enterprise Backup parameter sbt database name storage_selector To back up MySQL data to tape e Specify the backup image sbt name parameter of the mysq1backup command to uniquely identify the backup data The sbt prefix sends the backup data to the MMS rather than a local file and the remainder of the argument value is used as the unique backup name within the MMS Specify the sbt database name parameter of the mysqlbackup command to enable the OSB operator to configure a storage selector for backups from this MySQL source This parameter refers to a storage selector defined by the OSB operator not to any MySQL database name By default mysqlbackup supplies a value of MySQL for this MMS parameter The argument to this option is limited to 8 bytes If you have multiple media management programs installed to select
292. sive or non permissive may be stated in the form of a separately written license or stated as exceptions the above requirements apply either way 8 Termination You may not propagate or modify a covered work except as expressly provided under this License Any attempt otherwise to propagate or modify it is void and will automatically terminate your rights under this License including any patent licenses granted under the third paragraph of section 11 However if you cease all violation of this License then your license from a particular copyright holder is reinstated a provisionally unless and until the copyright holder explicitly and finally terminates your license and b permanently if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation Moreover your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means this is the first time you have received notice of violation of this License for any work from that copyright holder and you cure the violation prior to 30 days after your receipt of the notice Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License If your rights have been terminated and not permanently reinstated you do not qualify to receive new licenses for th
293. sql as part of the backup data This file contains a SQL statement that sets the GTID_PURGED configuration option Execute this file using the mysql command line after restoring the backup data on a slave server Optionally you can uncomment the CHANGE MASTER command in this file and add any needed authentication parameters to it before running it through mysql e For servers not using GTIDs you can use the slave info option as before then edit and execute the ibbackup_slave_info file afterward 6 1 Setting Up a New Replication Slave If you use MySQL replication MySQL Enterprise Backup allows you to set up a slave database without stopping the master by backing up the master and restoring that backup on a new slave server 1 Take the backup transfer it to the slave server use mysqlbackup with the app1y 10g option to prepare it and put the restored backup and the log files in the right directories for the new slave 2 Edit the my cnf file of the new slave and put skip slave start and event_scheduler off under the mysqld section 3 Start the new slave mysqld version gt 5 1 It prints the latest MySQL binary log position the backup knows of InnoDB Last MySQL binlog file position 0 128760128 file name hundin bin 006 Note that InnoDB only stores the binary log position information to its tablespace at a transaction commit To make InnoDB aware of the current binary log position you must run at least one transact
294. srepresented as being the original software Since few users ever read sources credits must appear in the documentation 4 This notice may not be removed or altered E 10 RFC 3174 US Secure Hash Algorithm 1 SHA1 License The following software may be included in this product RFC 3174 US Secure Hash Algorithm 1 SHA1 RFC 3174 US Secure Hash Algorithm 1 SHA1 Copyright C The Internet Society 2001 All Rights Reserved This document and translations of it may be copied and furnished to others and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared copied published and distributed in whole or in part without restriction of any kind provided that the above copyright notice and this paragraph are included on all such copies and derivative works However this document itself may not be modified in any way such as by removing the copyright notice or references to the Internet Society or other Internet organizations except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed or as required to translate it into languages other than English The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns This document and the information contained herein is provided on an AS IS basis and TH
295. ss overhead than the traditional incremental backup method The result could depend on the size of your data amount of DML activity and size of your redo log files do your testing on a server with a realistic data volume and running a realistic workload For example if you have huge redo log files reading them in the course of an incremental backup could take as long as reading the InnoDB data files using the traditional incremental technique Conversely if your data volume is large reading all the data files to find the few changed pages could be less efficient than processing the much smaller redo log files As with the incremental option the incremental aspect applies only to InnoDB tables By default all non InnoDB and frm files are also included in incremental backup To exclude non InnoDB data in an incremental backup use the on1y innodb option incremental base mode argument Command Line Format incremental base mode argument Permitted Values Type string With this option the mysqlbackup retrieves the information needed to perform incremental backups from the metadata inside the backup directory rather than from the start 1sn option lt saves you from having to specify an ever changing unpredictable LSN value when doing a succession of incremental backups Instead you specify a way to locate the previous backup directory through the combination of mode and argument in the option syntax
296. ssion Options for details This is a sample command for making a compressed backup mysqlbackup defaults file etc my cnf compress compress level 5 backup This is a Sample command for making a compressed single file backup mysqlbackup defaults file etc my cnf compress compress level 5 backup image backup img backup to image Next steps e Make a note of the LSN value in the message at the end of both the full and incremental backups for example in the line mysqlbackup Was able to parse the log up to lsn LSN_number You specify this value when performing incremental backups of changes that occur after this full backup e Apply the log to the compressed backup files so that the full backup is ready to be restored at any time You can move the backup data to a different server first to avoid the CPU and I O overhead of performing this operation on the database server After applying the log periodically take incremental backups which are smaller and can be made faster than a full backup 3 3 4 Making a Partial Backup Note Y To facilitate the creation of partial backups MySQL Enterprise Backup 3 10 introduces two new options for partial backup include tables and xclude tables The new options are intended for replacing the older options of include databases databases list file and only innodb with frm which are incompatible with the new options and will be deprecated in the upcoming re
297. st0O frm ibtest09 ibd ibtestllc frm We run mysqlbackup with the compress and include options mysqlbackup defaults file home pekka my cnf compress include alex blob only innodb backup many lines of output mysqlbackup Scanned log up to isn 2666737471 mysqlbackup Was able to parse the log up to lsn 2666737471 mysqlbackup Maximum page number for a log record 0 mysqlbackup Compressed 147 MB of data files to 15 MB compression 89 101208 17 18 04 mysqlbackup Full backup completed The backup directory for the database test is shown below The bz files are compressed per table data files ls sqldata backup test alexl ibz alex2 ibz alex3 ibz blobts ibz 40 Making a Single File Backup The databases and databases 1ist file options of the mysqlbackup command let you back up non InnoDB tables only from selected databases rather than across the entire MySQL instance To filter InnoDB tables use the include option instead With databases you specify a space separated list of database names with the entire list enclosed in double quotation marks With databases 1list file you specify the path of a file containing the list of database names one per line Some or all of the database names can be qualified with table names to only back up selected non InnoDB tables from those databases If you specify this option make sure you include the same set of databases
298. stance This uses the only known file types option Achieving a multiple of selection effects by using a combination of the above mentioned options e Backing up a selection of InnoDB tables using transportable tablespaces TTS This uses the use tts and the include tables or xclude tables or both options For syntax details on all the options involved see Section 5 1 9 Partial Backup and Restore Options Important A Typically a partial backup is more difficult to restore than a full backup because the backup data might not include the necessary interrelated pieces to constitute a complete MySQL instance In particular InnoDB tables have internal IDs and other data values that can only be restored to the same instance not a different MySQL server Always fully test the recovery procedure for any partial backups to understand the relevant procedures and restrictions Important all databases in an instance restoring a partial backup on a server that includes other databases could cause the system to lose track of those InnoDB tables in other databases Always restore partial backups on a fresh MySQL server instance A Because the InnoDB system tablespace holds metadata about InnoDB tables from without any other InnoDB tables that you want to preserve The following are some command samples for partial backups Including all tables with names starting with emp into the backup mysqlbackup host l
299. stored ooccccconnccccconcccnnnnnnccnnnnnnccnnnnnncnnnonanerannnnnrrnnnnanns 49 4 2 Performing a Restore Operation c cccceeeeeeceeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaeaaeeneeeeeeeeeaeaaea 50 4 3 Point in Time Recovery from a Hot Backup ooooccccconcccccncnnccnnnnnnccnnnnancnnnnnnncnnnnnnncrnnnnnnens 53 4 4 Backing Up and Restoring a Single ibd File oooooocoonnonncccinnnnccccconccnconnancnnnnnnnancancancnnns 54 4 5 Restoring a Backup with a Database Upgrade or Downgrade ooocccccoccccccnccccnccnnncnnccnnns 55 5 mysalbackup Command Reference cococococccccccnconcnnnnnnnnncnncnnnonnnnnannennnnnnnnnnnnanrnn ran cnnnnnnnanenncans 57 5 1 mysqlbackup Command Line Options ooooocooococcccccnncnncnnnonacancnnnnccnnnonnanccnnan cono nnnnanannnnnos 59 DA Ai SUBDCOMMANAS il pa eae aan ae ee 64 5 1 2 Standard Opuons iii etter a ae a be a ae 71 5 1 3 Connection Options issii reptere irekia tea iiano ideu eiki na tae adate dima uued kateta 72 5 1 4 Server Repository Options 0ooccccccccccccononaccncnncononnnnancnnnnncnnonnnnanannran cono nnnnanannnnns 74 5 1 5 Backup Repository Options ccccceeeeeeeeeeeee ee eaeeeeeeeeeeeeaeaaeaeeeeeeeeeaeaaaaeeeeeees 76 5 1 6 Metadata Options anene int A ae eee 79 5 1 7 Compression OPTIONS ccceeece ee ceeeeeeeeeeeee ee ae eae eeeeeeeeeeaeaaaaeeeeeeeeeeeaaaaeeneeeeeeees 79 5 1 8 Incremental Backup Options 0ccceeeeeee eee eeeeeeeeeeeeee ae aaeaeeeeeeeeeeeaaaaeeneeseeee
300. t frequently performed tasks by MySQL Enterprise Backup Various kinds of backups can be performed by adding different options like using compress or incremental for compressed or incremental backups Here is the syntax for the mysqlbackup command for performing a backup operation mysqlbackup STD OPTIONS CONNECTION OPTIONS SERVER REPOSTTORY OPTIONS BACKUP REPOSITORY OPTIONS METADATA OPTIONS COMPRESSION OPTIONS SPECIAL BACKUP TYPES OPTIONS INCREMENTAL BACKUP OPTIONS PARTIAL BACKUP RESTORE OPTIONS SINGLE F ILE BACKUP OPTIONS PERFORMANCE SCALABILITY CAPACITY OPTIONS MESSAGE LOGGING OPTIONS PROGRESS REPORT OPTIONS backup backup and apply 1og mysqlbackup STD OPTIONS CONNECTION OPTIONS SERVER REPOSTTORY OPTIONS BACKUP REPOSITORY OPTIONS METADATA OPTIONS COMPRESSION OPTIONS SPEC LAL_ BACKUP TYPES OP TIONS INCREMENTAL BACKUP OPTIONS PARTIAL BACKUP RESTORE OPTIONS SINGLE FTLE BACKUP OPTIONS PERFORMANCE SCALABILITY CAPACITY OPTIONS MESSAGE LOGGING OPTIONS PROGRESS REPORT 0OPTIONS ENCRYPTION OPTIONS CLOUD STORAGE OPTIONS backup to image 64 Subcommands backup Performs the initial phase of a backup The second phase is performed later by running mysqlbackup again with the apply log option backup and apply log A combination of backup and apply log Not compatible with incremental backups Also incompatible with the c
301. t the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation Silicon Graphics makes no representations about the suitability of this software for any 161 Google Controlling Master Thread I O Rate Patch License purpose warranty shared_count hpp It is provided as is without express or implied Copyright c 2001 2002 2003 Peter Dimov and Multi Media Ltd shared_ptr hpp Copyright C 1998 1999 Greg Colvin and Beman Dawes Copyright C 2001 2002 2003 Peter Dimov weak_ptr hpp Copyright C 2001 2002 2003 Peter Dimov enable_shared_from_this hpp Copyright C 2002 Peter Dimov Distributed under the Boost Software License Boost Software License Version 1 0 August Permission is hereby granted free of charge organization obtaining a copy of the software Version 1 0 Lely BOOS to any person or and accompanying documentation covered by this license the Software to use reproduce display distribute execute and transmit the Software and to prepare derivative works of the Software and to permit third parties to whom the Software is furnished to do so all subject to the following The copyright notices in the Software and this entire statement including the above license grant this restriction and the following disclaimer must be included in all copies of the Software in whole or in part and all
302. t_explain_data ibd 06 16_10 33 47 datadir mem statement_summaries frm 06 16_10 33 47 datadir mem statement_summaries ibd 06 16_10 33 47 datadir mem statement_summary_data frm 06 16_10 33 47 datadir mem statement_summary_data ibd 06 16_10 33 47 datadir mem system_maps frm 06 16_10 33 47 datadir mem system_maps ibd 06 16_10 33 47 datadir mem tags frm 06 16_10 33 47 datadir mem tags ibd 06 16_10 33 47 datadir mem target_email frm 06 16_10 33 47 datadir mem target_email ibd 06 16_10 33 47 datadir mem user_form_defaults frm 06 16_10 33 47 datadir mem user_form_defaults ibd 06 16_10 33 47 datadir mem user_preferences frm 06 16_10 33 47 datadir mem user_preferences ibd 06 16_10 33 47 datadir mem user_tags frm 06 16_10 33 47 datadir mem user_tags ibd 06 16_10 33 47 datadir mem users frm 06 16_10 33 47 datadir mem users ibd 06 16_10 33 47 datadir mem whats_new_entries frm 06 16_10 33 47 datadir mem whats_new_entries ibd 06 16_10 33 47 datadir mysql 06 16_10 33 47 datadir mysql backup_history CSM 06 16_10 33 47 datadir mysql backup_history Csv 06 16_10 33 47 datadir mysql backup_history frm 06 16_10 33 47 datadir mysql backup_progress CsM 143 Sample Directory Structure for Full Backup Sw SSeS SS SS SS Se SAS ISS SS SAS ASS SSS SSS SSS SSS SSS SS SAS ISS ASS SAS SS SS AS SAS SS SS SS eS 0 33 47 datadir mysql backup_progress CSV 0 33 47 datadir mysql backup_progress frm 0 33 47 datadir
303. tem and so on of the specific operating system if any on which the executable work runs or a compiler used to produce the work or an object code interpreter used to run it The Corresponding Source for a work in object code form means all 151 GNU General Public License Version 3 0 29 June 2007 and GCC Runtime Library Exception Version 3 1 31 March 2009 the source code needed to generate install and for an executable work run the object code and to modify the work including scripts to control those activities However it does not include the work s System Libraries or general purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work For example Corresponding Source includes interface definition files associated with source files for the work and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require such as by intimate data communication or control flow between those subprograms and other parts of the work The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding source The Corresponding Source for a work in source code form is that same work 2 Basic Permissions All rights granted under this License are granted for the term of copyright on the Program and are irrevocable provide
304. th timestamp backup dir export backups backup Or we can include the above options in the configuration file under mysqlbackup and just specify the configuration file 57 and the backup operation mysqlbackup defaults file usr local mysql my cnf backup Or we can specify the configuration file as above but override some of those options on the command line mysqlbackup defaults file usr local mysql my cnf compress user backupadmin password port 18080 backup The user and the password you specify are used to connect to the MySQL server This MySQL user must have certain privileges in the MySQL server as described in Section 3 1 2 Grant MySQL Privileges to Backup Administrator The with timestamp option places the backup in a subdirectory created under the directory you specified above The name of the backup subdirectory is formed from the date and the clock time of the backup run For the meanings of other command line options see Section 5 1 mysqlbackup Command Line Options For information about configuration parameters see Section 5 2 Configuration Files and Parameters Make sure that the user or the cron job running mysqlbackup has the rights to copy files from the MySQL database directories to the backup directory Make sure that your connection timeouts are long enough so that the command can keep the connection to the server open for the duration
305. the algorithms they represent are e 124 LZ4 r109 Out of the three algorithms that are supported this is the most efficient one typically taking the shortest backup and restore times with the lowest CPU cost See Iz4 Extremely Fast Compression algorithm for more details including a comparison with other compression algorithms e 1zma LZMA 9 20 Out of the three supported algorithms this typically provides the highest compression ratio but it is also far more expensive in terms of CPU cost than the other two options Thus we do not recommend this for active systems but only for off hour or inactive databases or where I O rates are extremely low e zlib ZLIB v1 2 3 This is in between the other two supported algorithms in terms of both speed and compression ratio ZLIB was the only compression algorithm available for MySQL Enterprise Backup versions prior to 3 10 Default Iz4 Explicitly specifying a value for the option through a configuration file or command line automatically enables the compress option compress level LEVEL Command Line Format compress level LEVEL Permitted Values Type numeric Default 1 Min 0 Value Max 9 Value Specifies the level of compression ranging from 0 to 9 0 disables compression 1 is fastest compression and 9 is highest and slowest compression The option is only meaningful for compression using the ZLIB
306. the specific SBT library to use specify the sbt 1ib path parameter of the mysqlbackup command If you do not specify the sbt 1ib path parameter mysqlbackup uses the normal operating system paths and environment variables to locate the SBT library which is named 1 ibobk so on Linux and Unix systems and ORASBT DLL on Windows systems When you specify sbt 1ib path you can use a different filename for the library in addition to specifying the path Specify any other product specific settings that are normally controlled by environment variables using the sbt environment option To restore MySQL data from tape 121 Backing Up to Tape with Oracle Secure Backup e Specify the backup image sbt name parameter of the mysqlbackup command as part of the restore operation Use the same name value as during the original backup This single parameter retrieves the appropriate data from the appropriate tape device e Optionally use the sbt 1ib path option using the same values as for the backup operation e Specify any other product specific settings that are normally controlled by environment variables using the sbt environment option For product specific information about Oracle Secure Backup see the Oracle Secure Backup documentation Example 9 1 Sample mysqlbackup Commands Using MySQL Enterprise Backup with Oracle Secure Backup Uses libobk so or ORASBT DLL in standard places mysqlbackup port 3306 protocol t
307. timing and performance Do not run the DDL operations ALTER TABLE TRUNCATE TABLE OPTIMIZE TABLE REPAIR TABLE or RESTORE TABLE while a backup operation is going on The resulting backup might be corrupted The only ALTER TABLE operations that can be safely run in parallel with a backup are those that do not influence the physical representation of records on disk such as changing column names or default column values When statement based binary log format is used on the MySQL server which is the default behavior if you take a backup when there are temporary tables in the database and you use those temporary tables to update or insert into normal tables application of the MySQL binary log to a backup could then fail 135 Limitations of MySQL Enterprise Backup that is you might not be able to roll forward the backup to a particular point in time using the MySQL binary log This is because temporary tables are not copied to the backup as the physical filenames sq1 f rmdo not correspond to the logical table names that MySQL writes to the binary log To avoid the problem use row based or mixed format for the binary log by setting the value for the bin1og format option to ROW or MIXED on the server The engines column in the mysql backup_hi story table does not correctly reflect the storage engines of the backed up databases When saving any tables into the data directory the
308. tion groups with the usual names and a suffix of str disable manifest Disable generation of manifest files for a backup operation dst entry encrypt Used with single file backups to extract a single file or directory to a user specified path Encrypt backup image and write it in an MEB Secure File exclude tables Exclude in backup tables whose names match the regular expression REGEXP exec when locked Execute the specified utility when all tables are locked near the end of the execution force 72 Force overwriting of data log or image files depending on the operation help Display help host Host name to connect 60 mysqlbackup Command Line Options Format Description Introduced include Legacy Backup only those per table innodb data files which match the regular expression REGEXP include tables Include in backup tables which match the regular expression REGEXP incremental Specifies that the associated backup or backup to image operation is incremental incremental backup dir Specifies the location under which to store data from an incremental backup incremental base The specification of base backup for incremental option incremental with redo log only Specifies the incremental backup of InnoDB tables to be based on copying redo log to the backup without including any InnoDB data
309. tions of the MySQL server and related products and components Often referred to by its default file name my cnf on Linux Unix and OS X systems and my ini on Windows systems The MySQL Enterprise Backup stores its default configuration settings in this file under a mysqlbackup section For convenience MySQL Enterprise Backup can also read settings from the client section for configuration options that are common between MySQL Enterprise Backup and other programs that connect to the MySQL server See Also my cnf my ini connection The mechanism used by certain backup operations to communicate with a running MySQL server For example the mysqlbackup command can log into the server being backed up to insert and update data in the progress table and the history table A hot backup typically uses a database connection for convenience but can proceed anyway if the connection is not available A warm backup always uses a database connection because it must put the server into a read only state A cold backup is taken while the MySQL server is shut down and so cannot use any features that require a connection See Also cold backup history table hot backup progress table server warm backup crash recovery The cleanup activities for InnoDB tables that occur when MySQL is started again after a crash Changes that were committed before the crash but not yet written to the tablespace files are reconstructed from the doublewrite buffer W
310. to the entire Program shall be treated as though they were included in this License to the extent that they are valid under applicable law If additional permissions apply only to part of the Program that part may be used separately under those permissions but the entire Program remains governed by this License without regard to the additional permissions When you convey a copy of a covered work you may at your option remove any additional permissions from that copy or from any part CAMA Additional permissions may be written to require their own removal in certain cases when you modify the work You may place additional permissions on material added by you to a covered work for which you have or can give appropriate copyright permission Notwithstanding any other provision of this License for material you add to a covered work you may if authorized by the copyright holders of that material supplement the terms of this License with terms a Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License or b Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it or c Prohibiting misrepresentation of the origin of that material or requiring that modified versions of such material be marked in reasonable ways as different from the original version or d Limiting the
311. tored in the backup_my cnf file to be used during future restorations When a database connection is available during a backup those backup_innodb_ options are ignored with their values overridden by the corresponding values retrieved from the database connection These options are used only with the following operations e Backup creation operations backup backup and apply log backup to image e Restore operations copy back copy back and apply 1log The following parameters describe the layout of files in the backup directory backup_dir PATH Same as backup di r The directory under which to store the backup data This is a crucial parameter required for most kinds of backup operations lt cannot be a subdirectory of the directory specified by datadir An additional level of subdirectory is created when the with timestamp option is also specified Also when restoring a single file backup with copy back and apply log backup di r is used for supplying the location of a folder that will be used for storing temporary files produced during the restoration process e backup_innodb_data_home_dir PATH Specifies the directory where backup InnoDB data files live Usually same as backup di r but can be different This parameter together with backup_innodb_data_file_path determines where the InnoDB data files such as ibdatal ibdata2 are stored inside the backup directory structure This parameter is a
312. tten offer to provide the Corresponding Source This alternative is allowed only occasionally and noncommercially and only if you received the object code with such an offer in accord with subsection 6b d Convey the object code by offering access from a designated place gratis or for a charge and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge You need not require recipients to copy the Corresponding Source along with the object code If the place to copy the object code is a network server the Corresponding Source may be on a different server operated by you or a third party that supports equivalent copying facilities provided you maintain clear directions next to the object code saying where to find the Corresponding Source Regardless of what server hosts the Corresponding Source you remain obligated to ensure that it is available for as long as needed to satisfy these requirements e Convey the object code using peer to peer transmission provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d A separable portion of the object code whose source code is excluded from the Corresponding Source as a System Library need not be included in conveying the object code work A User Product is either 1 a consumer product which means any tangible persona
313. u can either store the single file backup directly on the remote system or invoke mysqlbackup with the image to backup dir option on the other end to reproduce the directory structure of a regular backup Example 3 14 Single File Backup to a Remote Host The following command streams the backup as a sinlge file output to a remote host where it may be saved directly to a tape device backup dir tmp designates the directory for storing temporary files rather than the final output file mysqlbackup backup image backup dir tmp backup to image ssh user host command argl arg2 For simplicity all the connection and other necessary options are assumed to be specified in the default configuration file To have the desired operations run on the remote system substitute the combination of command device and so on that you use as part of your normal archiving procedure such as dd or tar Example 3 15 Single file Backup to a Remote MySQL Server The following command streams the backup as a single backup file to be restored on a remote MySQL server mysqlbackup backup dir backup backup image compress backup to image ssh lt user name gt lt remote host name gt mysqlbackup backup dir backup_tmp datadir data innodb_log_group_home_dir innodb_log_files_in_group lt innodb_log_files_in_group_of_backedup_server gt innodb_log_file_size lt innodb_log_file_size_of_backedup_server gt innodb_
314. uct Google SMP Patch Google SMP patch Copyright c 2008 Google Inc All rights reserved Redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions AICS Whe s Redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution Neither the name of the Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT NCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE DATA OR PROFITS OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF
315. up See Section B 1 Cross Platform Compatibility for details 130 Part lll Appendixes Table of Contents A MySQL Enterprise Backup Limitations ccceceeeeeee eee eeeeeeeeeeee ee ae aaa neeeeeeeeeaeaaeaaeeeeeeeeeaeaaaaenees 135 A 1 Limitations of MySQL Enterprise Backup ccccceeeeeeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeaaaaeeeeeeeeees 135 B Compatibility Information for MySQL Enterprise Backup ccccceeeeeeeeeeeeeeeeeaaeeteeeeeeeeeaeaaeaeeeeeees 139 B 1 Cross Platform Compatibility 2 0 0 0 ccc cceceeeee cece eeeeeeeeee ee ee aa eae eeeeeeeeeeaaaaeeneeeeeeeeeaaaaeneeeeeeeees 139 B 2 Compatibility with MySQL Versions ccccceeeeeeee cece eee eeee eter tees ae aaa eeeeeeeeeeaeaaeaeeeeeeeeeeaeaaea 139 B 3 Compatibility with Older MySQL Enterprise Backup 0 cceceeeeeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaea 139 B 4 Compatibility Notes for Specific MySQL Versions cccceeeeeeeeeeeeeeaeeeeeeeeeeeeeeeaeaaeeeeeeteees 139 G Extend d Examples umi A ial ee 141 C 1 Sample Directory Structure for Full Backup c cceeeeeeeeee ee aeeeeeeeeeeeeeeeaaaaeeeeeeeeeeeeaeaaaeees 141 C 2 Sample Directory Structure for Compressed Backup cccceeeeeeeeeeeeeeeeeeeeeaaeaeeeeeeeeeeeeaea 145 C 3 Sample Directory Structure for Incremental Backup cceeeeeeeeeceeeeeeeeeeeeeeeaaaaeeeeeeeeeees 145 D MySQL Enterprise Backup Release Notes cccceceeeeeeeeeeee
316. wing form db_name table_name db_namel table_namell If the specified values do not match any database or table then no non InnoDB data files are backed up See Making a Partial Backup with the Legacy Options 41 for details By default all non InnoDB tables from all databases are backed up Note Y The option has no filtering effects on the InnoDB data files iba files for the databases or tables it specifies To filter InnoDB data files use the include option instead e databases list file PATH Specifies the pathname of a file that lists the non InnoDB tables to be backed up The file contains entries for databases or fully qualified table names separated by newline or space The format of the entries is the same as for the databases option db_name table_name db_namel table_namel Remove any whitespaces surrounding the database or table names as the whitespaces are not removed automatically Begin a line with the character to include a comment No regular expressions are allowed If the specified entries do not match any database or table then no non InnoDB data files are backed up databases or tables it specifies To filter InnoDB data files use the include option instead Note Y The option has no filtering effects on the InnoDB data files iba files for the e only innodb with frm all related Back up only InnoDB data log files and the frm files associated with the Inn
317. y comments txt use a command like the following mysqlbackup src entry meta comments txt dst entry tmp my comments txt backup image var myimage bki extract Similarly to extract all the contents of the meta directory in a single file backup as data my meta use a command like the following mysqlbackup src entry meta dst entry data my meta Y backup image var myimage bki extract The specified path is a simple path name without any wildcard expansion or regular expressions Default By default original pathnames are used to create files in the local file system sbt database name NAME Command Line Format sbt database name NAME Permitted Values Type string Default MySQL For tape backups this option can be used as a hint to the Media Management Software MMS for the selection of media and policies This name has nothing to do with MySQL database names It is a term used by the MMS See Section 3 3 5 2 Backing Up to Tape for usage details sbt lib path PATH Command Line Format sbt 1ib path PATH Permitted Values Type file name Path name of the SBT library used by software that manages tape backups If this is not specified operating system specific search methods are used to locate 1ibobk so UNIX or orasbt d11l Windows See Section 3 3 5 2 Backing Up to Tape for usage details sbt environment VAR value
318. ysql innodb_undo_tablespaces 0 innodb_undo_logs 128 datadir home admin backups datadir innodb_data_home_dir home admin backups datadir innodb_data_file_path ibdatal 12M autoextend innodb_log_group_home_dir home admin backups datadir innodb_log_files_in_group 2 innodb_log_file_size 50331648 innodb_page_size 16384 innodb_checksum_algorithm innodb innodb_undo_directory home admin backups datadir innodb_undo_tablespaces 0 innodb_undo_logs 128 mysqlbackup INFO Unique generated backup id for this is 14098484948398421 mysqlbackup INFO Creating 14 buffers each of size 16777216 40904 12 34 57 mysqlbackup INFO Full Backup operation starts with following threads 1 read threads 6 process threads 1 write threads 40904 12 34 57 mysqlbackup INFO System tablespace file format is Antelope AMO 2a seis 7 wise oceano IUNINOS Siecucieaine do Cejyy edil awmmoroele tenia 4 40904 12 34 57 mysqlbackup INFO Found checkpoint at lsn 1611237 A0 9 O4SI2 34s ov scsi MOS Steric os sosm Ex sia 1107392 40904 12 34 57 mysqlbackup INFO Copying log 40904 12 34 57 mysqlbackup INFO Log copied lsn 1611237 40904 12 34 57 mysqlbackup INFO Copying var lib mysql ibdatal Antelope file format 40904 12 34 59 mysqlbackup INFO Completing the copy of innodb files 40904 12 34 59 mysqlbackup INFO Starting to copy Binlog files 40904 12 34 59 mysqlbackup INFO Preparing
Download Pdf Manuals
Related Search
Related Contents
Philips NTRX700 EVBUM2212 - USB-LIN Interface V3 Evaluation Board User's Manual Hoja de Datos Técnicos Producto 5900 カタログダウンロード Xerox WorkCentre 6027 Installation Guide Manual de Usuario - World Korei Corporation SA de CV Sony CDX-GT270 Car Radio OWNER`S MANUAL Operating Hamilton Beach 4535 User's Manual Liebherr Kes 3670 Premium Copyright © All rights reserved.
Failed to retrieve file