SlideShare a Scribd company logo
1 of 46
Download to read offline
MySQL Enterprise Backup (MEB)
Remote DBA
Team
Overview
• 			MySQL	Consulting	
• 			MySQL	Support	
• 			Remote	DBA	support.	
• 			Expert	MySQL	solutions.	
• 			24/7	MySQL	Monitoring	and	Support	
• 			MariaDB,	Percona,	Galera,	TokuDB	are	supported	too.
Overview
•  MySQL Enterprise Backup provides enterprise-grade
backup and recovery for MySQL. It delivers hot, online,
non-blocking backups on multiple platforms.
•  This can be primarily used to take hot backup of InnoDB
tables. This can also backup MyISAM and other non-
InnoDB tables, however that is performed by locking
tables.
•  The backup of other non-InnoDB & non-MyISAM tables
taken is not guaranteed to be consistent.
Important Features
•  "Hot" Online Backups
•  High Performance
•  Incremental, Partial, full instance backup
•  Fast Recovery
•  Advanced LZ4 Compression
•  Direct Cloud Storage Backup
•  Online "Hot" Selective Restore
•  Backup Validation
•  Table renaming
Backup and Restore
●  The backup and restore involves conceptually three
steps:
(1) backup operation.
(2) Apply log operation to prepare backup for restore.
(3) copy-back operation to restore backup to server
repository.
Option Files Read
•  Default options are read from the following files in the
given order
/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/mysql/etc/my.cnf
~/.my.cnf
•  This can be overridden as --defaults-file=/file/path
Operations Supported
•  Backup:
performs backup to the backup directory, result is raw
backup.
•  Backup-to-image:
performs backup to single backup image.
•  Apply-log:
Prepares the backup for restore.
•  Backup-and-Apply-log:
performs the backup and apply-log in a single step.
•  Apply-incremental-backup:
applies incremental backup on full backup.
Operations Supported
•  copy-back:
Restores data, index, log files from backup directory to
server repository. Server should be offline.
•  copy-back-and-apply-log:
Restores a single-file image backup or raw backup into
datadir and then applies log.
•  image-to-backup-dir:
Extracts the given backup image contents to specified
directory.
•  backup-dir-to-image:
Creates backup image of given backup dir.
Operations Supported
•  list-image:
List the content of backup image.
•  extract:
Extracts the contents of given backup image.
•  validate:
Checks for corruption in the backup image by comparing
the checksums.
Option Classification
•  The options are classified for the ease of remembrance
1.  Standard Options
2.  Connection Options
3.  Server Repository Options
4.  Backup Repository Options
5.  Parallelization Options
6.  Encryption Options
7.  Other options
Usage
•  The command usage is as below
# MEB [STD-OPTIONS]
[CONNECTION-OPTIONS]
[SERVER-REPOSITORY-OPTIONS]
[BACKUP-REPOSITORY-OPTIONS] [PARALLELIZATION-
OPTIONS]
[ENCRYPTION-OPTIONS]
[OTHER-OPTIONS] OPERATION
Standard Options
•  This option may be given at the first.
--print-defaults
--no-defaults
--defaults-file=PATH
--help
--force
--show-progress
Connection Options
•  They define the options to connect to the server.
-u, --user=name
-p, --password=
--host=name
--port=#
--protocol=name
--socket=name
--connect_timeout
--connect-if-online
Server Repository Options
•  Provides information regarding the server.
--datadir=PATH
--innodb_data_file_path=VALUE
--innodb_data_home_dir=PATH
--innodb_log_group_home_dir=PATH
--innodb_log_files_in_group=N
--innodb_log_file_size=SIZE
--innodb_page_size=SIZE
--innodb_checksum_algorithm=NAME
Backup Repository Options
•  Provides information regarding the backup destination.
--backup_dir=PATH
--backup_innodb_data_home_dir=PATH
--backup_innodb_log_group_home_dir=PATH
--backup_innodb_log_files_in_group=N
--backup_innodb_log_file_size=SIZE
--backup_innodb_page_size=SIZE
--backup_innodb_checksum_algorithm=NAME
Parallelization Options
•  These options speed up the backup process
--number-of-buffers=NUMBER
--process-threads=NUMBER
--read-threads=NUMBER
--write-threads=NUMBER
Encryption Options
•  These options define encryption.
--encrypt [The encryption method is AES-256-CBC]
--decrypt
--key=KEY
--key-file=FILENAME
Other Options
•  These contains some of the important option.
--backup-image=path
--compress
--compress-level=LEVEL [0-9]
--compress-method=ALGORITHM[def LZ4]
--exclude-tables=REGEXP
--include-tables=REGEXP
--incremental
--incremental_backup_dir=PATH
--incremental_base=BACKUP
--start-lsn=LSN
Other Options
•  These contains some of the important option.
--incremental-with-redo-log-only
--limit-memory=MB
--only-innodb
--on-disk-full={abort|warn|abort_and_remove}]
--slave-info
--uncompress
--use-tts={with-minimum-locking|with-full-locking}]
--include=REGEXP
--databases=LIST
Full Backup
•  By default when you invoke the MEB it goes for a full
backup
# MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --
backup-dir=/var/lib/backup backup
Backup Progression
Backup Progression
Backup Progression
Backup dir contents
•  Below are the content of the backup dir.
Preparing Phase
● In prepare phase log is applied
# MEB/bin/mysqlbackup --backup-dir=/var/lib/backup apply-log
Preparing Phase
Restore of backup
•  `copy-back` option is used to restore the backup to the
datadir mentioned in the cnf file or under [mysqlbackup].
Note: The server should be offline before restoring
# MEB/bin/mysqlbackup --backup-dir=/var/lib/backup copy-back
Restore of Backup
Backup-and-apply-log
•  Back and preparation can be combined as below.
# MEB/bin/mysqlbackup --datadir=/var/lib/mysql --backup-dir=/var/
lib/backup backup-and-apply-log
Restore and prepare
•  The restore and prepare phase can be combined as
below
# MEB/bin/mysqlbackup --datadir=/var/lib/mysql --backup-dir=/var/
lib/backup copy-back-and-apply-log
•  Server should be offline
Incremental backups
•  Incremental backup copies the changes made after the
previous full backup(base) or by using the LSN.
# MEB/bin/mysqlbackup --datadir=/var/lib/mysql --incremental --
incremental-backup-dir=/var/lib/inc --incremental-base=dir:/var/lib/
backup backup
# MEB/bin/mysqlbackup --datadir=/var/lib/mysql --incremental --
start-lsn=424059414 --with-timestamp --incremental-backup-dir=/
var/lib/inc backup
Applying Incremental backup to full backup
•  Step 1: The full backup should be prepared first
# MEB/bin/mysqlbackup --backup-dir=/var/lib/backup apply-log
•  Step 2: Now apply the incremental backup to the
prepared full backup in sequence.
# MEB/bin/mysqlbackup --backup-dir=/var/lib/backup --incremental-
backup-dir=/var/lib/inc apply-incremental-backup
Redo log backup
•  The redo log backup copies the changes in the redo-logs
based on the LSN.
# MEB/bin/mysqlbackup --incremental-with-redo-log-only --start-
lsn=431175291 --with-timestamp --incremental-backup-dir=/var/lib/
inc backup
# MEB/bin/mysqlbackup --incremental-with-redo-log-only --
incremental-base=dir:/var/lib/backup --with-timestamp --
incremental-backup-dir=/var/lib/inc backup
Redo log backup
•  Note: For redo-log backup the LSN should exit in the
circular logs, if the LSN is overwritten, you will get the
error as below.
•  Error:
mysqlbackup: ERROR: Cannot do incremental redo-only
backup of InnoDB tables: InnoDB log at LSN 424059414
is already overwritten. InnoDB saves the only the latest
redo log records in InnoDB log files. Older records are
overwritten when their distance from the tail of the log
exceeds the combined size of InnoDB log files.
Speeding up the backup
•  The Backup process can be increased by allocating
resources efficiently
# MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --limit-
memory=400 --process-thread=8 --read-thread=2 --write-thread=2 --
backup-dir=/var/lib/backup backup
Backup log:
-----------
160419 18:58:52 mysqlbackup: INFO: Full Backup operation
starts with following threads
2 read-threads 8 process-threads 2 write-threads
Compression
•  MEB support compression at various levels of 0-9 , The
default Algorithm is lz4 supports zlib and lzma
# MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --
compress --compress-level=6 --compress-method=zlib --process-
threads=8 --read-threads=2 --write-threads=2 --backup-dir=/var/lib/
backup backup
Uncompressed backup size:
255M /tmp/var/lib/backup
Compressed backup size:
58M /var/lib/backup
Decompress
•  Decompression of backup happens along with the
prepare phase as below.
# MEB/bin/mysqlbackup --uncompress --process-threads=8 --read-
threads=2 --write-threads=2 --backup-dir=/var/lib/backup apply-log
Single File backup
•  The Backup file ends with extension `.mbi` the operation
used is `backup-to-image`
# MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --with-
timestamp --backup-image=backup.mbi --backup-dir=/var/lib/backup
backup-to-image
File: /var/lib/backup/2016-04-19_19-28-14/backup.mbi
List and Extract single file backup
•  list the content of the backup file as below
# MEB/bin/mysqlbackup --backup-image=/var/lib/backup/
2016-04-19_19-28-14/backup.mbi list-image
•  To extract the content as below, by def it is extracted to
the current directory.
# MEB/bin/mysqlbackup --backup-image=/var/lib/backup/
2016-04-19_19-28-14/backup.mbi --backup-dir=/var/lib/backup
extract
Streaming single file backup
•  The single-file backup could be streamed to a remote
host
# MEB/bin/mysqlbackup --user=backup --password='backup' --
datadir=/var/lib/mysql --backup-dir=/var/lib/backup --backup-
image=- --compress backup-to-image | ssh mydbops@xx.xx.xxx -p
2345 '/home/mydbops/meb/bin/mysqlbackup --backup-dir=/home/
mydbops/mysqlbackup --datadir=/home/mydbops/data --
innodb_log_group_home_dir=. --innodb_log_files_in_group=2 --
innodb_log_file_size=268435456 --uncompress --backup-image=-
copy-back-and-apply-log'
Streaming single file backup
●  Backup transferred:
[mydbops@master.mydbops.com ~$] du -sh /home/
mydbops/data
855M /home/mydbops/data
Encrypting backup
•  MEB	supports	high	level	security	to	the	backup	by	encryp8ng	
them	with	AES,	Encryp8on	works	on	the	backup	images.	
	
