(一)xtraBackup简介

xtraBackup是Percona公司开发的一款MySQL数据库备份软件,在备份模式中属于物理备份。其显著特点是开源、免费、备份执行过程中不会阻塞事物、备份可压缩、支持全备和增量备份。

(二)下载安装xtraBackup工具

xtraBackup并没有随着MySQL安装包一起下载,需要单独到percona官网下载。注意,最新版的Percona XtraBackup 8.0不适用于MySQL 8.0以前的版本,我的数据库是MySQL5.7,因此下载2.4版本。

(2.1)离线安装

大部分公司服务器都不连接外网,离线安装是使用最多的方式。xtraBackup rpm包下载地址为:https://www.percona.com/downloads/Percona-XtraBackup-2.4/LATEST/。以下过程是在断网情况下执行的。

STEP1:将rpm安装包传到服务器上

[root@mysqlserver ~]# ls -l |grep percona
-rw-r--r-- root root Feb : percona-xtrabackup--2.4.-.el7.x86_64.rpm

STEP2:安装rpm包,这里不要使用rpm -ivh去安装,因为该安装包需要其他依赖包,直接使用yum解决依赖问题

[root@mysqlserver ~]# yum install -y percona-xtrabackup--2.4.-.el7.x86_64.rpm

STEP3:确认安装结果

[root@mysqlserver ~]# which xtrabackup
/usr/bin/xtrabackup
[root@mysqlserver ~]# which innobackupex
/usr/bin/innobackupex

(2.2)在线安装

如果机器联网,可以直接使用yum源安装,这里以centos7服务器为例。

STEP1:安装xtraBackup的yum源

[root@mysqlserver /root]# yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm

STEP2:确认xtrabackup安装包(可跳过)

[root@mysqlserver /root]# yum list | grep percona
...
percona-xtrabackup--debuginfo.x86_64 2.2.-.el7 percona-release-x86_64
percona-xtrabackup-.x86_64 2.4.-.el7 percona-release-x86_64
percona-xtrabackup--debuginfo.x86_64 2.4.-.el7 percona-release-x86_64
percona-xtrabackup-.x86_64 8.0.-.el7 percona-release-x86_64
percona-xtrabackup--debuginfo.x86_64 8.0.-.el7 percona-release-x86_64
percona-xtrabackup-debuginfo.x86_64 2.3.-.el7 percona-release-x86_64
percona-xtrabackup-test.x86_64 2.3.-.el7 percona-release-x86_64
percona-xtrabackup-test-.x86_64 2.2.-.el7 percona-release-x86_64
percona-xtrabackup-test-.x86_64 2.4.-.el7 percona-release-x86_64
percona-xtrabackup-test-.x86_64 8.0.-.el7 percona-release-x86_64
percona-zabbix-templates.noarch 1.1.- percona-release-noarch
...

STEP3:安装xtraBackup

[root@mysqlserver /root]# yum install -y percona-xtrabackup-

STEP4:确认安装结果

[root@mysqlserver /root]# which xtrabackup
/usr/bin/xtrabackup
[root@mysqlserver /root]# which innobackupex
/usr/bin/innobackupex

xtraBackup包含2个主要的工具:xtrabackup和innobackupex。两者区别如下:

  • xtrbackup只能备份innodb和xtradb引擎的表,对于其他引擎的表则无能为力,包括MYISAM。
  • innobackupex是一个封装了xtrbackup的Perl脚本,除了支持xtrabackup工具可以备份的表以外,还支持MYISAM、CSV、memory(仅表结构)等,比xtrabackup强大。

因为innobackupex工具更为强大,所以后续直接使用innobackupex来执行备份和恢复。

(三)使用innobackupex备份数据库

innobackupex支持全备和增量备份,对于该工具的用法,可以直接使用“--help”命令查看

[root@mysqlserver ~]# innobackupex --help

(3.1)使用innobackupex来执行全备

执行全备的命令如下:

[root@mysqlserver ~]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' /backup 

参数信息:

--user                  :连接数据库使用的用户名

--password          :连接数据库使用的密码

--default-file         :指出MySQL的参数配置文件路径

[backup_dir]        :备份集存放地址

innobackupex备份执行过程如下:

