Xtrabackup有两个主要的工具:xtrabackup、innobackupex

1、xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表

2、innobackupex是参考了InnoDB Hotbackup的innoback脚本修改而来的.innobackupex是一个perl脚本封装,封装了xtrabackup。主要是为了方便的 同时备份InnoDB和MyISAM引擎的表,但在处理myisam时需要加一个读锁。并且加入了一些使用的选项。如slave-info可以记录备份恢 复后,作为slave需要的一些信息,根据这些信息,可以很方便的利用备份来重做slave。

innobackupex [options] <backup directory>

Options:

--apply-log

Prepare a backup in BACKUP-DIR by applying the transaction log file named "xtrabackup_logfile" located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file "backup-my.cnf".

--compress

This option instructs xtrabackup to compress backup copies of InnoDB data files. It is passed directly to the xtrabackup child process. Try 'xtrabackup --help' for more details.

--compress-threads

This option specifies the number of worker threads that will be used for parallel compression. It is passed directly to the xtrabackup child process. Try 'xtrabackup --help' for more details.

--copy-back

Copy all the files in a previously made backup from the backup directory to their original locations.

--databases=LIST

This option specifies the list of databases that innobackupex should back up. The option accepts a string argument. The list is of the form "databasename1[.table_name1] databasename2[.table_name2] . . .". If this option is not specified, all databases containing MyISAM and InnoDB tables will be backed up. Please make sure that --databases contains all of the InnoDB databases and tables, so that all of the innodb.frm files are also backed up. In case the list is very long, this can be specified in a file, and the full path of the file can be specified instead of the list. (See option --tables-file.)

--defaults-file=[MY.CNF]

This option specifies what file to read the default MySQL options from. The option accepts a string argument. It is also passed directly to xtrabackup's --defaults-file option. See the xtrabackup documentation for details.

--export

This option is passed directly to xtrabackup's --export option. It enables exporting individual tables for import into another server. See the xtrabackup documentation for details.

--extra-lsndir=DIRECTORY

This option specifies the directory in which to save an extra copy of the "xtrabackup_checkpoints" file. The option accepts a string argument. It is passed directly to xtrabackup's --extra-lsndir option. See the xtrabackup documentation for details.

--force-tar

This option forces the use of tar when creating a streamed backup, rather than tar4ibd, which is the default.

--help

This option displays a help screen and exits.

--host=HOST

This option specifies the host to use when connecting to the database server with TCP/IP. The option accepts a string argument. It is passed to the mysql child process without alteration. See mysql --help for details.

--ibbackup=IBBACKUP-BINARY

This option specifies which xtrabackup binary should be used. The option accepts a string argument. IBBACKUP-BINARY should be the command used to run XtraBackup. The option can be useful if the xtrabackup binary is not in your search path or working directory. If this option is not specified, innobackupex attempts to determine the binary to use automatically. By default, "xtrabackup" is the command used. However, when option --copy-back is specified, "xtrabackup_51" is the command used. And when option --apply-log is specified, the binary is used whose name is in the file "xtrabackup_binary" in the backup directory, if that file exists.

--include=REGEXP

This option is a regular expression to be matched against table names in databasename.tablename format. It is passed directly to xtrabackup's --tables option. See the xtrabackup documentation for details.

--incremental

This option tells xtrabackup to create an incremental backup, rather than a full one. It is passed to the xtrabackup child process. When this option is specified, either --incremental-lsn or --incremental-basedir can also be given. If neither option is given, option --incremental-basedir is passed to xtrabackup by default, set to the first timestamped backup directory in the backup base directory.

--incremental-basedir=DIRECTORY

This option specifies the directory containing the full backup that is the base dataset for the incremental backup. The option accepts a string argument. It is used with the --incremental option.

--incremental-dir=DIRECTORY

This option specifies the directory where the incremental backup will be combined with the full backup to make a new full backup. The option accepts a string argument. It is used with the --incremental option.

--incremental-lsn

This option specifies the log sequence number (LSN) to use for the incremental backup. The option accepts a string argument. It is used with the --incremental option. It is used instead of specifying --incremental-basedir. For databases created by MySQL and Percona Server 5.0-series versions, specify the LSN as two 32-bit integers in high:low format. For databases created in 5.1 and later, specify the LSN as a single 64-bit integer.

--no-lock

