SlideShare a Scribd company logo
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 (20)

PDF
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
Aurimas Mikalauskas
 
PDF
MySQL/MariaDB Proxy Software Test
I Goo Lee
 
PDF
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
PDF
Using all of the high availability options in MariaDB
MariaDB plc
 
PPTX
Maria db 이중화구성_고민하기
NeoClova
 
PPT
Oracle Transparent Data Encryption (TDE) 12c
Nabeel Yoosuf
 
PPTX
MySQL8.0_performance_schema.pptx
NeoClova
 
PDF
MySQL Database Architectures - 2020-10
Kenny Gryp
 
PDF
Optimizing MariaDB for maximum performance
MariaDB plc
 
PDF
MySQL High Availability Solutions
Mydbops
 
PDF
MySQL Performance Schema in Action: the Complete Tutorial
Sveta Smirnova
 
PDF
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
PDF
PostgreSQL Deep Internal
EXEM
 
PDF
Highly efficient backups with percona xtrabackup
Nilnandan Joshi
 
PDF
5 Steps to PostgreSQL Performance
Command Prompt., Inc
 
PDF
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
 
PDF
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
PDF
What is new in PostgreSQL 14?
Mydbops
 
PPTX
My sql failover test using orchestrator
YoungHeon (Roy) Kim
 
PDF
MariaDB Administrator 교육
Sangmo Kim
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
Aurimas Mikalauskas
 
MySQL/MariaDB Proxy Software Test
I Goo Lee
 
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
Using all of the high availability options in MariaDB
MariaDB plc
 
Maria db 이중화구성_고민하기
NeoClova
 
Oracle Transparent Data Encryption (TDE) 12c
Nabeel Yoosuf
 
MySQL8.0_performance_schema.pptx
NeoClova
 
MySQL Database Architectures - 2020-10
Kenny Gryp
 
Optimizing MariaDB for maximum performance
MariaDB plc
 
MySQL High Availability Solutions
Mydbops
 
MySQL Performance Schema in Action: the Complete Tutorial
Sveta Smirnova
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
PostgreSQL Deep Internal
EXEM
 
Highly efficient backups with percona xtrabackup
Nilnandan Joshi
 
5 Steps to PostgreSQL Performance
Command Prompt., Inc
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
Kenny Gryp
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
What is new in PostgreSQL 14?
Mydbops
 
My sql failover test using orchestrator
YoungHeon (Roy) Kim
 
MariaDB Administrator 교육
Sangmo Kim
 

Similar to MySQL Enterprise Backup (MEB) (20)

PDF
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
Colin Charles
 
PDF
Percona Xtrabackup - Highly Efficient Backups
Mydbops
 
PDF
MySQL for Oracle DBAs
Mark Leith
 
PPT
Les 02 config
Femi Adeyemi
 
PDF
MySQL Backup & Recovery
Mindfire Solutions
 
PPT
Backups And Recovery
asifmalik110
 
PPT
Les 05 create_bu
Femi Adeyemi
 
PDF
MySQL database replication
PoguttuezhiniVP
 
PDF
Training Slides: 203 - Backup & Recovery
Continuent
 
PDF
Collaborate 2012 - Administering MySQL for Oracle DBAs
Nelson Calero
 
PDF
MySQL enterprise backup overview
郁萍 王
 
PPT
Les 07 rman_rec
Femi Adeyemi
 
PPTX
MySQL database
lalit choudhary
 
PDF
OpenStack DRaaS - Freezer - 101
Trinath Somanchi
 
DOC
ibbackup vs mysqldump对比测试 - 20080718
Jinrong Ye
 
PDF
Uc2010 xtra backup-hot-backups-and-more
Arvids Godjuks
 
PDF
MySQL Enterprise Backup
Mario Beck
 
PPTX
Percona Xtrabackup Best Practices
Marcelo Altmann
 
PDF
Meb Backup & Recovery Performance
Keith Hollman
 
PDF
Rman Presentation
Rick van Ek
 
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
Colin Charles
 
Percona Xtrabackup - Highly Efficient Backups
Mydbops
 
MySQL for Oracle DBAs
Mark Leith
 
Les 02 config
Femi Adeyemi
 
MySQL Backup & Recovery
Mindfire Solutions
 
Backups And Recovery
asifmalik110
 
Les 05 create_bu
Femi Adeyemi
 
MySQL database replication
PoguttuezhiniVP
 
Training Slides: 203 - Backup & Recovery
Continuent
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Nelson Calero
 
MySQL enterprise backup overview
郁萍 王
 
Les 07 rman_rec
Femi Adeyemi
 
MySQL database
lalit choudhary
 
OpenStack DRaaS - Freezer - 101
Trinath Somanchi
 
ibbackup vs mysqldump对比测试 - 20080718
Jinrong Ye
 
Uc2010 xtra backup-hot-backups-and-more
Arvids Godjuks
 
MySQL Enterprise Backup
Mario Beck
 
Percona Xtrabackup Best Practices
Marcelo Altmann
 
Meb Backup & Recovery Performance
Keith Hollman
 
Rman Presentation
Rick van Ek
 
Ad

More from Mydbops (20)

PDF
Scaling TiDB for Large-Scale Application
Mydbops
 
PDF
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mydbops
 
PDF
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Mydbops
 
PDF
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
Mydbops
 
PDF
AWS Blue Green Deployment for Databases - Mydbops
Mydbops
 
PDF
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
Mydbops
 
PDF
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
Mydbops
 
PDF
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Mydbops
 
PDF
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
PDF
Read/Write Splitting using MySQL Router - Mydbops Meetup16
Mydbops
 
PDF
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
Mydbops
 
PDF
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Mydbops
 
PDF
Demystifying Real time Analytics with TiDB
Mydbops
 
PDF
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
PDF
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 
PDF
Scale your database traffic with Read & Write split using MySQL Router
Mydbops
 
PDF
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Mydbops
 
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
PDF
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mydbops
 
PDF
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Mydbops
 
Scaling TiDB for Large-Scale Application
Mydbops
 
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mydbops
 
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Mydbops
 
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
Mydbops
 
AWS Blue Green Deployment for Databases - Mydbops
Mydbops
 
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
Mydbops
 
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
Mydbops
 
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Mydbops
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Read/Write Splitting using MySQL Router - Mydbops Meetup16
Mydbops
 
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
Mydbops
 
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Mydbops
 
Demystifying Real time Analytics with TiDB
Mydbops
 
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 
Scale your database traffic with Read & Write split using MySQL Router
Mydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Mydbops
 
Ad

Recently uploaded (20)

PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
MRRS Strength and Durability of Concrete
CivilMythili
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Depth First Search Algorithm in 🧠 DFS in Artificial Intelligence (AI)
rafeeqshaik212002
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 

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 [email protected] -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: [[email protected] ~$] 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