[root@mysqlserver ~]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' /backup
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data
xtrabackup: recognized client arguments:
:: innobackupex: Starting the backup operation IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!". :: version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.soc' as 'root' (using password: YES).
:: version_check Connected to MySQL server
:: version_check Executing a version check against the server...
:: version_check Done.
:: Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql.soc
Using server version 5.7.
innobackupex version 2.4. based on MySQL server 5.7. Linux (x86_64) (revision id: 29b4ca5)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /usr/local/mysql/data
xtrabackup: open files limit requested , set to
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group =
xtrabackup: innodb_log_file_size =
InnoDB: Number of pools:
:: >> log scanned up to ()
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID for mysql/plugin, old maximum was
:: [] Copying ./ibdata1 to /backup/--11_16--/ibdata1
:: [] ...done
:: [] Copying ./mysql/plugin.ibd to /backup/--11_16--/mysql/plugin.ibd
:: [] ...done
:: [] Copying ./mysql/servers.ibd to /backup/--11_16--/mysql/servers.ibd
:: [] ...done
:: [] Copying ./mysql/help_topic.ibd to /backup/--11_16--/mysql/help_topic.ibd
:: [] ...done
:: [] Copying ./mysql/help_category.ibd to /backup/--11_16--/mysql/help_category.ibd
:: [] ...done
:: [] Copying ./mysql/help_relation.ibd to /backup/--11_16--/mysql/help_relation.ibd
:: [] ...done
:: [] Copying ./mysql/help_keyword.ibd to /backup/--11_16--/mysql/help_keyword.ibd
:: [] ...done
:: [] Copying ./mysql/time_zone_name.ibd to /backup/--11_16--/mysql/time_zone_name.ibd
:: [] ...done
:: [] Copying ./mysql/time_zone.ibd to /backup/--11_16--/mysql/time_zone.ibd
:: [] ...done
:: [] Copying ./mysql/time_zone_transition.ibd to /backup/--11_16--/mysql/time_zone_transition.ibd
:: [] ...done
:: [] Copying ./mysql/time_zone_transition_type.ibd to /backup/--11_16--/mysql/time_zone_transition_type.ibd
:: [] ...done
:: [] Copying ./mysql/time_zone_leap_second.ibd to /backup/--11_16--/mysql/time_zone_leap_second.ibd
:: [] ...done
:: [] Copying ./mysql/innodb_table_stats.ibd to /backup/--11_16--/mysql/innodb_table_stats.ibd
:: [] ...done
:: [] Copying ./mysql/innodb_index_stats.ibd to /backup/--11_16--/mysql/innodb_index_stats.ibd
:: [] ...done
:: [] Copying ./mysql/slave_relay_log_info.ibd to /backup/--11_16--/mysql/slave_relay_log_info.ibd
:: [] ...done
:: [] Copying ./mysql/slave_master_info.ibd to /backup/--11_16--/mysql/slave_master_info.ibd
:: [] ...done
:: [] Copying ./mysql/slave_worker_info.ibd to /backup/--11_16--/mysql/slave_worker_info.ibd
:: [] ...done
:: [] Copying ./mysql/gtid_executed.ibd to /backup/--11_16--/mysql/gtid_executed.ibd
:: [] ...done
:: [] Copying ./mysql/server_cost.ibd to /backup/--11_16--/mysql/server_cost.ibd
:: [] ...done
:: [] Copying ./mysql/engine_cost.ibd to /backup/--11_16--/mysql/engine_cost.ibd
:: [] ...done
:: [] Copying ./sys/sys_config.ibd to /backup/--11_16--/sys/sys_config.ibd
:: [] ...done
:: [] Copying ./test_database/test01.ibd to /backup/--11_16--/test_database/test01.ibd
:: [] ...done
:: >> log scanned up to ()
:: Executing FLUSH NO_WRITE_TO_BINLOG TABLES...
:: Executing FLUSH TABLES WITH READ LOCK...
:: Starting to backup non-InnoDB tables and files
:: [] Copying ./mysql/db.opt to /backup/--11_16--/mysql/db.opt
:: [] ...done
:: [] Copying ./mysql/db.frm to /backup/--11_16--/mysql/db.frm
:: [] ...done
:: [] Copying ./mysql/db.MYI to /backup/--11_16--/mysql/db.MYI
:: [] ...done
:: [] Copying ./mysql/db.MYD to /backup/--11_16--/mysql/db.MYD
:: [] ...done
:: [] Copying ./mysql/user.frm to /backup/--11_16--/mysql/user.frm
:: [] ...done
:: [] Copying ./mysql/user.MYI to /backup/--11_16--/mysql/user.MYI
:: [] ...done
:: [] Copying ./mysql/user.MYD to /backup/--11_16--/mysql/user.MYD
:: [] ...done
:: [] Copying ./mysql/func.frm to /backup/--11_16--/mysql/func.frm
:: [] ...done
:: [] Copying ./mysql/func.MYI to /backup/--11_16--/mysql/func.MYI
:: [] ...done
:: [] Copying ./mysql/func.MYD to /backup/--11_16--/mysql/func.MYD
:: [] ...done
:: [] Copying ./mysql/plugin.frm to /backup/--11_16--/mysql/plugin.frm
:: [] ...done
:: [] Copying ./mysql/servers.frm to /backup/--11_16--/mysql/servers.frm
:: [] ...done
:: [] Copying ./mysql/tables_priv.frm to /backup/--11_16--/mysql/tables_priv.frm
:: [] ...done
:: [] Copying ./mysql/tables_priv.MYI to /backup/--11_16--/mysql/tables_priv.MYI
:: [] ...done
:: [] Copying ./mysql/tables_priv.MYD to /backup/--11_16--/mysql/tables_priv.MYD
:: [] ...done
:: [] Copying ./mysql/columns_priv.frm to /backup/--11_16--/mysql/columns_priv.frm
:: [] ...done
:: [] Copying ./mysql/columns_priv.MYI to /backup/--11_16--/mysql/columns_priv.MYI
:: [] ...done
:: [] Copying ./mysql/columns_priv.MYD to /backup/--11_16--/mysql/columns_priv.MYD
:: [] ...done
:: [] Copying ./mysql/help_topic.frm to /backup/--11_16--/mysql/help_topic.frm
:: [] ...done
:: [] Copying ./mysql/help_category.frm to /backup/--11_16--/mysql/help_category.frm
:: [] ...done
:: [] Copying ./mysql/help_relation.frm to /backup/--11_16--/mysql/help_relation.frm
:: [] ...done
:: [] Copying ./mysql/help_keyword.frm to /backup/--11_16--/mysql/help_keyword.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_name.frm to /backup/--11_16--/mysql/time_zone_name.frm
:: [] ...done
:: [] Copying ./mysql/time_zone.frm to /backup/--11_16--/mysql/time_zone.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_transition.frm to /backup/--11_16--/mysql/time_zone_transition.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_transition_type.frm to /backup/--11_16--/mysql/time_zone_transition_type.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_leap_second.frm to /backup/--11_16--/mysql/time_zone_leap_second.frm
:: [] ...done
:: [] Copying ./mysql/proc.frm to /backup/--11_16--/mysql/proc.frm
:: [] ...done
:: [] Copying ./mysql/proc.MYI to /backup/--11_16--/mysql/proc.MYI
:: [] ...done
:: [] Copying ./mysql/proc.MYD to /backup/--11_16--/mysql/proc.MYD
:: [] ...done
:: [] Copying ./mysql/procs_priv.frm to /backup/--11_16--/mysql/procs_priv.frm
:: [] ...done
:: [] Copying ./mysql/procs_priv.MYI to /backup/--11_16--/mysql/procs_priv.MYI
:: [] ...done
:: [] Copying ./mysql/procs_priv.MYD to /backup/--11_16--/mysql/procs_priv.MYD
:: [] ...done
:: [] Copying ./mysql/general_log.frm to /backup/--11_16--/mysql/general_log.frm
:: [] ...done
:: [] Copying ./mysql/general_log.CSM to /backup/--11_16--/mysql/general_log.CSM
:: [] ...done
:: [] Copying ./mysql/general_log.CSV to /backup/--11_16--/mysql/general_log.CSV
:: [] ...done
:: [] Copying ./mysql/slow_log.frm to /backup/--11_16--/mysql/slow_log.frm
:: [] ...done
:: [] Copying ./mysql/slow_log.CSM to /backup/--11_16--/mysql/slow_log.CSM
:: [] ...done
:: [] Copying ./mysql/slow_log.CSV to /backup/--11_16--/mysql/slow_log.CSV
:: [] ...done
:: [] Copying ./mysql/event.frm to /backup/--11_16--/mysql/event.frm
:: [] ...done
:: [] Copying ./mysql/event.MYI to /backup/--11_16--/mysql/event.MYI
:: [] ...done
:: [] Copying ./mysql/event.MYD to /backup/--11_16--/mysql/event.MYD
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.frm to /backup/--11_16--/mysql/ndb_binlog_index.frm
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.MYI to /backup/--11_16--/mysql/ndb_binlog_index.MYI
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.MYD to /backup/--11_16--/mysql/ndb_binlog_index.MYD
:: [] ...done
:: [] Copying ./mysql/innodb_table_stats.frm to /backup/--11_16--/mysql/innodb_table_stats.frm
:: [] ...done
:: [] Copying ./mysql/innodb_index_stats.frm to /backup/--11_16--/mysql/innodb_index_stats.frm
:: [] ...done
:: [] Copying ./mysql/slave_relay_log_info.frm to /backup/--11_16--/mysql/slave_relay_log_info.frm
:: [] ...done
:: [] Copying ./mysql/slave_master_info.frm to /backup/--11_16--/mysql/slave_master_info.frm
:: [] ...done
:: [] Copying ./mysql/slave_worker_info.frm to /backup/--11_16--/mysql/slave_worker_info.frm
:: [] ...done
:: [] Copying ./mysql/gtid_executed.frm to /backup/--11_16--/mysql/gtid_executed.frm
:: [] ...done
:: [] Copying ./mysql/server_cost.frm to /backup/--11_16--/mysql/server_cost.frm
:: [] ...done
:: [] Copying ./mysql/engine_cost.frm to /backup/--11_16--/mysql/engine_cost.frm
:: [] ...done
:: [] Copying ./mysql/proxies_priv.frm to /backup/--11_16--/mysql/proxies_priv.frm
:: [] ...done
:: [] Copying ./mysql/proxies_priv.MYI to /backup/--11_16--/mysql/proxies_priv.MYI
:: [] ...done
:: [] Copying ./mysql/proxies_priv.MYD to /backup/--11_16--/mysql/proxies_priv.MYD
:: [] ...done
:: [] Copying ./sys/db.opt to /backup/--11_16--/sys/db.opt
:: [] ...done
:: [] Copying ./sys/version.frm to /backup/--11_16--/sys/version.frm
:: [] ...done
:: [] Copying ./sys/sys_config.frm to /backup/--11_16--/sys/sys_config.frm
:: [] ...done
:: [] Copying ./sys/statements_with_full_table_scans.frm to /backup/--11_16--/sys/statements_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/sys_config_insert_set_user.TRN to /backup/--11_16--/sys/sys_config_insert_set_user.TRN
:: [] ...done
:: [] Copying ./sys/processlist.frm to /backup/--11_16--/sys/processlist.frm
:: [] ...done
:: [] Copying ./sys/sys_config.TRG to /backup/--11_16--/sys/sys_config.TRG
:: [] ...done
:: [] Copying ./sys/statements_with_sorting.frm to /backup/--11_16--/sys/statements_with_sorting.frm
:: [] ...done
:: [] Copying ./sys/sys_config_update_set_user.TRN to /backup/--11_16--/sys/sys_config_update_set_user.TRN
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_sorting.frm to /backup/--11_16--/sys/x@0024statements_with_sorting.frm
:: [] ...done
:: [] Copying ./sys/innodb_buffer_stats_by_schema.frm to /backup/--11_16--/sys/innodb_buffer_stats_by_schema.frm
:: [] ...done
:: [] Copying ./sys/schema_index_statistics.frm to /backup/--11_16--/sys/schema_index_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_buffer_stats_by_schema.frm to /backup/--11_16--/sys/x@0024innodb_buffer_stats_by_schema.frm
:: [] ...done
:: [] Copying ./sys/statements_with_temp_tables.frm to /backup/--11_16--/sys/statements_with_temp_tables.frm
:: [] ...done
:: [] Copying ./sys/innodb_buffer_stats_by_table.frm to /backup/--11_16--/sys/innodb_buffer_stats_by_table.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_schema_table_statistics_io.frm to /backup/--11_16--/sys/x@0024ps_schema_table_statistics_io.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_buffer_stats_by_table.frm to /backup/--11_16--/sys/x@0024innodb_buffer_stats_by_table.frm
:: [] ...done
:: [] Copying ./sys/host_summary.frm to /backup/--11_16--/sys/host_summary.frm
:: [] ...done
:: [] Copying ./sys/innodb_lock_waits.frm to /backup/--11_16--/sys/innodb_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary.frm to /backup/--11_16--/sys/x@0024host_summary.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_lock_waits.frm to /backup/--11_16--/sys/x@0024innodb_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/waits_by_user_by_latency.frm to /backup/--11_16--/sys/waits_by_user_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_object_overview.frm to /backup/--11_16--/sys/schema_object_overview.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_file_io_type.frm to /backup/--11_16--/sys/user_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/schema_auto_increment_columns.frm to /backup/--11_16--/sys/schema_auto_increment_columns.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_file_io.frm to /backup/--11_16--/sys/user_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_flattened_keys.frm to /backup/--11_16--/sys/x@0024schema_flattened_keys.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_file_io.frm to /backup/--11_16--/sys/x@0024user_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/schema_redundant_indexes.frm to /backup/--11_16--/sys/schema_redundant_indexes.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_statement_type.frm to /backup/--11_16--/sys/user_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/ps_check_lost_instrumentation.frm to /backup/--11_16--/sys/ps_check_lost_instrumentation.frm
:: [] ...done
:: [] Copying ./sys/latest_file_io.frm to /backup/--11_16--/sys/latest_file_io.frm
:: [] ...done
:: [] Copying ./sys/waits_by_host_by_latency.frm to /backup/--11_16--/sys/waits_by_host_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024latest_file_io.frm to /backup/--11_16--/sys/x@0024latest_file_io.frm
:: [] ...done
:: [] Copying ./sys/waits_global_by_latency.frm to /backup/--11_16--/sys/waits_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/io_by_thread_by_latency.frm to /backup/--11_16--/sys/io_by_thread_by_latency.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_stages.frm to /backup/--11_16--/sys/user_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_by_thread_by_latency.frm to /backup/--11_16--/sys/x@0024io_by_thread_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_stages.frm to /backup/--11_16--/sys/x@0024user_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_file_by_bytes.frm to /backup/--11_16--/sys/io_global_by_file_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_index_statistics.frm to /backup/--11_16--/sys/x@0024schema_index_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_file_by_bytes.frm to /backup/--11_16--/sys/x@0024io_global_by_file_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/user_summary.frm to /backup/--11_16--/sys/user_summary.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_file_by_latency.frm to /backup/--11_16--/sys/io_global_by_file_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_table_statistics.frm to /backup/--11_16--/sys/schema_table_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_file_by_latency.frm to /backup/--11_16--/sys/x@0024io_global_by_file_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary.frm to /backup/--11_16--/sys/x@0024user_summary.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_wait_by_bytes.frm to /backup/--11_16--/sys/io_global_by_wait_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_statistics.frm to /backup/--11_16--/sys/x@0024schema_table_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_wait_by_bytes.frm to /backup/--11_16--/sys/x@0024io_global_by_wait_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_file_io_type.frm to /backup/--11_16--/sys/host_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_wait_by_latency.frm to /backup/--11_16--/sys/io_global_by_wait_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_table_statistics_with_buffer.frm to /backup/--11_16--/sys/schema_table_statistics_with_buffer.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_wait_by_latency.frm to /backup/--11_16--/sys/x@0024io_global_by_wait_by_latency.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_file_io.frm to /backup/--11_16--/sys/host_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/memory_by_user_by_current_bytes.frm to /backup/--11_16--/sys/memory_by_user_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/schema_table_lock_waits.frm to /backup/--11_16--/sys/schema_table_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_user_by_current_bytes.frm to /backup/--11_16--/sys/x@0024memory_by_user_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_file_io.frm to /backup/--11_16--/sys/x@0024host_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/memory_by_host_by_current_bytes.frm to /backup/--11_16--/sys/memory_by_host_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_lock_waits.frm to /backup/--11_16--/sys/x@0024schema_table_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_host_by_current_bytes.frm to /backup/--11_16--/sys/x@0024memory_by_host_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/statement_analysis.frm to /backup/--11_16--/sys/statement_analysis.frm
:: [] ...done
:: [] Copying ./sys/memory_by_thread_by_current_bytes.frm to /backup/--11_16--/sys/memory_by_thread_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024statement_analysis.frm to /backup/--11_16--/sys/x@0024statement_analysis.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_thread_by_current_bytes.frm to /backup/--11_16--/sys/x@0024memory_by_thread_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_statement_type.frm to /backup/--11_16--/sys/host_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/memory_global_by_current_bytes.frm to /backup/--11_16--/sys/memory_global_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/statements_with_errors_or_warnings.frm to /backup/--11_16--/sys/statements_with_errors_or_warnings.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_global_by_current_bytes.frm to /backup/--11_16--/sys/x@0024memory_global_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/metrics.frm to /backup/--11_16--/sys/metrics.frm
:: [] ...done
:: [] Copying ./sys/memory_global_total.frm to /backup/--11_16--/sys/memory_global_total.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_stages.frm to /backup/--11_16--/sys/host_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_global_total.frm to /backup/--11_16--/sys/x@0024memory_global_total.frm
:: [] ...done
:: [] Copying ./sys/session.frm to /backup/--11_16--/sys/session.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_statistics_with_buffer.frm to /backup/--11_16--/sys/x@0024schema_table_statistics_with_buffer.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_errors_or_warnings.frm to /backup/--11_16--/sys/x@0024statements_with_errors_or_warnings.frm
:: [] ...done
:: [] Copying ./sys/schema_tables_with_full_table_scans.frm to /backup/--11_16--/sys/schema_tables_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/schema_unused_indexes.frm to /backup/--11_16--/sys/schema_unused_indexes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_tables_with_full_table_scans.frm to /backup/--11_16--/sys/x@0024schema_tables_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_stages.frm to /backup/--11_16--/sys/x@0024host_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_full_table_scans.frm to /backup/--11_16--/sys/x@0024statements_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_digest_avg_latency_distribution.frm to /backup/--11_16--/sys/x@0024ps_digest_avg_latency_distribution.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_digest_95th_percentile_by_avg_us.frm to /backup/--11_16--/sys/x@0024ps_digest_95th_percentile_by_avg_us.frm
:: [] ...done
:: [] Copying ./sys/statements_with_runtimes_in_95th_percentile.frm to /backup/--11_16--/sys/statements_with_runtimes_in_95th_percentile.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_runtimes_in_95th_percentile.frm to /backup/--11_16--/sys/x@0024statements_with_runtimes_in_95th_percentile.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_temp_tables.frm to /backup/--11_16--/sys/x@0024statements_with_temp_tables.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_file_io_type.frm to /backup/--11_16--/sys/x@0024user_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_statement_type.frm to /backup/--11_16--/sys/x@0024user_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_statement_latency.frm to /backup/--11_16--/sys/user_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_statement_latency.frm to /backup/--11_16--/sys/x@0024user_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_file_io_type.frm to /backup/--11_16--/sys/x@0024host_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_statement_type.frm to /backup/--11_16--/sys/x@0024host_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_statement_latency.frm to /backup/--11_16--/sys/host_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_statement_latency.frm to /backup/--11_16--/sys/x@0024host_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/wait_classes_global_by_avg_latency.frm to /backup/--11_16--/sys/wait_classes_global_by_avg_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024wait_classes_global_by_avg_latency.frm to /backup/--11_16--/sys/x@0024wait_classes_global_by_avg_latency.frm
:: [] ...done
:: [] Copying ./sys/wait_classes_global_by_latency.frm to /backup/--11_16--/sys/wait_classes_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024wait_classes_global_by_latency.frm to /backup/--11_16--/sys/x@0024wait_classes_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_by_user_by_latency.frm to /backup/--11_16--/sys/x@0024waits_by_user_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_by_host_by_latency.frm to /backup/--11_16--/sys/x@0024waits_by_host_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_global_by_latency.frm to /backup/--11_16--/sys/x@0024waits_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024processlist.frm to /backup/--11_16--/sys/x@0024processlist.frm
:: [] ...done
:: [] Copying ./sys/x@0024session.frm to /backup/--11_16--/sys/x@0024session.frm
:: [] ...done
:: [] Copying ./sys/session_ssl_status.frm to /backup/--11_16--/sys/session_ssl_status.frm
:: [] ...done
:: [] Copying ./test_database/db.opt to /backup/--11_16--/test_database/db.opt
:: [] ...done
:: [] Copying ./test_database/test01.frm to /backup/--11_16--/test_database/test01.frm
:: [] ...done
:: [] Copying ./performance_schema/db.opt to /backup/--11_16--/performance_schema/db.opt
:: [] ...done
:: [] Copying ./performance_schema/cond_instances.frm to /backup/--11_16--/performance_schema/cond_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_current.frm to /backup/--11_16--/performance_schema/events_waits_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_history.frm to /backup/--11_16--/performance_schema/events_waits_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_history_long.frm to /backup/--11_16--/performance_schema/events_waits_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_instance.frm to /backup/--11_16--/performance_schema/events_waits_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /backup/--11_16--/performance_schema/events_waits_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /backup/--11_16--/performance_schema/events_waits_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /backup/--11_16--/performance_schema/events_waits_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /backup/--11_16--/performance_schema/events_waits_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /backup/--11_16--/performance_schema/events_waits_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/file_instances.frm to /backup/--11_16--/performance_schema/file_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/file_summary_by_event_name.frm to /backup/--11_16--/performance_schema/file_summary_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/file_summary_by_instance.frm to /backup/--11_16--/performance_schema/file_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_instances.frm to /backup/--11_16--/performance_schema/socket_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_summary_by_instance.frm to /backup/--11_16--/performance_schema/socket_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_summary_by_event_name.frm to /backup/--11_16--/performance_schema/socket_summary_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/host_cache.frm to /backup/--11_16--/performance_schema/host_cache.frm
:: [] ...done
:: [] Copying ./performance_schema/mutex_instances.frm to /backup/--11_16--/performance_schema/mutex_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/objects_summary_global_by_type.frm to /backup/--11_16--/performance_schema/objects_summary_global_by_type.frm
:: [] ...done
:: [] Copying ./performance_schema/performance_timers.frm to /backup/--11_16--/performance_schema/performance_timers.frm
:: [] ...done
:: [] Copying ./performance_schema/rwlock_instances.frm to /backup/--11_16--/performance_schema/rwlock_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_actors.frm to /backup/--11_16--/performance_schema/setup_actors.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_consumers.frm to /backup/--11_16--/performance_schema/setup_consumers.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_instruments.frm to /backup/--11_16--/performance_schema/setup_instruments.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_objects.frm to /backup/--11_16--/performance_schema/setup_objects.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_timers.frm to /backup/--11_16--/performance_schema/setup_timers.frm
:: [] ...done
:: [] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /backup/--11_16--/performance_schema/table_io_waits_summary_by_index_usage.frm
:: [] ...done
:: [] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /backup/--11_16--/performance_schema/table_io_waits_summary_by_table.frm
:: [] ...done
:: [] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /backup/--11_16--/performance_schema/table_lock_waits_summary_by_table.frm
:: [] ...done
:: [] Copying ./performance_schema/threads.frm to /backup/--11_16--/performance_schema/threads.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_current.frm to /backup/--11_16--/performance_schema/events_stages_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_history.frm to /backup/--11_16--/performance_schema/events_stages_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_history_long.frm to /backup/--11_16--/performance_schema/events_stages_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /backup/--11_16--/performance_schema/events_stages_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /backup/--11_16--/performance_schema/events_stages_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /backup/--11_16--/performance_schema/events_stages_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /backup/--11_16--/performance_schema/events_stages_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /backup/--11_16--/performance_schema/events_stages_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_current.frm to /backup/--11_16--/performance_schema/events_statements_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_history.frm to /backup/--11_16--/performance_schema/events_statements_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_history_long.frm to /backup/--11_16--/performance_schema/events_statements_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /backup/--11_16--/performance_schema/events_statements_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_current.frm to /backup/--11_16--/performance_schema/events_transactions_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_history.frm to /backup/--11_16--/performance_schema/events_transactions_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_history_long.frm to /backup/--11_16--/performance_schema/events_transactions_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_thread_by_event_name.frm to /backup/--11_16--/performance_schema/events_transactions_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_host_by_event_name.frm to /backup/--11_16--/performance_schema/events_transactions_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_user_by_event_name.frm to /backup/--11_16--/performance_schema/events_transactions_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_account_by_event_name.frm to /backup/--11_16--/performance_schema/events_transactions_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_global_by_event_name.frm to /backup/--11_16--/performance_schema/events_transactions_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/hosts.frm to /backup/--11_16--/performance_schema/hosts.frm
:: [] ...done
:: [] Copying ./performance_schema/users.frm to /backup/--11_16--/performance_schema/users.frm
:: [] ...done
:: [] Copying ./performance_schema/accounts.frm to /backup/--11_16--/performance_schema/accounts.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_global_by_event_name.frm to /backup/--11_16--/performance_schema/memory_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_thread_by_event_name.frm to /backup/--11_16--/performance_schema/memory_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_account_by_event_name.frm to /backup/--11_16--/performance_schema/memory_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_host_by_event_name.frm to /backup/--11_16--/performance_schema/memory_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_user_by_event_name.frm to /backup/--11_16--/performance_schema/memory_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_digest.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_digest.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_program.frm to /backup/--11_16--/performance_schema/events_statements_summary_by_program.frm
:: [] ...done
:: [] Copying ./performance_schema/prepared_statements_instances.frm to /backup/--11_16--/performance_schema/prepared_statements_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_connection_configuration.frm to /backup/--11_16--/performance_schema/replication_connection_configuration.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_group_member_stats.frm to /backup/--11_16--/performance_schema/replication_group_member_stats.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_group_members.frm to /backup/--11_16--/performance_schema/replication_group_members.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_connection_status.frm to /backup/--11_16--/performance_schema/replication_connection_status.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_configuration.frm to /backup/--11_16--/performance_schema/replication_applier_configuration.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status.frm to /backup/--11_16--/performance_schema/replication_applier_status.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status_by_coordinator.frm to /backup/--11_16--/performance_schema/replication_applier_status_by_coordinator.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status_by_worker.frm to /backup/--11_16--/performance_schema/replication_applier_status_by_worker.frm
:: [] ...done
:: [] Copying ./performance_schema/session_connect_attrs.frm to /backup/--11_16--/performance_schema/session_connect_attrs.frm
:: [] ...done
:: [] Copying ./performance_schema/session_account_connect_attrs.frm to /backup/--11_16--/performance_schema/session_account_connect_attrs.frm
:: [] ...done
:: [] Copying ./performance_schema/table_handles.frm to /backup/--11_16--/performance_schema/table_handles.frm
:: [] ...done
:: [] Copying ./performance_schema/metadata_locks.frm to /backup/--11_16--/performance_schema/metadata_locks.frm
:: [] ...done
:: [] Copying ./performance_schema/user_variables_by_thread.frm to /backup/--11_16--/performance_schema/user_variables_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/variables_by_thread.frm to /backup/--11_16--/performance_schema/variables_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/global_variables.frm to /backup/--11_16--/performance_schema/global_variables.frm
:: [] ...done
:: [] Copying ./performance_schema/session_variables.frm to /backup/--11_16--/performance_schema/session_variables.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_thread.frm to /backup/--11_16--/performance_schema/status_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_user.frm to /backup/--11_16--/performance_schema/status_by_user.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_host.frm to /backup/--11_16--/performance_schema/status_by_host.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_account.frm to /backup/--11_16--/performance_schema/status_by_account.frm
:: [] ...done
:: [] Copying ./performance_schema/global_status.frm to /backup/--11_16--/performance_schema/global_status.frm
:: [] ...done
:: [] Copying ./performance_schema/session_status.frm to /backup/--11_16--/performance_schema/session_status.frm
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/--11_16--/--06_22--/db.opt
:: [] ...done
:: Finished backing up non-InnoDB tables and files
:: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
xtrabackup: The latest check point (for incremental): ''
xtrabackup: Stopping log copying thread.
. :: >> log scanned up to () :: Executing UNLOCK TABLES
:: All tables unlocked
:: [] Copying ib_buffer_pool to /backup/--11_16--/ib_buffer_pool
:: [] ...done
:: Backup created in directory '/backup/2020-02-11_16-42-47/'
:: [] Writing /backup/--11_16--/backup-my.cnf
:: [] ...done
:: [] Writing /backup/--11_16--/xtrabackup_info
:: [] ...done
xtrabackup: Transaction log of lsn () to () was copied.
:: completed OK!

