MySQL Enterprise backup Getting started with

Source: Internet
Author: User

**************************************************************
--1. Fully prepared
**************************************************************

#mysqlbackup--defaults-file=/usr/local/mysql/my.cnf \
--host=127.0.0.1--port=3306--protocol=tcp \
--user=root--password=passwd123! --databases= "Wind" \
--with-timestamp--backup-dir=/backup \
--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index \
Backup-and-apply-log


----NOTE:
Mysqlbackup:INFO:Could not find Binlog index file. Binlogs is not being copied for this backup.
Point-in-time-recovery is not being possible.
If This was online backup then server may not be started with--log-bin.
Specify it location with--LOG-BIN-INDEX option.


#cat/backup/2015-04-01_09-39-09/meta/backup_variables.txt |grep ' LSN '

end_lsn=70249846
start_lsn=70249472


/*************************** parameters


[Backup_variables]
Apply_log_done=1 # Whether to release the instrumented Ibbackup_logfile file (0 means no, 1 means has been freed)
Binlog_index=mysqldb01-bin.index #二进制日志索引文件
binlog_position=mysqldb01-bin.000011:338 #二进制日志文件大小
end_lsn=70249846 # End LSN Point
Has_external_plugins=0 #外部插件
Is_compressed=0 #是否压缩 (0: No, 1: YES)
Is_incremental=0 #是否是增量为增量备份文件 (0: No, 1: YES)
Is_incremental_with_redo_log_only=0 only configures redo logs, and when the input data size is redo log size, there will be a throw
Is_onlyinnodb=0 #是否只备份了innodb的表
Is_partial=1 #是服务器备份还是部分备份 (0 for full-server backup, 1 for partial backup)
Is_skip_unused_pages=0
meb_version=3.12.0 #版本号
start_lsn=70249472 #开始备份的LSN点


***************************/


**************************************************************
---2. Incremental backup
**************************************************************

Mysqlbackup--defaults-file=/usr/local/mysql/my.cnf \
--host=127.0.0.1--port=3306--protocol=tcp \
--user=root--password=passwd123! --databases= "Wind" \
--with-timestamp--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index \
--incremental--start-lsn=70249846 \
--incremental-backup-dir=/backupinc Backup


Mysqlbackup--defaults-file=/usr/local/mysql/my.cnf \
--host=127.0.0.1--port=3306--protocol=tcp \
--user=root--password=passwd123! --databases= "Wind" \
--with-timestamp--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index \
--incremental--start-lsn=138861169 \
--incremental-backup-dir=/backupinc Backup


**************************************************************
--3. Restoring a specified table space
**************************************************************

--3.1 Consolidated incremental backup to full standby

ls/backupinc/
2015-04-01_10-03-16 2015-04-01_10-11-51


Mysqlbackup--backup-dir=/backup/2015-04-01_09-39-09 \
--INCREMENTAL-BACKUP-DIR=/BACKUPINC/2015-04-01_10-03-16 \
Apply-incremental-backup


Mysqlbackup--backup-dir=/backup/2015-04-01_09-39-09 \
--INCREMENTAL-BACKUP-DIR=/BACKUPINC/2015-04-01_10-11-51 \
Apply-incremental-backup

--3.2 simulation deletes the specified table space

#cat/usr/local/mysql/my.cnf |grep DataDir
Datadir=/usr/local/mysql/data


MariaDB [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Jason |
| MySQL |
| Performance_schema |
| Test |
| Wind |
+--------------------+
6 rows in Set (0.01 sec)


MariaDB [wind]> Select COUNT (*) from T1;
+----------+
| COUNT (*) |
+----------+
| 3000000 |
+----------+
1 row in Set (0.60 sec)


MariaDB [(None)]> drop database wind;
Query OK, 1 row affected (0.24 sec)

MariaDB [(none)]> commit;
Query OK, 0 rows Affected (0.00 sec)

MariaDB [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Jason |
| MySQL |
| Performance_schema |
| Test |
+--------------------+
5 rows in Set (0.00 sec)


--3.3 Restore specified table space

Mysqlbackup--defaults-file=/usr/local/mysql/my.cnf \
--datadir=/usr/local/mysql/data/\
--log-bin-index=/usr/local/mysql/mysql_logs/binary_log/mysqldb01-bin.index \
--backup-dir=/backup/2015-04-01_09-39-09 \
--databases= "Wind" \
Copy-back

Chown-r Mysql/usr/local/mysql
Chgrp-r Mysql/usr/local/mysql



--3.4 Verifying table Space Recovery


MariaDB [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Jason |
| MySQL |
| Performance_schema |
| Test |
| Wind |
+--------------------+
6 rows in Set (0.01 sec)


MariaDB [wind]> Select COUNT (*) from T1;
+----------+
| COUNT (*) |
+----------+
| 3000000 |
+----------+
1 row in Set (0.60 sec)

MySQL Enterprise backup Getting started with

Related Article

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.