innobackupex存储备份历史

innobackupex可以将备份信息存储在mysql的percona_schema的xtrabackup_history表中。
这样就更方便我们查询备份的情况了。

 

实验环境:
mysql> system innobackupex --version
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p


1.创建percona_schema
mysql> CREATE DATABASE `percona_schema` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */ ;
Query OK, 1 row affected

2.授予备份用户对PERCONA_SCHEMA的相关权限。
mysql> GRANT SELECT, INSERT,CREATE ON PERCONA_SCHEMA.* TO 'bkpuser'@'localhost';
Database changed

3.执行备份
mysql> system innobackupex --defaults-file=/db/mysql5.6/my.cnf --history  -user=bkpuser  -password=s3cret   -socket=/db/mysql5.6/logs/mysql.sock /home/db

4.通过xtrabackup_history查看备份情况
mysql> select * from PERCONA_SCHEMA.xtrabackup_history \G
*************************** 1. row ***************************
            uuid: 9813ac77-5e82-11e4-ab4e-047d7bfed4b8
            name: NULL
       tool_name: innobackupex
    tool_command: --defaults-file=/db/mysql5.6/my.cnf --history -user=bkpuser -password=s3cret -socket=/db/mysql5.6/logs/mysql.sock /home/db
    tool_version: 1.5.1-xtrabackup
ibbackup_version: xtrabackup version 2.2.5 based on MySQL server 5.6.21 Linux (x86_64) (revision id: )
  server_version: 5.6.21-enterprise-commercial-advanced-log
      start_time: 2014-10-26 14:12:48
       end_time: 2014-10-26 14:19:51
       lock_time: 1
      binlog_pos: filename 'binlog_98_3316.000004', position 10299, GTID of the last change ''
      innodb_from_lsn: 0
      innodb_to_lsn: 1685971
      partial: N
     incremental: N
      format: file
       compact: N
      compressed: N
       encrypted: N

你可能感兴趣的:(innobackupex存储备份历史)