Innobackupex Backup restore steps with multiple incremental backups

Source: Internet
Author: User
Tags mkdir
Description: MySQL directory is/data/mysqldata/3306
The fully-prepared catalogue is/data/mysqldata/backup/full
The incrementally prepared directory is/data/mysqldata/backup/inc
The fully-prepared file used in this article is/data/mysqldata/backup/full/2014-06-05_17-02-22/
The first incremental preparation used in this article is the first incremental preparation on a fully-prepared basis:/data/mysqldata/backup/inc/2014-06-05_17-06-16/
The second incremental preparation used in this article is the first incremental preparation on the basis of the first increment:/data/mysqldata/backup/inc/2014-06-05_17-07-56/
1. Create database CSS, and create C1 table, insert 1 records, execute full
Innobackupex--defaults-file=/data/mysqldata/3306/my.cnf--user=root--password=root/data/mysqldata/backup/full/
2.truncate C1 Create a C2 table and insert 1 records to perform the first incremental preparation on a fully-prepared basis
Innobackupex--defaults-file=/data/mysqldata/3306/my.cnf--user=root--password=root--incremental-- incremental-basedir=/data/mysqldata/backup/full/2014-06-05_17-02-22//data/mysqldata/backup/inc/
3. Create the C3 table and insert 1 records to perform the first incremental preparation based on the first incremental
Innobackupex--defaults-file=/data/mysqldata/3306/my.cnf--user=root--password=root--incremental-- incremental-basedir=/data/mysqldata/backup/inc/2014-06-05_17-06-16//data/mysqldata/backup/inc/
4./et C/init.d/mysqld Stop
5.mv/data/mysqldata/3306/data/mysqldata/3306bak
6.mkdir/data/mysqldata/3306
7.mkdir tmp binlog Data innodb_log innodb_ts
8. Application of fully prepared
Innobackupex--defaults-file=/data/mysqldata/3306bak/my.cnf--apply-log--redo-only/data/mysqldata/backup/full/ 2014-06-05_17-02-22/--user=root--password=root
9. Apply the first incremental preparation
Innobackupex--defaults-file=/data/mysqldata/3306bak/my.cnf--apply-log--redo-only/data/mysqldata/backup/full/ 2014-06-05_17-02-22/--incremental-dir=/data/mysqldata/backup/inc/2014-06-05_17-06-16/--user=root--password= Root
10. Apply a second incremental preparation
10.1
Innobackupex--defaults-file=/data/mysqldata/3306bak/my.cnf--apply-log--redo-only/data/mysqldata/backup/inc/ 2014-06-05_17-06-16/--incremental-dir=/data/mysqldata/backup/inc/2014-06-05_17-07-56/--user=root--password= Root
Explanation: According to my understanding, this should be done by apply-log the second incremental backup on the basis of the first incremental backup, resulting in an error: Applying incremental backup needs target prepared (The Chinese meaning is: the application of incremental backup requires the preparation of the goal), then replace the following sentence, or on the basis of the second increment of the application of the preparation, OK.
10.2
Innobackupex--defaults-file=/data/mysqldata/3306bak/my.cnf--apply-log--redo-only/data/mysqldata/backup/full/ 2014-06-05_17-02-22/--incremental-dir=/data/mysqldata/backup/inc/2014-06-05_17-07-56/--user=root--password= Root
11.
Restore Innobackupex--defaults-file=/data/mysqldata/3306bak/my.cnf--copy-back/data/mysqldata/backup/full/ 2014-06-05_17-02-22/--incremental-dir=/data/mysqldata/backup/inc/2014-06-05_17-07-56/--user=root--password= Root A . cp/data/mysqldata/3306bak/data/mysqldata/3306/
of
Chown Mysql.mysql/data/mysqldata/3306-r
.
/etc/init.d/mysqld start
.
login MSYQL to verify C1, C2, C3 tables in the CSS library. C1 is empty, the data in C2, C3 should all be before the backup.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.