最终会在备份路径下生成一个以时间"yyyy-mm-dd_hh:mi:ss"的文件。

[root@mysqlserver backup]# pwd
/backup
[root@mysqlserver backup]# ls
--11_16--

(3.2)使用innobackupex执行增量备份

MySQL的增量备份与Oracle RMAN增量备份十分相似,仅仅备份那些发生过改变的块(MySQL叫页,page),Oracle是通过SCN(system changer number)号来记录数据块的改变的,而MySQL是通过LSN(Log Sequence Number)来记录页的改变。每次全备或增量备份时,innobackupex都会在备份集中创建一个名为"xtrabackup_checkpoints"的文件,里面记录了最后修改的LSN号,在后续增量备份中,只要备份比该LSN大的page和二进制日志即可。

执行增量备份的命令如下:

[root@mysqlserver backup]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' --incremental --incremental-basedir=--11_16-- /backup/increm

相对于全备来说,新增了2个参数:

--incremental                :代表创建增量备份

--incremental-basedir   :增量备份需要依赖于某次全备,该参数指定了全备的路径

innobackupex增量备份执行过程如下:

[root@mysqlserver backup]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' --incremental --incremental-basedir=--11_16-- /backup/increment
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data
xtrabackup: recognized client arguments:
:: innobackupex: Starting the backup operation IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!". :: version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.soc' as 'root' (using password: YES).
:: version_check Connected to MySQL server
:: version_check Executing a version check against the server...
:: version_check Done.
:: Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql.soc
Using server version 5.7.
innobackupex version 2.4. based on MySQL server 5.7. Linux (x86_64) (revision id: 29b4ca5)
incremental backup from is enabled.
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /usr/local/mysql/data
xtrabackup: open files limit requested , set to
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group =
xtrabackup: innodb_log_file_size =
InnoDB: Number of pools:
:: >> log scanned up to ()
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID for mysql/plugin, old maximum was
xtrabackup: using the full scan for incremental backup
:: [] Copying ./ibdata1 to /backup/increment/--11_17--/ibdata1.delta
:: [] ...done
:: [] Copying ./mysql/plugin.ibd to /backup/increment/--11_17--/mysql/plugin.ibd.delta
:: [] ...done
:: [] Copying ./mysql/servers.ibd to /backup/increment/--11_17--/mysql/servers.ibd.delta
:: [] ...done
:: [] Copying ./mysql/help_topic.ibd to /backup/increment/--11_17--/mysql/help_topic.ibd.delta
:: [] ...done
:: [] Copying ./mysql/help_category.ibd to /backup/increment/--11_17--/mysql/help_category.ibd.delta
:: [] ...done
:: [] Copying ./mysql/help_relation.ibd to /backup/increment/--11_17--/mysql/help_relation.ibd.delta
:: [] ...done
:: [] Copying ./mysql/help_keyword.ibd to /backup/increment/--11_17--/mysql/help_keyword.ibd.delta
:: [] ...done
:: [] Copying ./mysql/time_zone_name.ibd to /backup/increment/--11_17--/mysql/time_zone_name.ibd.delta
:: [] ...done
:: [] Copying ./mysql/time_zone.ibd to /backup/increment/--11_17--/mysql/time_zone.ibd.delta
:: [] ...done
:: [] Copying ./mysql/time_zone_transition.ibd to /backup/increment/--11_17--/mysql/time_zone_transition.ibd.delta
:: [] ...done
:: [] Copying ./mysql/time_zone_transition_type.ibd to /backup/increment/--11_17--/mysql/time_zone_transition_type.ibd.delta
:: [] ...done
:: [] Copying ./mysql/time_zone_leap_second.ibd to /backup/increment/--11_17--/mysql/time_zone_leap_second.ibd.delta
:: [] ...done
:: [] Copying ./mysql/innodb_table_stats.ibd to /backup/increment/--11_17--/mysql/innodb_table_stats.ibd.delta
:: [] ...done
:: [] Copying ./mysql/innodb_index_stats.ibd to /backup/increment/--11_17--/mysql/innodb_index_stats.ibd.delta
:: [] ...done
:: [] Copying ./mysql/slave_relay_log_info.ibd to /backup/increment/--11_17--/mysql/slave_relay_log_info.ibd.delta
:: [] ...done
:: [] Copying ./mysql/slave_master_info.ibd to /backup/increment/--11_17--/mysql/slave_master_info.ibd.delta
:: [] ...done
:: [] Copying ./mysql/slave_worker_info.ibd to /backup/increment/--11_17--/mysql/slave_worker_info.ibd.delta
:: [] ...done
:: [] Copying ./mysql/gtid_executed.ibd to /backup/increment/--11_17--/mysql/gtid_executed.ibd.delta
:: [] ...done
:: [] Copying ./mysql/server_cost.ibd to /backup/increment/--11_17--/mysql/server_cost.ibd.delta
:: [] ...done
:: [] Copying ./mysql/engine_cost.ibd to /backup/increment/--11_17--/mysql/engine_cost.ibd.delta
:: [] ...done
:: [] Copying ./sys/sys_config.ibd to /backup/increment/--11_17--/sys/sys_config.ibd.delta
:: [] ...done
:: [] Copying ./test_database/test01.ibd to /backup/increment/--11_17--/test_database/test01.ibd.delta
:: [] ...done
:: >> log scanned up to ()
:: Executing FLUSH NO_WRITE_TO_BINLOG TABLES...
:: Executing FLUSH TABLES WITH READ LOCK...
:: Starting to backup non-InnoDB tables and files
:: [] Copying ./mysql/db.opt to /backup/increment/--11_17--/mysql/db.opt
:: [] ...done
:: [] Copying ./mysql/db.frm to /backup/increment/--11_17--/mysql/db.frm
:: [] ...done
:: [] Copying ./mysql/db.MYI to /backup/increment/--11_17--/mysql/db.MYI
:: [] ...done
:: [] Copying ./mysql/db.MYD to /backup/increment/--11_17--/mysql/db.MYD
:: [] ...done
:: [] Copying ./mysql/user.frm to /backup/increment/--11_17--/mysql/user.frm
:: [] ...done
:: [] Copying ./mysql/user.MYI to /backup/increment/--11_17--/mysql/user.MYI
:: [] ...done
:: [] Copying ./mysql/user.MYD to /backup/increment/--11_17--/mysql/user.MYD
:: [] ...done
:: [] Copying ./mysql/func.frm to /backup/increment/--11_17--/mysql/func.frm
:: [] ...done
:: [] Copying ./mysql/func.MYI to /backup/increment/--11_17--/mysql/func.MYI
:: [] ...done
:: [] Copying ./mysql/func.MYD to /backup/increment/--11_17--/mysql/func.MYD
:: [] ...done
:: [] Copying ./mysql/plugin.frm to /backup/increment/--11_17--/mysql/plugin.frm
:: [] ...done
:: [] Copying ./mysql/servers.frm to /backup/increment/--11_17--/mysql/servers.frm
:: [] ...done
:: [] Copying ./mysql/tables_priv.frm to /backup/increment/--11_17--/mysql/tables_priv.frm
:: [] ...done
:: [] Copying ./mysql/tables_priv.MYI to /backup/increment/--11_17--/mysql/tables_priv.MYI
:: [] ...done
:: [] Copying ./mysql/tables_priv.MYD to /backup/increment/--11_17--/mysql/tables_priv.MYD
:: [] ...done
:: [] Copying ./mysql/columns_priv.frm to /backup/increment/--11_17--/mysql/columns_priv.frm
:: [] ...done
:: [] Copying ./mysql/columns_priv.MYI to /backup/increment/--11_17--/mysql/columns_priv.MYI
:: [] ...done
:: [] Copying ./mysql/columns_priv.MYD to /backup/increment/--11_17--/mysql/columns_priv.MYD
:: [] ...done
:: [] Copying ./mysql/help_topic.frm to /backup/increment/--11_17--/mysql/help_topic.frm
:: [] ...done
:: [] Copying ./mysql/help_category.frm to /backup/increment/--11_17--/mysql/help_category.frm
:: [] ...done
:: [] Copying ./mysql/help_relation.frm to /backup/increment/--11_17--/mysql/help_relation.frm
:: [] ...done
:: [] Copying ./mysql/help_keyword.frm to /backup/increment/--11_17--/mysql/help_keyword.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_name.frm to /backup/increment/--11_17--/mysql/time_zone_name.frm
:: [] ...done
:: [] Copying ./mysql/time_zone.frm to /backup/increment/--11_17--/mysql/time_zone.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_transition.frm to /backup/increment/--11_17--/mysql/time_zone_transition.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_transition_type.frm to /backup/increment/--11_17--/mysql/time_zone_transition_type.frm
:: [] ...done
:: [] Copying ./mysql/time_zone_leap_second.frm to /backup/increment/--11_17--/mysql/time_zone_leap_second.frm
:: [] ...done
:: [] Copying ./mysql/proc.frm to /backup/increment/--11_17--/mysql/proc.frm
:: [] ...done
:: [] Copying ./mysql/proc.MYI to /backup/increment/--11_17--/mysql/proc.MYI
:: [] ...done
:: [] Copying ./mysql/proc.MYD to /backup/increment/--11_17--/mysql/proc.MYD
:: [] ...done
:: [] Copying ./mysql/procs_priv.frm to /backup/increment/--11_17--/mysql/procs_priv.frm
:: [] ...done
:: [] Copying ./mysql/procs_priv.MYI to /backup/increment/--11_17--/mysql/procs_priv.MYI
:: [] ...done
:: [] Copying ./mysql/procs_priv.MYD to /backup/increment/--11_17--/mysql/procs_priv.MYD
:: [] ...done
:: [] Copying ./mysql/general_log.frm to /backup/increment/--11_17--/mysql/general_log.frm
:: [] ...done
:: [] Copying ./mysql/general_log.CSM to /backup/increment/--11_17--/mysql/general_log.CSM
:: [] ...done
:: [] Copying ./mysql/general_log.CSV to /backup/increment/--11_17--/mysql/general_log.CSV
:: [] ...done
:: [] Copying ./mysql/slow_log.frm to /backup/increment/--11_17--/mysql/slow_log.frm
:: [] ...done
:: [] Copying ./mysql/slow_log.CSM to /backup/increment/--11_17--/mysql/slow_log.CSM
:: [] ...done
:: [] Copying ./mysql/slow_log.CSV to /backup/increment/--11_17--/mysql/slow_log.CSV
:: [] ...done
:: [] Copying ./mysql/event.frm to /backup/increment/--11_17--/mysql/event.frm
:: [] ...done
:: [] Copying ./mysql/event.MYI to /backup/increment/--11_17--/mysql/event.MYI
:: [] ...done
:: [] Copying ./mysql/event.MYD to /backup/increment/--11_17--/mysql/event.MYD
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.frm to /backup/increment/--11_17--/mysql/ndb_binlog_index.frm
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.MYI to /backup/increment/--11_17--/mysql/ndb_binlog_index.MYI
:: [] ...done
:: [] Copying ./mysql/ndb_binlog_index.MYD to /backup/increment/--11_17--/mysql/ndb_binlog_index.MYD
:: [] ...done
:: [] Copying ./mysql/innodb_table_stats.frm to /backup/increment/--11_17--/mysql/innodb_table_stats.frm
:: [] ...done
:: [] Copying ./mysql/innodb_index_stats.frm to /backup/increment/--11_17--/mysql/innodb_index_stats.frm
:: [] ...done
:: [] Copying ./mysql/slave_relay_log_info.frm to /backup/increment/--11_17--/mysql/slave_relay_log_info.frm
:: [] ...done
:: [] Copying ./mysql/slave_master_info.frm to /backup/increment/--11_17--/mysql/slave_master_info.frm
:: [] ...done
:: [] Copying ./mysql/slave_worker_info.frm to /backup/increment/--11_17--/mysql/slave_worker_info.frm
:: [] ...done
:: [] Copying ./mysql/gtid_executed.frm to /backup/increment/--11_17--/mysql/gtid_executed.frm
:: [] ...done
:: [] Copying ./mysql/server_cost.frm to /backup/increment/--11_17--/mysql/server_cost.frm
:: [] ...done
:: [] Copying ./mysql/engine_cost.frm to /backup/increment/--11_17--/mysql/engine_cost.frm
:: [] ...done
:: [] Copying ./mysql/proxies_priv.frm to /backup/increment/--11_17--/mysql/proxies_priv.frm
:: [] ...done
:: [] Copying ./mysql/proxies_priv.MYI to /backup/increment/--11_17--/mysql/proxies_priv.MYI
:: [] ...done
:: [] Copying ./mysql/proxies_priv.MYD to /backup/increment/--11_17--/mysql/proxies_priv.MYD
:: [] ...done
:: [] Copying ./sys/db.opt to /backup/increment/--11_17--/sys/db.opt
:: [] ...done
:: [] Copying ./sys/version.frm to /backup/increment/--11_17--/sys/version.frm
:: [] ...done
:: [] Copying ./sys/sys_config.frm to /backup/increment/--11_17--/sys/sys_config.frm
:: [] ...done
:: [] Copying ./sys/statements_with_full_table_scans.frm to /backup/increment/--11_17--/sys/statements_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/sys_config_insert_set_user.TRN to /backup/increment/--11_17--/sys/sys_config_insert_set_user.TRN
:: [] ...done
:: [] Copying ./sys/processlist.frm to /backup/increment/--11_17--/sys/processlist.frm
:: [] ...done
:: [] Copying ./sys/sys_config.TRG to /backup/increment/--11_17--/sys/sys_config.TRG
:: [] ...done
:: [] Copying ./sys/statements_with_sorting.frm to /backup/increment/--11_17--/sys/statements_with_sorting.frm
:: [] ...done
:: [] Copying ./sys/sys_config_update_set_user.TRN to /backup/increment/--11_17--/sys/sys_config_update_set_user.TRN
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_sorting.frm to /backup/increment/--11_17--/sys/x@0024statements_with_sorting.frm
:: [] ...done
:: [] Copying ./sys/innodb_buffer_stats_by_schema.frm to /backup/increment/--11_17--/sys/innodb_buffer_stats_by_schema.frm
:: [] ...done
:: [] Copying ./sys/schema_index_statistics.frm to /backup/increment/--11_17--/sys/schema_index_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_buffer_stats_by_schema.frm to /backup/increment/--11_17--/sys/x@0024innodb_buffer_stats_by_schema.frm
:: [] ...done
:: [] Copying ./sys/statements_with_temp_tables.frm to /backup/increment/--11_17--/sys/statements_with_temp_tables.frm
:: [] ...done
:: [] Copying ./sys/innodb_buffer_stats_by_table.frm to /backup/increment/--11_17--/sys/innodb_buffer_stats_by_table.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_schema_table_statistics_io.frm to /backup/increment/--11_17--/sys/x@0024ps_schema_table_statistics_io.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_buffer_stats_by_table.frm to /backup/increment/--11_17--/sys/x@0024innodb_buffer_stats_by_table.frm
:: [] ...done
:: [] Copying ./sys/host_summary.frm to /backup/increment/--11_17--/sys/host_summary.frm
:: [] ...done
:: [] Copying ./sys/innodb_lock_waits.frm to /backup/increment/--11_17--/sys/innodb_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary.frm to /backup/increment/--11_17--/sys/x@0024host_summary.frm
:: [] ...done
:: [] Copying ./sys/x@0024innodb_lock_waits.frm to /backup/increment/--11_17--/sys/x@0024innodb_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/waits_by_user_by_latency.frm to /backup/increment/--11_17--/sys/waits_by_user_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_object_overview.frm to /backup/increment/--11_17--/sys/schema_object_overview.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_file_io_type.frm to /backup/increment/--11_17--/sys/user_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/schema_auto_increment_columns.frm to /backup/increment/--11_17--/sys/schema_auto_increment_columns.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_file_io.frm to /backup/increment/--11_17--/sys/user_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_flattened_keys.frm to /backup/increment/--11_17--/sys/x@0024schema_flattened_keys.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_file_io.frm to /backup/increment/--11_17--/sys/x@0024user_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/schema_redundant_indexes.frm to /backup/increment/--11_17--/sys/schema_redundant_indexes.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_statement_type.frm to /backup/increment/--11_17--/sys/user_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/ps_check_lost_instrumentation.frm to /backup/increment/--11_17--/sys/ps_check_lost_instrumentation.frm
:: [] ...done
:: [] Copying ./sys/latest_file_io.frm to /backup/increment/--11_17--/sys/latest_file_io.frm
:: [] ...done
:: [] Copying ./sys/waits_by_host_by_latency.frm to /backup/increment/--11_17--/sys/waits_by_host_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024latest_file_io.frm to /backup/increment/--11_17--/sys/x@0024latest_file_io.frm
:: [] ...done
:: [] Copying ./sys/waits_global_by_latency.frm to /backup/increment/--11_17--/sys/waits_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/io_by_thread_by_latency.frm to /backup/increment/--11_17--/sys/io_by_thread_by_latency.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_stages.frm to /backup/increment/--11_17--/sys/user_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_by_thread_by_latency.frm to /backup/increment/--11_17--/sys/x@0024io_by_thread_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_stages.frm to /backup/increment/--11_17--/sys/x@0024user_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_file_by_bytes.frm to /backup/increment/--11_17--/sys/io_global_by_file_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_index_statistics.frm to /backup/increment/--11_17--/sys/x@0024schema_index_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_file_by_bytes.frm to /backup/increment/--11_17--/sys/x@0024io_global_by_file_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/user_summary.frm to /backup/increment/--11_17--/sys/user_summary.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_file_by_latency.frm to /backup/increment/--11_17--/sys/io_global_by_file_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_table_statistics.frm to /backup/increment/--11_17--/sys/schema_table_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_file_by_latency.frm to /backup/increment/--11_17--/sys/x@0024io_global_by_file_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary.frm to /backup/increment/--11_17--/sys/x@0024user_summary.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_wait_by_bytes.frm to /backup/increment/--11_17--/sys/io_global_by_wait_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_statistics.frm to /backup/increment/--11_17--/sys/x@0024schema_table_statistics.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_wait_by_bytes.frm to /backup/increment/--11_17--/sys/x@0024io_global_by_wait_by_bytes.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_file_io_type.frm to /backup/increment/--11_17--/sys/host_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/io_global_by_wait_by_latency.frm to /backup/increment/--11_17--/sys/io_global_by_wait_by_latency.frm
:: [] ...done
:: [] Copying ./sys/schema_table_statistics_with_buffer.frm to /backup/increment/--11_17--/sys/schema_table_statistics_with_buffer.frm
:: [] ...done
:: [] Copying ./sys/x@0024io_global_by_wait_by_latency.frm to /backup/increment/--11_17--/sys/x@0024io_global_by_wait_by_latency.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_file_io.frm to /backup/increment/--11_17--/sys/host_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/memory_by_user_by_current_bytes.frm to /backup/increment/--11_17--/sys/memory_by_user_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/schema_table_lock_waits.frm to /backup/increment/--11_17--/sys/schema_table_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_user_by_current_bytes.frm to /backup/increment/--11_17--/sys/x@0024memory_by_user_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_file_io.frm to /backup/increment/--11_17--/sys/x@0024host_summary_by_file_io.frm
:: [] ...done
:: [] Copying ./sys/memory_by_host_by_current_bytes.frm to /backup/increment/--11_17--/sys/memory_by_host_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_lock_waits.frm to /backup/increment/--11_17--/sys/x@0024schema_table_lock_waits.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_host_by_current_bytes.frm to /backup/increment/--11_17--/sys/x@0024memory_by_host_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/statement_analysis.frm to /backup/increment/--11_17--/sys/statement_analysis.frm
:: [] ...done
:: [] Copying ./sys/memory_by_thread_by_current_bytes.frm to /backup/increment/--11_17--/sys/memory_by_thread_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/x@0024statement_analysis.frm to /backup/increment/--11_17--/sys/x@0024statement_analysis.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_by_thread_by_current_bytes.frm to /backup/increment/--11_17--/sys/x@0024memory_by_thread_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_statement_type.frm to /backup/increment/--11_17--/sys/host_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/memory_global_by_current_bytes.frm to /backup/increment/--11_17--/sys/memory_global_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/statements_with_errors_or_warnings.frm to /backup/increment/--11_17--/sys/statements_with_errors_or_warnings.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_global_by_current_bytes.frm to /backup/increment/--11_17--/sys/x@0024memory_global_by_current_bytes.frm
:: [] ...done
:: [] Copying ./sys/metrics.frm to /backup/increment/--11_17--/sys/metrics.frm
:: [] ...done
:: [] Copying ./sys/memory_global_total.frm to /backup/increment/--11_17--/sys/memory_global_total.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_stages.frm to /backup/increment/--11_17--/sys/host_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024memory_global_total.frm to /backup/increment/--11_17--/sys/x@0024memory_global_total.frm
:: [] ...done
:: [] Copying ./sys/session.frm to /backup/increment/--11_17--/sys/session.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_table_statistics_with_buffer.frm to /backup/increment/--11_17--/sys/x@0024schema_table_statistics_with_buffer.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_errors_or_warnings.frm to /backup/increment/--11_17--/sys/x@0024statements_with_errors_or_warnings.frm
:: [] ...done
:: [] Copying ./sys/schema_tables_with_full_table_scans.frm to /backup/increment/--11_17--/sys/schema_tables_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/schema_unused_indexes.frm to /backup/increment/--11_17--/sys/schema_unused_indexes.frm
:: [] ...done
:: [] Copying ./sys/x@0024schema_tables_with_full_table_scans.frm to /backup/increment/--11_17--/sys/x@0024schema_tables_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_stages.frm to /backup/increment/--11_17--/sys/x@0024host_summary_by_stages.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_full_table_scans.frm to /backup/increment/--11_17--/sys/x@0024statements_with_full_table_scans.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_digest_avg_latency_distribution.frm to /backup/increment/--11_17--/sys/x@0024ps_digest_avg_latency_distribution.frm
:: [] ...done
:: [] Copying ./sys/x@0024ps_digest_95th_percentile_by_avg_us.frm to /backup/increment/--11_17--/sys/x@0024ps_digest_95th_percentile_by_avg_us.frm
:: [] ...done
:: [] Copying ./sys/statements_with_runtimes_in_95th_percentile.frm to /backup/increment/--11_17--/sys/statements_with_runtimes_in_95th_percentile.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_runtimes_in_95th_percentile.frm to /backup/increment/--11_17--/sys/x@0024statements_with_runtimes_in_95th_percentile.frm
:: [] ...done
:: [] Copying ./sys/x@0024statements_with_temp_tables.frm to /backup/increment/--11_17--/sys/x@0024statements_with_temp_tables.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_file_io_type.frm to /backup/increment/--11_17--/sys/x@0024user_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_statement_type.frm to /backup/increment/--11_17--/sys/x@0024user_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/user_summary_by_statement_latency.frm to /backup/increment/--11_17--/sys/user_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024user_summary_by_statement_latency.frm to /backup/increment/--11_17--/sys/x@0024user_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_file_io_type.frm to /backup/increment/--11_17--/sys/x@0024host_summary_by_file_io_type.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_statement_type.frm to /backup/increment/--11_17--/sys/x@0024host_summary_by_statement_type.frm
:: [] ...done
:: [] Copying ./sys/host_summary_by_statement_latency.frm to /backup/increment/--11_17--/sys/host_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024host_summary_by_statement_latency.frm to /backup/increment/--11_17--/sys/x@0024host_summary_by_statement_latency.frm
:: [] ...done
:: [] Copying ./sys/wait_classes_global_by_avg_latency.frm to /backup/increment/--11_17--/sys/wait_classes_global_by_avg_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024wait_classes_global_by_avg_latency.frm to /backup/increment/--11_17--/sys/x@0024wait_classes_global_by_avg_latency.frm
:: [] ...done
:: [] Copying ./sys/wait_classes_global_by_latency.frm to /backup/increment/--11_17--/sys/wait_classes_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024wait_classes_global_by_latency.frm to /backup/increment/--11_17--/sys/x@0024wait_classes_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_by_user_by_latency.frm to /backup/increment/--11_17--/sys/x@0024waits_by_user_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_by_host_by_latency.frm to /backup/increment/--11_17--/sys/x@0024waits_by_host_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024waits_global_by_latency.frm to /backup/increment/--11_17--/sys/x@0024waits_global_by_latency.frm
:: [] ...done
:: [] Copying ./sys/x@0024processlist.frm to /backup/increment/--11_17--/sys/x@0024processlist.frm
:: [] ...done
:: [] Copying ./sys/x@0024session.frm to /backup/increment/--11_17--/sys/x@0024session.frm
:: [] ...done
:: [] Copying ./sys/session_ssl_status.frm to /backup/increment/--11_17--/sys/session_ssl_status.frm
:: [] ...done
:: [] Copying ./test_database/db.opt to /backup/increment/--11_17--/test_database/db.opt
:: [] ...done
:: [] Copying ./test_database/test01.frm to /backup/increment/--11_17--/test_database/test01.frm
:: [] ...done
:: [] Copying ./performance_schema/db.opt to /backup/increment/--11_17--/performance_schema/db.opt
:: [] ...done
:: [] Copying ./performance_schema/cond_instances.frm to /backup/increment/--11_17--/performance_schema/cond_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_current.frm to /backup/increment/--11_17--/performance_schema/events_waits_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_history.frm to /backup/increment/--11_17--/performance_schema/events_waits_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_history_long.frm to /backup/increment/--11_17--/performance_schema/events_waits_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_instance.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_waits_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/file_instances.frm to /backup/increment/--11_17--/performance_schema/file_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/file_summary_by_event_name.frm to /backup/increment/--11_17--/performance_schema/file_summary_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/file_summary_by_instance.frm to /backup/increment/--11_17--/performance_schema/file_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_instances.frm to /backup/increment/--11_17--/performance_schema/socket_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_summary_by_instance.frm to /backup/increment/--11_17--/performance_schema/socket_summary_by_instance.frm
:: [] ...done
:: [] Copying ./performance_schema/socket_summary_by_event_name.frm to /backup/increment/--11_17--/performance_schema/socket_summary_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/host_cache.frm to /backup/increment/--11_17--/performance_schema/host_cache.frm
:: [] ...done
:: [] Copying ./performance_schema/mutex_instances.frm to /backup/increment/--11_17--/performance_schema/mutex_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/objects_summary_global_by_type.frm to /backup/increment/--11_17--/performance_schema/objects_summary_global_by_type.frm
:: [] ...done
:: [] Copying ./performance_schema/performance_timers.frm to /backup/increment/--11_17--/performance_schema/performance_timers.frm
:: [] ...done
:: [] Copying ./performance_schema/rwlock_instances.frm to /backup/increment/--11_17--/performance_schema/rwlock_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_actors.frm to /backup/increment/--11_17--/performance_schema/setup_actors.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_consumers.frm to /backup/increment/--11_17--/performance_schema/setup_consumers.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_instruments.frm to /backup/increment/--11_17--/performance_schema/setup_instruments.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_objects.frm to /backup/increment/--11_17--/performance_schema/setup_objects.frm
:: [] ...done
:: [] Copying ./performance_schema/setup_timers.frm to /backup/increment/--11_17--/performance_schema/setup_timers.frm
:: [] ...done
:: [] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /backup/increment/--11_17--/performance_schema/table_io_waits_summary_by_index_usage.frm
:: [] ...done
:: [] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /backup/increment/--11_17--/performance_schema/table_io_waits_summary_by_table.frm
:: [] ...done
:: [] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /backup/increment/--11_17--/performance_schema/table_lock_waits_summary_by_table.frm
:: [] ...done
:: [] Copying ./performance_schema/threads.frm to /backup/increment/--11_17--/performance_schema/threads.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_current.frm to /backup/increment/--11_17--/performance_schema/events_stages_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_history.frm to /backup/increment/--11_17--/performance_schema/events_stages_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_history_long.frm to /backup/increment/--11_17--/performance_schema/events_stages_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_stages_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_stages_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_stages_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_stages_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_stages_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_current.frm to /backup/increment/--11_17--/performance_schema/events_statements_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_history.frm to /backup/increment/--11_17--/performance_schema/events_statements_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_history_long.frm to /backup/increment/--11_17--/performance_schema/events_statements_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_current.frm to /backup/increment/--11_17--/performance_schema/events_transactions_current.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_history.frm to /backup/increment/--11_17--/performance_schema/events_transactions_history.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_history_long.frm to /backup/increment/--11_17--/performance_schema/events_transactions_history_long.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_thread_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_transactions_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_host_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_transactions_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_user_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_transactions_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_by_account_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_transactions_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_transactions_summary_global_by_event_name.frm to /backup/increment/--11_17--/performance_schema/events_transactions_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/hosts.frm to /backup/increment/--11_17--/performance_schema/hosts.frm
:: [] ...done
:: [] Copying ./performance_schema/users.frm to /backup/increment/--11_17--/performance_schema/users.frm
:: [] ...done
:: [] Copying ./performance_schema/accounts.frm to /backup/increment/--11_17--/performance_schema/accounts.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_global_by_event_name.frm to /backup/increment/--11_17--/performance_schema/memory_summary_global_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_thread_by_event_name.frm to /backup/increment/--11_17--/performance_schema/memory_summary_by_thread_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_account_by_event_name.frm to /backup/increment/--11_17--/performance_schema/memory_summary_by_account_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_host_by_event_name.frm to /backup/increment/--11_17--/performance_schema/memory_summary_by_host_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/memory_summary_by_user_by_event_name.frm to /backup/increment/--11_17--/performance_schema/memory_summary_by_user_by_event_name.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_digest.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_digest.frm
:: [] ...done
:: [] Copying ./performance_schema/events_statements_summary_by_program.frm to /backup/increment/--11_17--/performance_schema/events_statements_summary_by_program.frm
:: [] ...done
:: [] Copying ./performance_schema/prepared_statements_instances.frm to /backup/increment/--11_17--/performance_schema/prepared_statements_instances.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_connection_configuration.frm to /backup/increment/--11_17--/performance_schema/replication_connection_configuration.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_group_member_stats.frm to /backup/increment/--11_17--/performance_schema/replication_group_member_stats.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_group_members.frm to /backup/increment/--11_17--/performance_schema/replication_group_members.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_connection_status.frm to /backup/increment/--11_17--/performance_schema/replication_connection_status.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_configuration.frm to /backup/increment/--11_17--/performance_schema/replication_applier_configuration.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status.frm to /backup/increment/--11_17--/performance_schema/replication_applier_status.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status_by_coordinator.frm to /backup/increment/--11_17--/performance_schema/replication_applier_status_by_coordinator.frm
:: [] ...done
:: [] Copying ./performance_schema/replication_applier_status_by_worker.frm to /backup/increment/--11_17--/performance_schema/replication_applier_status_by_worker.frm
:: [] ...done
:: [] Copying ./performance_schema/session_connect_attrs.frm to /backup/increment/--11_17--/performance_schema/session_connect_attrs.frm
:: [] ...done
:: [] Copying ./performance_schema/session_account_connect_attrs.frm to /backup/increment/--11_17--/performance_schema/session_account_connect_attrs.frm
:: [] ...done
:: [] Copying ./performance_schema/table_handles.frm to /backup/increment/--11_17--/performance_schema/table_handles.frm
:: [] ...done
:: [] Copying ./performance_schema/metadata_locks.frm to /backup/increment/--11_17--/performance_schema/metadata_locks.frm
:: [] ...done
:: [] Copying ./performance_schema/user_variables_by_thread.frm to /backup/increment/--11_17--/performance_schema/user_variables_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/variables_by_thread.frm to /backup/increment/--11_17--/performance_schema/variables_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/global_variables.frm to /backup/increment/--11_17--/performance_schema/global_variables.frm
:: [] ...done
:: [] Copying ./performance_schema/session_variables.frm to /backup/increment/--11_17--/performance_schema/session_variables.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_thread.frm to /backup/increment/--11_17--/performance_schema/status_by_thread.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_user.frm to /backup/increment/--11_17--/performance_schema/status_by_user.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_host.frm to /backup/increment/--11_17--/performance_schema/status_by_host.frm
:: [] ...done
:: [] Copying ./performance_schema/status_by_account.frm to /backup/increment/--11_17--/performance_schema/status_by_account.frm
:: [] ...done
:: [] Copying ./performance_schema/global_status.frm to /backup/increment/--11_17--/performance_schema/global_status.frm
:: [] ...done
:: [] Copying ./performance_schema/session_status.frm to /backup/increment/--11_17--/performance_schema/session_status.frm
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: [] Writing /backup/increment/--11_17--/--06_22--/db.opt
:: [] ...done
:: Finished backing up non-InnoDB tables and files
:: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
xtrabackup: The latest check point (for incremental): ''
xtrabackup: Stopping log copying thread.
. :: >> log scanned up to () :: Executing UNLOCK TABLES
:: All tables unlocked
:: [] Copying ib_buffer_pool to /backup/increment/--11_17--/ib_buffer_pool
:: [] ...done
:: Backup created in directory '/backup/increment/2020-02-11_17-08-13/'
:: [] Writing /backup/increment/--11_17--/backup-my.cnf
:: [] ...done
:: [] Writing /backup/increment/--11_17--/xtrabackup_info
:: [] ...done
xtrabackup: Transaction log of lsn () to () was copied.
:: completed OK!

