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
Redo log improvements MYSQL 8.0
Mydbops
 
PDF
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
Kenny Gryp
 
PDF
Postgresql database administration volume 1
Federico Campoli
 
PDF
The Complete MariaDB Server tutorial
Colin Charles
 
PDF
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
 
PDF
MySQL Multi-Source Replication for PL2016
Wagner Bianchi
 
PDF
NY Meetup: Scaling MariaDB with Maxscale
Wagner Bianchi
 
PPTX
【第二回 ゼロからはじめる Oracle Solaris 11】02 Solaris 11 を支える最強のファイルシステム ZFS ~ ZFS ファイルシ...
SolarisJP
 
PDF
Maxscale_메뉴얼
NeoClova
 
PPTX
IBM Storwize V7000
Stefano Todini
 
PDF
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Markus Michalewicz
 
PDF
MySQL Enterprise Backup - BnR Scenarios
Keith Hollman
 
PDF
MySQL Backup & Recovery
Mindfire Solutions
 
PDF
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
PPTX
LINEのMySQL運用について 修正版
LINE Corporation
 
PDF
Federated Engine 실무적용사례
I Goo Lee
 
PDF
MySQL Connectors 8.0.19 & DNS SRV
Kenny Gryp
 
PDF
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
PPTX
MySQL_MariaDB-성능개선-202201.pptx
NeoClova
 
DOCX
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
Redo log improvements MYSQL 8.0
Mydbops
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
Kenny Gryp
 
Postgresql database administration volume 1
Federico Campoli
 
The Complete MariaDB Server tutorial
Colin Charles
 
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
 
MySQL Multi-Source Replication for PL2016
Wagner Bianchi
 
NY Meetup: Scaling MariaDB with Maxscale
Wagner Bianchi
 
【第二回 ゼロからはじめる Oracle Solaris 11】02 Solaris 11 を支える最強のファイルシステム ZFS ~ ZFS ファイルシ...
SolarisJP
 
Maxscale_메뉴얼
NeoClova
 
IBM Storwize V7000
Stefano Todini
 
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Markus Michalewicz
 
MySQL Enterprise Backup - BnR Scenarios
Keith Hollman
 
MySQL Backup & Recovery
Mindfire Solutions
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Mydbops
 
LINEのMySQL運用について 修正版
LINE Corporation
 
Federated Engine 실무적용사례
I Goo Lee
 
MySQL Connectors 8.0.19 & DNS SRV
Kenny Gryp
 
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
MySQL_MariaDB-성능개선-202201.pptx
NeoClova
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 

Similar to MySQL Enterprise Backup (MEB) (20)

PDF
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zarafa
 
PDF
MySQL Backup and Recovery Essentials
Ronald Bradford
 
PDF
Making Backups in Extreme Situations
Sveta Smirnova
 
PDF
Highly efficient backups with percona xtrabackup
Nilnandan Joshi
 
PPT
My two cents about Mysql backup
Andrejs Vorobjovs
 
PDF
Collaborate2011-XtraBackup Collaborate2011-XtraBackup
CvDs3
 
PDF
MySQL Enterprise Backup: Better Very Large Database Backup & Recovery and More!!
Tinku Ajit
 
PDF
MySQL Enterprise Backup & Oracle Secure Backup
Sanjay Manwani
 
PDF
A Backup Today Saves Tomorrow
Andrew Moore
 
PDF
MySQL Server Backup, Restoration, and Disaster Recovery Planning
Lenz Grimmer
 
PDF
MySQL for Oracle DBAs
Mark Leith
 
PDF
Backing Up the MySQL Database
Sanjay Manwani
 
PDF
OSDC 2012 | Taking hot backups with XtraBackup by Alexey Kopytov
NETWAYS
 
PPTX
PL22 - Backup and Restore Performance.pptx
Vinicius M Grippa
 
PPTX
MySQL backup and restore performance
Vinicius M Grippa
 
PDF
Percona xtrabackup - MySQL Meetup @ Mumbai
Nilnandan Joshi
 
PDF
MySQL enterprise backup overview
郁萍 王
 
PDF
Become a MySQL DBA - slides: Deciding on a relevant backup solution
Severalnines
 
PDF
MySQL Enterprise Backup
Mario Beck
 
PDF
Meb Backup & Recovery Performance
Keith Hollman
 
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zarafa
 
MySQL Backup and Recovery Essentials
Ronald Bradford
 
Making Backups in Extreme Situations
Sveta Smirnova
 
Highly efficient backups with percona xtrabackup
Nilnandan Joshi
 
My two cents about Mysql backup
Andrejs Vorobjovs
 
Collaborate2011-XtraBackup Collaborate2011-XtraBackup
CvDs3
 
MySQL Enterprise Backup: Better Very Large Database Backup & Recovery and More!!
Tinku Ajit
 
MySQL Enterprise Backup & Oracle Secure Backup
Sanjay Manwani
 
A Backup Today Saves Tomorrow
Andrew Moore
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
Lenz Grimmer
 
MySQL for Oracle DBAs
Mark Leith
 
Backing Up the MySQL Database
Sanjay Manwani
 
OSDC 2012 | Taking hot backups with XtraBackup by Alexey Kopytov
NETWAYS
 
PL22 - Backup and Restore Performance.pptx
Vinicius M Grippa
 
MySQL backup and restore performance
Vinicius M Grippa
 
Percona xtrabackup - MySQL Meetup @ Mumbai
Nilnandan Joshi
 
MySQL enterprise backup overview
郁萍 王
 
Become a MySQL DBA - slides: Deciding on a relevant backup solution
Severalnines
 
MySQL Enterprise Backup
Mario Beck
 
Meb Backup & Recovery Performance
Keith Hollman
 
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)

PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PPTX
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPT
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
Big Data and Data Science hype .pptx
SUNEEL37
 
PPTX
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
PPTX
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
Big Data and Data Science hype .pptx
SUNEEL37
 
Presentation 2.pptx AI-powered home security systems Secure-by-design IoT fr...
SoundaryaBC2
 
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Thermal runway and thermal stability.pptx
godow93766
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
MRRS Strength and Durability of Concrete
CivilMythili
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 

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