Description of common parameters of xtrabackup

xtrabackup options

The xtrabackup tool has many parameters, which can be inquired on the official website ( xtrabackup parameter options  |  innobackupex parameter options ), here is a brief introduction to some commonly used parameters of innobackupex.

1) innobackupex parameter options

--defaults-file=[MY.CNF] //Specify configuration file: only default options can be read from the given file. and must be the first option on the command line; must be a real file, it cannot be a symbolic link.

--databases=# //Specify the backup database and table, the format is: --database="db1[.tb1] db2[.tb2]" Multiple databases are separated by spaces, if this option is not specified, All databases will be backed up.

--include=REGEXP //Specify the database and table to be backed up by regular expression, the format is --include='^mydb[.]mytb', match each table in each library one by one, so it will Create all libraries, but empty directories. --include is passed to xtrabackup --tables.

--tables-file=FILE //The parameter of this option needs to be a file name, each line in this file contains a full name of the table to be backed up, in the format databasename.tablename. This option is passed to xtrabackup --tables-file, and unlike the --tables option, only the library of tables to be backed up will be created.

Note: Partial backups (--include, --tables-file, --database) require innodb_file_per_table to be enabled.

--compact //Create a compact backup, ignoring all auxiliary index pages, only backing up data pages; rebuild indexes through --apply-log --rebuild-indexs.

--compress //This option instructs xtrabackup to compress the backed up InnoDB data files, which will generate *.qp files.

--decompress //Decompress the qp file, in order to decompress, the qpress tool must be installed. Percona XtraBackup does not automatically delete compressed files, in order to clean up the backup directory, the user should manually delete the *.qp files: find /data/backup -name "*.qp" | xargs rm.

--no-timestamp //If this option is specified, the backup will be stored directly in the BACKUP-DIR directory without creating a timestamp folder.

--apply-log //Apply the xtrabackup_logfile transaction log file in BACKUP-DIR. Under normal circumstances, after the backup is completed, the data cannot be used for recovery operations, because the backed up data may contain uncommitted transactions or transactions that have been committed but have not yet been synchronized to the data file. Therefore, the data files are still in an inconsistent state at this point. The main function of "prepare" is to keep the data file in a consistent state by rolling back uncommitted transactions and synchronizing committed transactions to the data file.

--use-memory=# //This option accepts a character parameter (1M/1MB, 1G/1GB, default 100M), only used with --apply-log, this option is used for crash recovery (crash- recovery) memory.

--copy-back //Copy all files previously backed up to their original paths. But there cannot be any files or directories under the original path unless the --force-non-empty-directories option is specified.

--force-non-empty-directories //Specify this option when restoring, so that --copy-back and --move-back can copy files to non-empty directories, that is, there can be other files in the original data directory, but not The file with the same name as the recovery file, otherwise the recovery will fail.

--rsync // This option optimizes local file (non-InnoDB) transfers. The rsync tool copies all non-InnoDB files at once, rather than creating a separate cp for each file, which is very efficient when backing up and restoring many databases and tables. This option cannot be used with --stream.

--incremental // This option tells xtrabackup to create an incremental backup instead of a full backup. It is passed to the xtrabackup subprocess. When specifying this option, either --incremental-lsn or --incremental-basedir can be set. If neither of these 2 options are specified, --incremental-basedir is passed to xtrabackup with the default value: the first timestamp of the base backup directory for the backup directory.

--incremental-basedir=DIRECTORY //This option accepts a string parameter that specifies the full backup directory as the base data set for incremental backups. It is used with --incremental.

--incremental-dir=DIRECTORY // This option accepts a string parameter that specifies the directory where the incremental backup will be combined with the full backup for a new full backup. It is used with the --incremental option.

--redo-only //Use this option when "prepare base full backup" and "merge all incremental backups (except the last one)". It is passed directly to xtrabackup's xtrabackup --apply-log-only option to make xtrabackup skip the "undo" phase and only do "redo" operations. This is necessary if later incremental backups are applied to this full backup. See the xtrabackup documentation for details.

--parallel=NUMBER-OF-THREADS //This option accepts an integer parameter specifying the number of threads the xtrabackup subprocess should apply to backing up files at the same time. Note that this option only works at the file level, that is, if you have multiple .ibd files, they will be copied in parallel; it will not work if your tables are stored together in one tablespace file.

2) xtrabackup parameter options

--apply-log-only // This option enables only the redo phase to be performed when preparing a backup (prepare), which is very important for incremental backups.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324768511&siteId=291194637