Crea8ng	key-file:	
-----------------------	
#	openssl	rand	32	-hex	>	meb_keyfile	
	
This	key	is	used	for	both	encryp8on	&	decryp8on
Encrypting backup
•  Below is the command which provides encryption.
# MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --
backup-image=encrpt_backup.enc --backup-dir=/var/lib/backup --
encrypt --key-file=meb_keyfile backup-to-image
Decrypting Backup
•  The same key used for encryption has to be used for
decryption of the backup.
# MEB/bin/mysqlbackup --backup-image=/var/lib/backup/
encrpt_backup.enc --backup-dir=/var/lib/backup --with-timestamp --
decrypt --key-file=meb_keyfile extract
Highlights
•  MySQL Enterprise ( Proprietary )
•  Written in C
•  Supports Windows , Unix and other platforms
•  Faster and secure
•  Compression.
•  Incremental and full backup.
Note : Xtrabackup is an good alternative too
Thank You

More Related Content

What's hot

What's hot (20)

MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackupHighly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
 
MySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery Solution
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
 
MySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR ScenariosMySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR Scenarios
 
Dd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublinDd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublin
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
MySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB Clusters
 
preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0
preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0
preFOSDEM MySQL Day - Best Practices to Upgrade to MySQL 8.0
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain Plan
 