与全备一样,会在备份路径下生成一个以时间"yyyy-mm-dd_hh:mi:ss"的文件。

[root@mysqlserver increment]# pwd
/backup/increment
[root@mysqlserver increment]# ls
--11_17--

(四)使用innobackupex恢复数据库

从恢复类别上来看,在使innobackupex来恢复数据库时,有全量恢复和增量恢复2种,全量恢复就是恢复全备后的数据库,增量恢复则是先做全量恢复,在对增量备份的数据进行恢复。不管是全量恢复还是增量恢复。都需要执行2个步骤:

  • 准备恢复(prepare)。在执行完备份后,数据集是不能直接拿来使用的,因为备份的数据文件中可能包含未提交的事物或者已经提交但数据还未保存到数据文件中的事物,准备恢复的过程就是先前滚redo日志中发生的改变,再回滚未提交的事物,总而使数据文件达到一致性状态。对于innobackupex来说,准备恢复对应的参数是"--apply-log"。
  • 执行恢复(copy-back)。将已经准备好的备份集,恢复到指定的路径(datadir参数)下。对于innobackupex来说,准备恢复对应的参数是"--copy-back"。

(4.1)使用innobackupex执行全量恢复

执行全量恢复的命令如下:

# 准备恢复
innobackupex --default-file=/etc/my.cnf --apply-log /path/to/BACKUP-DIR # 执行恢复
innobackupex --default-file=/etc/my.cnf --copy-back /path/to/BACKUP-DIR