Use this option to disable table lock with "FLUSH TABLES WITH READ LOCK". Use it only if ALL your tables are InnoDB and you DO NOT CARE about the binary log position of the backup.

--no-timestamp

This option prevents creation of a time-stamped subdirectory of the BACKUP-ROOT-DIR given on the command line. When it is specified, the backup is done in BACKUP-ROOT-DIR instead.

--parallel=NUMBER-OF-THREADS

This option specifies the number of threads the xtrabackup child process should use to back up files concurrently. The option accepts an integer argument. It is passed directly to xtrabackup's --parallel option. See the xtrabackup documentation for details.

--password=WORD

This option specifies the password to use when connecting to the database. It accepts a string argument. It is passed to the mysql child process without alteration. See mysql --help for details.

--port=PORT

This option specifies the port to use when connecting to the database server with TCP/IP. The option accepts a string argument. It is passed to the mysql child process. It is passed to the mysql child process without alteration. See mysql --help for details.

--redo-only

This option is passed directly to xtrabackup's --apply-log-only option. This forces xtrabackup to skip the "rollback" phase and do a "redo" only. This is necessary if the backup will have incremental changes applied to it later. See the xtrabackup documentation for details.

--remote-host=HOSTNAME

This option is DEPRECATED and will be removed in Percona XtraBackup 2.1. In Percona XtraBackup 2.0 and later, you should use streaming backups instead. This option specifies the remote host on which the backup files will be created, by using an ssh connection. The option accepts a string argument.

--safe-slave-backup

Stop slave SQL thread and wait to start backup until Slave_open_temp_tables in "SHOW STATUS" is zero. If there are no open temporary tables, the backup will take place, otherwise the SQL thread will be started and stopped until there are no open temporary tables. The backup will fail if Slave_open_temp_tables does not become zero after --safe-slave-backup-timeout seconds. The slave SQL thread will be restarted when the backup finishes.

--safe-slave-backup-timeout

How many seconds --safe-slave-backup should wait for Slave_open_temp_tables to become zero. (default 300)

--scpopt=SCP-OPTIONS

This option specifies the command line options to pass to scp when the option --remost-host is specified. The option accepts a string argument. If the option is not specified, the default options are "-Cp -c arcfour".

--sshopt=SSH-OPTIONS

This option specifies the command line options to pass to ssh when the option --remost-host is specified. The option accepts a string argument.

--slave-info

This option is useful when backing up a replication slave server. It prints the binary log position and name of the master server. It also writes this information to the "xtrabackup_slave_info" file as a "CHANGE MASTER" command. A new slave for this master can be set up by starting a slave server on this backup and issuing a "CHANGE MASTER" command with the binary log position saved in the "xtrabackup_slave_info" file.

--socket=SOCKET

This option specifies the socket to use when connecting to the local database server with a UNIX domain socket. The option accepts a string argument. It is passed to the mysql child process without alteration. See mysql --help for details.

--stream=[tar|. . .]

This option specifies the format in which to do the streamed backup. The option accepts a string argument. The backup will be done to STDOUT in the specified format. Currently, the only supported formats are tar and xbstream. This option is passed directly to xtrabackup's --stream option.

--tables-file=FILE

This option specifies the file in which there are a list of names of the form database. The option accepts a string argument.table, one per line. The option is passed directly to xtrabackup's --tables-file option.

--throttle=IOS

This option specifies a number of I/O operations (pairs of read+write) per second. It accepts an integer argument. It is passed directly to xtrabackup's --throttle option.

--tmpdir=DIRECTORY

This option specifies the location where a temporary file will be stored. The option accepts a string argument. It should be used when --remote-host or --stream is specified. For these options, the transaction log will first be stored to a temporary file, before streaming or copying to a remote host. This option specifies the location where that temporary file will be stored. If the option is not specifed, the default is to use the value of tmpdir read from the server configuration.

--use-memory=B

This option accepts a string argument that specifies the amount of memory in bytes for xtrabackup to use for crash recovery while preparing a backup. Multiples are supported providing the unit (e.g. 1MB, 1GB). It is used only with the option --apply-log. It is passed directly to xtrabackup's --use-memory option. See the xtrabackup documentation for details.

--user=NAME

This option specifies the MySQL username used when connecting to the server, if that's not the current user. The option accepts a string argument. It is passed to the mysql child process without alteration. See mysql --help for details.

--version

This option displays the xtrabackup version and copyright notice and then exits.

