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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值