全量恢复例子:

STEP1:执行完整备份
[root@mysqlserver backup]#innobackupex --user=root --password='' --default-file='/etc/my.cnf' /backup/ STEP2:删除测试数据库lijiamandb,并关闭数据库
[root@mysqlserver backup]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) mysql> drop database lijiamandb;
Query OK, rows affected (0.01 sec) mysql> exit
Bye
[root@mysqlserver backup]# service mysqld stop
Shutting down MySQL.... SUCCESS! STEP3:准备还原数据库
[root@mysqlserver backup]# innobackupex --default-file=/etc/my.cnf --apply-log /backup/--11_18--
xtrabackup: recognized server arguments: --innodb_checksum_algorithm=crc32 --innodb_log_checksum_algorithm=strict_crc32 --innodb_data_file_path=ibdata1:12M:autoextend
--innodb_log_files_in_group= --innodb_log_file_size= --innodb_fast_checksum= --innodb_page_size= --innodb_log_block_size= --innodb_undo_directory=./
--innodb_undo_tablespaces= --server-id= --redo-log-version=
xtrabackup: recognized client arguments:
:: innobackupex: Starting the apply-log operation IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex
prints "completed OK!". innobackupex version 2.4. based on MySQL server 5.7. Linux (x86_64) (revision id: 29b4ca5)
xtrabackup: cd to /backup/--11_18--/
...省略
InnoDB: File './ibtmp1' size is now MB.
InnoDB: redo rollback segment(s) found. redo rollback segment(s) are active.
InnoDB: non-redo rollback segment(s) are active.
InnoDB: 5.7. started; log sequence number
xtrabackup: starting shutdown with innodb_fast_shutdown =
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number
:: completed OK! STEP4:开始还原数据库
# 注意:在开始还原之前,需要保证数据文件存放位置(datadir)文件为空,否则会报错
[root@mysqlserver backup]# innobackupex --default-file=/etc/my.cnf --copy-back /backup/--11_18--
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data
xtrabackup: recognized client arguments:
:: innobackupex: Starting the copy-back operation IMPORTANT: Please check that the copy-back run completes successfully.
At the end of a successful copy-back run innobackupex
prints "completed OK!". innobackupex version 2.4. based on MySQL server 5.7. Linux (x86_64) (revision id: 29b4ca5)
Original data directory /usr/local/mysql/data is not empty! [root@mysqlserver data]# rm -rf * # 开始还原数据库
[root@mysqlserver backup]# innobackupex --default-file=/etc/my.cnf --copy-back /backup/--11_18--
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data
xtrabackup: recognized client arguments:
:: innobackupex: Starting the copy-back operation IMPORTANT: Please check that the copy-back run completes successfully.
At the end of a successful copy-back run innobackupex
prints "completed OK!". innobackupex version 2.4. based on MySQL server 5.7. Linux (x86_64) (revision id: 29b4ca5)
:: [] Copying ib_logfile0 to /usr/local/mysql/data/ib_logfile0
:: [] ...done
...省略
:: [] ...done
:: [] Copying ./xtrabackup_info to /usr/local/mysql/data/xtrabackup_info
:: [] ...done
:: [] Copying ./xtrabackup_master_key_id to /usr/local/mysql/data/xtrabackup_master_key_id
:: [] ...done
:: [] Copying ./ibtmp1 to /usr/local/mysql/data/ibtmp1
:: [] ...done
:: completed OK! STEP5:修改还原文件的权限为mysql:mysql
[root@mysqlserver data]# ls -l
total
-rw-r----- root root Feb : ib_buffer_pool
-rw-r----- root root Feb : ibdata1
-rw-r----- root root Feb : ib_logfile0
-rw-r----- root root Feb : ib_logfile1
-rw-r----- root root Feb : ibtmp1
drwxr-x--- root root Feb : lijiamandb
drwxr-x--- root root Feb : mysql
drwxr-x--- root root Feb : performance_schema
drwxr-x--- root root Feb : sys
-rw-r----- root root Feb : xtrabackup_info
-rw-r----- root root Feb : xtrabackup_master_key_id
[root@mysqlserver data]# cd ..
[root@mysqlserver mysql]# pwd
/usr/local/mysql
[root@mysqlserver mysql]# chown -R mysql:mysql data/ STEP6:重启数据库
[root@mysqlserver backup]# service mysqld start
Starting MySQL.Logging to '/usr/local/mysql/data/mysqlserver.err'.
SUCCESS! STEP7:确认数据库是否恢复
[root@mysqlserver backup]# mysql -uroot -p123456 Server version: 5.7. MySQL Community Server (GPL) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lijiamandb |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.00 sec)