MySQL Data Encryption at Rest
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at Rest
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
ProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdfProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdf
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 

Similar to MySQL Enterprise Backup (MEB)

MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning PresentationMySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
Colin Charles
 
MySQL enterprise backup overview
MySQL enterprise backup overviewMySQL enterprise backup overview
MySQL enterprise backup overview
郁萍 王
 
Uc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-moreUc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-more
Arvids Godjuks
 

Similar to MySQL Enterprise Backup (MEB) (20)

MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning PresentationMySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
 
Les 05 create_bu
Les 05 create_buLes 05 create_bu
Les 05 create_bu
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & Recovery
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
MySQL enterprise backup overview
MySQL enterprise backup overviewMySQL enterprise backup overview
MySQL enterprise backup overview
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
MySQL database
MySQL databaseMySQL database
MySQL database
 
OpenStack DRaaS - Freezer - 101
OpenStack DRaaS - Freezer - 101OpenStack DRaaS - Freezer - 101
OpenStack DRaaS - Freezer - 101
 
ibbackup vs mysqldump对比测试 - 20080718
ibbackup vs mysqldump对比测试 - 20080718ibbackup vs mysqldump对比测试 - 20080718
ibbackup vs mysqldump对比测试 - 20080718
 
Uc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-moreUc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-more
 