转载于:https://blog.51cto.com/michaelkang/1216830

mysql热备工具innobackupex参数详解相关推荐

  1. Windows 运行chkdsk磁盘修复工具命令参数详解

    Windows 运行chkdsk磁盘修复工具命令参数详解 chkdsk是Windows系统自带的磁盘修复工具,通常在电脑非正常关机之后再开机,系统就会自动调用chkdsk工具进行磁盘扫描和修复.同时, ...

  2. MySQL配置文件my.cnf各参数详解

    # +--------------+ # | 客户端基本设置 | # +--------------+ [client]# 默认连接端口 port = 3306# 用于本地连接的socket套接字 s ...

  3. mysql autoenlist默认_mysql连接参数详解

    通常数据库连接字符串为: Database=dbname;Data Source=192.168.1.1;Port=3306;User Id=root;Password=****;Charset=ut ...

  4. MySQL 5.7调优参数详解

    MySQL 5.7参数优化 连接相关参数 max_connections: 允许客户端并发连接的最大数量,默认值是151,一般将该参数设置为500-2000 max_connect_errors: 如 ...

  5. mysql JDBC URL格式各个参数详解

    mysql JDBC URL格式如下: jdbc:mysql://[host:port],[host:port].../[database][?参数名1][=参数值1][&参数名2][=参数值 ...

  6. Nmap工具使用参数详解

    Nmap简介 nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端.确定哪些服务运行在哪些连接端,并且推断计算机运行哪个操作系统(这是亦称 fingerprinting).它是网络管理员 ...

  7. mysql skip用法_MySQL性能参数详解之Skip-External-Locking参数介绍

    MySQL的配置文件my.cnf中默认存在一行skip-external-locking的参数,即"跳过外部锁定".根据MySQL开发网站的官方解释,External-lockin ...

  8. mysql xtrabackup 参数_Xtrabackup 安装 参数详解

    安装 继Xtrabackup 介绍,本次来讲解安装和使用. Xtrabackup的RPM包下载地址: 系统版本 官网刚下载地址 百度云下载 CentOS 6 百度云盘链接 提取码:rxv5 CentO ...

  9. (4.14)mysql备份还原——mysql物理热备工具之ibbackup

    关键词:mysql热备工具,ibbackup,mysql物理备份工具 1. 准备 ibbackup 是 InnoDB 提供的收费工具,它支持在线热备 InnoDB 数据,主要有以下特性: * Onli ...

最新文章

  1. 调多大的角度 计算几何
  2. Python3调用MySQL数据库中的数据
  3. 基于MapReduce的贝叶斯网络算法研究参考文献
  4. 小米8对一加6打开软件速度测试,买一加6还是小米8?小米8和一加6区别对比
  5. 软件工程-团队作业1
  6. (140)System Verilog替代交叉覆盖率
  7. 使用DPDK打开Open vSwitch(OvS) *概述
  8. 连续两天,8 大技术论坛,微软超 60 个烧脑议题等你来战
  9. C#中数据库备份还原
  10. DDraw笔记-创建表面
  11. visio软件安装包各个版本收集整理
  12. UML-----构件图与部署图
  13. WEB程序设计 第7版.pdf
  14. Matlab出错向量长度必须相同,代码已贴。错误使用plot3,向量长度必须相同
  15. uncode ansi详解
  16. mysql in 子查询无法使用索引全表扫描 慎用in
  17. 深度揭秘:消费者应如何激活iPhone
  18. 【C++】引用以及关联函数(详解)
  19. pytorch笔记(一)——tensor的storage()、stride()、storage_offset()
  20. python语句结束符号_Python从文本中提取hashtags;以标点符号结尾

热门文章

  1. 关于vue2.0+hbuilder打包移动端app之后空白页面的解决方案
  2. SourceTree/git解决pre-commit hook failed的问题
  3. vue父组件引用子组件方法显示undefined问题原因及解决方法
  4. 【亲测有效】Ubuntu18.04 sudo apt update无法解析域名的解决方案
  5. 将Kinect的v2.0 Motion存储到BVH文件中
  6. 我应该如何验证电子邮件地址?
  7. 在Python中没有测试[重复]
  8. 重装系统Win10电脑磁盘被写保护怎么办
  9. 中的实践 中兴_中兴数字化转型:做“极致的云公司” 用5G制造5G
  10. mysql的游标处理_MySQL存储过程 游标 错误处理的示例代码