(4.2)使用innobackupex执行增量恢复

执行增量恢复的命令如下:

# 对全量备份执行恢复准备
innobackupex --default-file=/etc/my.cnf --apply-log --redo-only /path/to/FULL_BACKUP-DIR # 对增量备份1执行恢复准备
innobackupex --default-file=/etc/my.cnf --apply-log --redo-only /path/to/FULL_BACKUP-DIR --incremental-dir=/path/to/INCR_BACKUP-DIR_1 # 对增量备份执行恢复准备
# 需要注意的是,这里没有了--redo-log,在应用增量备份时,最后一份增量备份集不需要指定该参数
innobackupex --default-file=/etc/my.cnf --apply-log /path/to/FULL_BACKUP-DIR --incremental-dir=/path/to/INCR_BACKUP-DIR_2 # 执行恢复
innobackupex --default-file=/etc/my.cnf --copy-back /path/to/FULL_BACKUP-DIR

增量恢复例子:

STEP1:执行全量备份
[root@mysqlserver backup]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' /backup/ STEP2:在全量备份的基础上执行增量备份
[root@mysqlserver backup]# innobackupex --user=root --password='' --default-file='/etc/my.cnf' --incremental --incremental-basedir=--11_20-- /backup/ STEP3:删除测试数据,看最终是否可以恢复回来
[root@mysqlserver backup]# mysql -uroot -p123456 mysql> use lijiamandb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed mysql> select count(*) from test01;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.01 sec) mysql> select count(*) from test02;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.00 sec) mysql> truncate table test01;
Query OK, rows affected (0.00 sec) mysql> delete table test02; mysql> delete from test02;
Query OK, rows affected (0.02 sec) mysql> select count(*) from test01;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.00 sec) mysql> select count(*) from test02;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.00 sec) mysql> exit
Bye STEP4:关闭数据库
[root@mysqlserver backup]# service mysqld status
SUCCESS! MySQL running () [root@mysqlserver backup]# service mysqld stop
Shutting down MySQL.... SUCCESS! STEP5:准备全量备份
[root@mysqlserver backup]# ls -lrt
total
drwxr-x--- root root Feb : --11_20-- #全量备份
drwxr-x--- root root Feb : --11_20-- #增量备份 [root@mysqlserver backup]# innobackupex --default-file=/etc/my.cnf --apply-log --redo-only /backup/--11_20--
b_fast_checksum= --innodb_page_size= --innodb_log_block_size= --innodb_undo_directory=./ --innodb_undo_tablespaces= --server-id= --redo-log-version=
xtrabackup: recognized client arguments:
...省略
InnoDB: Doing recovery: scanned up to log sequence number (%)
InnoDB: Database was not shutdown normally!
InnoDB: Starting crash recovery. xtrabackup: starting shutdown with innodb_fast_shutdown =
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number
InnoDB: Number of pools:
:: completed OK! STEP6:准备增量备份
[root@mysqlserver backup]# innobackupex --default-file=/etc/my.cnf --apply-log /backup/--11_20-- --incremental-dir=/backup/--11_20--
b_fast_checksum= --innodb_page_size= --innodb_log_block_size= --innodb_undo_directory=./ --innodb_undo_tablespaces= --server-id= --redo-log-version=
xtrabackup: recognized client arguments:
:: innobackupex: Starting the apply-log operation
...省略
xtrabackup: starting shutdown with innodb_fast_shutdown =
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number
:: completed OK! STEP7:执行还原
# 删除data目录并重建
[root@mysqlserver backup]# cd /usr/local/mysql/
[root@mysqlserver mysql]# rm -rf data/
[root@mysqlserver mysql]# mkdir data [root@mysqlserver mysql]# innobackupex --default-file=/etc/my.cnf --copy-back /backup/--11_20--
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data
xtrabackup: recognized client arguments:
:: innobackupex: Starting the copy-back operation
...省略
:: [] ...done
:: [] Copying ./ibtmp1 to /usr/local/mysql/data/ibtmp1
:: [] ...done
:: completed OK! STEP8:修改data目录的权限
[root@mysqlserver mysql]# chown -R mysql:mysql data/ STEP9:重启数据库,确认数据已经恢复回来
[root@mysqlserver mysql]# service mysqld start
Starting MySQL.Logging to '/usr/local/mysql/data/mysqlserver.err'.
SUCCESS! [root@mysqlserver mysql]# mysql -uroot -p123456
mysql> use lijiamandb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> select count(*) from test01;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.00 sec) mysql> select count(*) from test02;
+----------+
| count(*) |
+----------+
| |
+----------+
row in set (0.01 sec) mysql> exit
Bye