MySQL Enterprise Backup
MySQL Enterprise BackupMySQL Enterprise Backup
MySQL Enterprise Backup
 
Percona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesPercona Xtrabackup Best Practices
Percona Xtrabackup Best Practices
 
Meb Backup & Recovery Performance
Meb Backup & Recovery PerformanceMeb Backup & Recovery Performance
Meb Backup & Recovery Performance
 
Rman Presentation
Rman PresentationRman Presentation
Rman Presentation
 

More from Mydbops

More from Mydbops (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding
 

Recently uploaded

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 

MySQL Enterprise Backup (MEB)

  • 1. MySQL Enterprise Backup (MEB) Remote DBA Team
  • 3. Overview •  MySQL Enterprise Backup provides enterprise-grade backup and recovery for MySQL. It delivers hot, online, non-blocking backups on multiple platforms. •  This can be primarily used to take hot backup of InnoDB tables. This can also backup MyISAM and other non- InnoDB tables, however that is performed by locking tables. •  The backup of other non-InnoDB & non-MyISAM tables taken is not guaranteed to be consistent.
  • 4. Important Features •  "Hot" Online Backups •  High Performance •  Incremental, Partial, full instance backup •  Fast Recovery •  Advanced LZ4 Compression •  Direct Cloud Storage Backup •  Online "Hot" Selective Restore •  Backup Validation •  Table renaming
  • 5. Backup and Restore ●  The backup and restore involves conceptually three steps: (1) backup operation. (2) Apply log operation to prepare backup for restore. (3) copy-back operation to restore backup to server repository.
  • 6. Option Files Read •  Default options are read from the following files in the given order /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf •  This can be overridden as --defaults-file=/file/path
  • 7. Operations Supported •  Backup: performs backup to the backup directory, result is raw backup. •  Backup-to-image: performs backup to single backup image. •  Apply-log: Prepares the backup for restore. •  Backup-and-Apply-log: performs the backup and apply-log in a single step. •  Apply-incremental-backup: applies incremental backup on full backup.
  • 8. Operations Supported •  copy-back: Restores data, index, log files from backup directory to server repository. Server should be offline. •  copy-back-and-apply-log: Restores a single-file image backup or raw backup into datadir and then applies log. •  image-to-backup-dir: Extracts the given backup image contents to specified directory. •  backup-dir-to-image: Creates backup image of given backup dir.
  • 9. Operations Supported •  list-image: List the content of backup image. •  extract: Extracts the contents of given backup image. •  validate: Checks for corruption in the backup image by comparing the checksums.
  • 10. Option Classification •  The options are classified for the ease of remembrance 1.  Standard Options 2.  Connection Options 3.  Server Repository Options 4.  Backup Repository Options 5.  Parallelization Options 6.  Encryption Options 7.  Other options
  • 11. Usage •  The command usage is as below # MEB [STD-OPTIONS] [CONNECTION-OPTIONS] [SERVER-REPOSITORY-OPTIONS] [BACKUP-REPOSITORY-OPTIONS] [PARALLELIZATION- OPTIONS] [ENCRYPTION-OPTIONS] [OTHER-OPTIONS] OPERATION
  • 12. Standard Options •  This option may be given at the first. --print-defaults --no-defaults --defaults-file=PATH --help --force --show-progress
  • 13. Connection Options •  They define the options to connect to the server. -u, --user=name -p, --password= --host=name --port=# --protocol=name --socket=name --connect_timeout --connect-if-online
  • 14. Server Repository Options •  Provides information regarding the server. --datadir=PATH --innodb_data_file_path=VALUE --innodb_data_home_dir=PATH --innodb_log_group_home_dir=PATH --innodb_log_files_in_group=N --innodb_log_file_size=SIZE --innodb_page_size=SIZE --innodb_checksum_algorithm=NAME
  • 15. Backup Repository Options •  Provides information regarding the backup destination. --backup_dir=PATH --backup_innodb_data_home_dir=PATH --backup_innodb_log_group_home_dir=PATH --backup_innodb_log_files_in_group=N --backup_innodb_log_file_size=SIZE --backup_innodb_page_size=SIZE --backup_innodb_checksum_algorithm=NAME
  • 16. Parallelization Options •  These options speed up the backup process --number-of-buffers=NUMBER --process-threads=NUMBER --read-threads=NUMBER --write-threads=NUMBER
  • 17. Encryption Options •  These options define encryption. --encrypt [The encryption method is AES-256-CBC] --decrypt --key=KEY --key-file=FILENAME
  • 18. Other Options •  These contains some of the important option. --backup-image=path --compress --compress-level=LEVEL [0-9] --compress-method=ALGORITHM[def LZ4] --exclude-tables=REGEXP --include-tables=REGEXP --incremental --incremental_backup_dir=PATH --incremental_base=BACKUP --start-lsn=LSN
  • 19. Other Options •  These contains some of the important option. --incremental-with-redo-log-only --limit-memory=MB --only-innodb --on-disk-full={abort|warn|abort_and_remove}] --slave-info --uncompress --use-tts={with-minimum-locking|with-full-locking}] --include=REGEXP --databases=LIST
  • 20. Full Backup •  By default when you invoke the MEB it goes for a full backup # MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql -- backup-dir=/var/lib/backup backup
  • 24. Backup dir contents •  Below are the content of the backup dir.
  • 25. Preparing Phase ● In prepare phase log is applied # MEB/bin/mysqlbackup --backup-dir=/var/lib/backup apply-log
  • 27. Restore of backup •  `copy-back` option is used to restore the backup to the datadir mentioned in the cnf file or under [mysqlbackup]. Note: The server should be offline before restoring # MEB/bin/mysqlbackup --backup-dir=/var/lib/backup copy-back
  • 29. Backup-and-apply-log •  Back and preparation can be combined as below. # MEB/bin/mysqlbackup --datadir=/var/lib/mysql --backup-dir=/var/ lib/backup backup-and-apply-log
  • 30. Restore and prepare •  The restore and prepare phase can be combined as below # MEB/bin/mysqlbackup --datadir=/var/lib/mysql --backup-dir=/var/ lib/backup copy-back-and-apply-log •  Server should be offline
  • 31. Incremental backups •  Incremental backup copies the changes made after the previous full backup(base) or by using the LSN. # MEB/bin/mysqlbackup --datadir=/var/lib/mysql --incremental -- incremental-backup-dir=/var/lib/inc --incremental-base=dir:/var/lib/ backup backup # MEB/bin/mysqlbackup --datadir=/var/lib/mysql --incremental -- start-lsn=424059414 --with-timestamp --incremental-backup-dir=/ var/lib/inc backup
  • 32. Applying Incremental backup to full backup •  Step 1: The full backup should be prepared first # MEB/bin/mysqlbackup --backup-dir=/var/lib/backup apply-log •  Step 2: Now apply the incremental backup to the prepared full backup in sequence. # MEB/bin/mysqlbackup --backup-dir=/var/lib/backup --incremental- backup-dir=/var/lib/inc apply-incremental-backup
  • 33. Redo log backup •  The redo log backup copies the changes in the redo-logs based on the LSN. # MEB/bin/mysqlbackup --incremental-with-redo-log-only --start- lsn=431175291 --with-timestamp --incremental-backup-dir=/var/lib/ inc backup # MEB/bin/mysqlbackup --incremental-with-redo-log-only -- incremental-base=dir:/var/lib/backup --with-timestamp -- incremental-backup-dir=/var/lib/inc backup
  • 34. Redo log backup •  Note: For redo-log backup the LSN should exit in the circular logs, if the LSN is overwritten, you will get the error as below. •  Error: mysqlbackup: ERROR: Cannot do incremental redo-only backup of InnoDB tables: InnoDB log at LSN 424059414 is already overwritten. InnoDB saves the only the latest redo log records in InnoDB log files. Older records are overwritten when their distance from the tail of the log exceeds the combined size of InnoDB log files.
  • 35. Speeding up the backup •  The Backup process can be increased by allocating resources efficiently # MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --limit- memory=400 --process-thread=8 --read-thread=2 --write-thread=2 -- backup-dir=/var/lib/backup backup Backup log: ----------- 160419 18:58:52 mysqlbackup: INFO: Full Backup operation starts with following threads 2 read-threads 8 process-threads 2 write-threads
  • 36. Compression •  MEB support compression at various levels of 0-9 , The default Algorithm is lz4 supports zlib and lzma # MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql -- compress --compress-level=6 --compress-method=zlib --process- threads=8 --read-threads=2 --write-threads=2 --backup-dir=/var/lib/ backup backup Uncompressed backup size: 255M /tmp/var/lib/backup Compressed backup size: 58M /var/lib/backup
  • 37. Decompress •  Decompression of backup happens along with the prepare phase as below. # MEB/bin/mysqlbackup --uncompress --process-threads=8 --read- threads=2 --write-threads=2 --backup-dir=/var/lib/backup apply-log
  • 38. Single File backup •  The Backup file ends with extension `.mbi` the operation used is `backup-to-image` # MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql --with- timestamp --backup-image=backup.mbi --backup-dir=/var/lib/backup backup-to-image File: /var/lib/backup/2016-04-19_19-28-14/backup.mbi
  • 39. List and Extract single file backup •  list the content of the backup file as below # MEB/bin/mysqlbackup --backup-image=/var/lib/backup/ 2016-04-19_19-28-14/backup.mbi list-image •  To extract the content as below, by def it is extracted to the current directory. # MEB/bin/mysqlbackup --backup-image=/var/lib/backup/ 2016-04-19_19-28-14/backup.mbi --backup-dir=/var/lib/backup extract
  • 40. Streaming single file backup •  The single-file backup could be streamed to a remote host # MEB/bin/mysqlbackup --user=backup --password='backup' -- datadir=/var/lib/mysql --backup-dir=/var/lib/backup --backup- image=- --compress backup-to-image | ssh mydbops@xx.xx.xxx -p 2345 '/home/mydbops/meb/bin/mysqlbackup --backup-dir=/home/ mydbops/mysqlbackup --datadir=/home/mydbops/data -- innodb_log_group_home_dir=. --innodb_log_files_in_group=2 -- innodb_log_file_size=268435456 --uncompress --backup-image=- copy-back-and-apply-log'
  • 41. Streaming single file backup ●  Backup transferred: [mydbops@master.mydbops.com ~$] du -sh /home/ mydbops/data 855M /home/mydbops/data
  • 43. Encrypting backup •  Below is the command which provides encryption. # MEB/bin/mysqlbackup -u backup -p --datadir=/var/lib/mysql -- backup-image=encrpt_backup.enc --backup-dir=/var/lib/backup -- encrypt --key-file=meb_keyfile backup-to-image
  • 44. Decrypting Backup •  The same key used for encryption has to be used for decryption of the backup. # MEB/bin/mysqlbackup --backup-image=/var/lib/backup/ encrpt_backup.enc --backup-dir=/var/lib/backup --with-timestamp -- decrypt --key-file=meb_keyfile extract
  • 45. Highlights •  MySQL Enterprise ( Proprietary ) •  Written in C •  Supports Windows , Unix and other platforms •  Faster and secure •  Compression. •  Incremental and full backup. Note : Xtrabackup is an good alternative too