【完】

MySQL物理物理备份与还原工具xtraBackup的更多相关文章

  1. mysql多线程备份与还原工具mydumper

    (一)mydumper介绍 之前我们已经学过如何使用mysqldump备份恢复数据库:<mysql逻辑备份与还原工具mysqldump>,就目前来说,mysqldump是使用最广泛的MyS ...

  2. mysql数据库的备份和还原的总结

    mysql数据库的备份和还原的总结 (来自一运维同事的总结) 1. 备份方式: 热备:数据库在线进行备份,不影响读和写的在线备份方式! 温备:数据库在线进行备份,对表备份时先锁定写操作,仅可以执行读操 ...

  3. 如何用SQL语句实现Mysql数据库的备份与还原

    以前一直做android客户端的项目,根本没有开发asp.net mvc的开发,现阶段做了一个模块,参数设置,以及数据库的备份与还原.其需求如下: 参数设置 本项参数设置为对自动数据备份进行设置,管理 ...

  4. MySQL数据库的备份、还原、迁移

    一.单库备份与还原 1.远程连接MySQL数据库 D:\mysql-5.7.14-winx64\bin>mysql -h192.168.2.201 -uroot -pcnbi2018 参数说明: ...

  5. mysql数据库-备份与还原-Percona XtraBackup 2.4备份工具使用

    目录 xtrabackup 特点 备份生成的相关文件 xtrabackup 安装 xtrabackup 用法 1 备份 2 预备份 3 还原 4 其他 还原注意事项 xtrabackup实现完全备份及 ...

  6. MySQL八、备份和还原

                MySQL 八.数据库备份和还原       1.二进制日志相关配置     1)查看使用中的二进制日志文件列表,及大小   SHOW {BINARY | MASTER} LO ...

  7. MySQL 大数据备份方案之Percona XtraBackup

    Xtrabackup介绍 1.Xtrabackup是什么 Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbacku ...

  8. MySQL索引,备份和还原

    1.索引  1.索引是占硬盘空间 ,也是按页存放的 . 思考题:一个索引页,(数据页)  占用多少个字节  .SQL Server 8192个字节 2.索引:是一种有效组合数据的方式,为了快速查找指定 ...

  9. 关于mysql数据库的备份和还原

    在搭建网站的过程中常遇到文件的备份与还原,以备下次再使用 备份: 图中蓝色画线处为备份命令,wordpress为要备份的数据库名,.">"可将结果输出到文件中,/opt/wo ...

随机推荐

  1. 20行Python代码爬取王者荣耀全英雄皮肤

    引言王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了.我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成. 准备工作 ...

  2. html页脚固定在底部的方法

    <style type="text/css"> html { height: 100%; } body { height: 100%; margin: 0; paddi ...

  3. 利用自编码(Autoencoder)来提取输入数据的特征

    自编码(Autoencoder)介绍 Autoencoder是一种无监督的学习算法,将输入信息进行压缩,提取出数据中最具代表性的信息.其目的是在保证重要特征不丢失的情况下,降低输入信息的维度,减小神经 ...

  4. 一条SQL注入引出的惊天大案

    前情回顾: WAF公司拦截到一个神秘的HTTP数据包,在这个包的表单字段中发现了SQL语句.目标指向80端口,而这正是nginx公司的地盘.详情参见:一个HTTP数据包的奇幻之旅 虚拟机的世界 一个安 ...

  5. MATLAB实例:PCA(主成成分分析)详解

    MATLAB实例:PCA(主成成分分析)详解 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 1. 主成成分分析 2. MATLAB解释 详细信息请看: ...

  6. ssh免密登陆和加密解密

    一 丶实现无密码的远程管理 1.生成公钥 私钥 [root@room9pc14 桌面]# ssh-keygen [root@room9pc14 桌面]# ls /root/.ssh/ 2.上传公钥到虚 ...

  7. 深度学习论文翻译解析(六):MobileNets:Efficient Convolutional Neural Networks for Mobile Vision Appliications

    论文标题:MobileNets:Efficient Convolutional Neural Networks for Mobile Vision Appliications 论文作者:Andrew ...

  8. Linux之nohup命令

    例:执行一个循环的脚本 可以使用sh命令就可以了 后台运行这个脚本使用& nohup能够正常在关闭xshell继续执行,而其他两种办法不行 但是注意 这&方法断掉这session后(进 ...

  9. schedule of 2016-10-09~2016-10-16(Sunday~Sunday)——1st semester of 2nd Grade

    most important things to do 1.prepare for toefl 2.joint phd preparations 3.ieee trans thesis to writ ...

  10. FlashFXP 5.0.0官方中文破解版,附文件下载地址和破解码

    FlashFXP 5.0.0官方中文破解版是一个功能强大的 FXP/FTP 软件,融合了一些其他优秀 FTP 软件的优点,如像 CuteFTP 一样可以比较文件夹,支持彩色文字显示:像 BpFTP 支 ...