SlideShare a Scribd company logo
1 of 28
Download to read offline
1

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Backup:
Recovery Performance
Keith Hollman
MySQL Principal Sales Consultant EMEA
Agenda
 Backup Mission Objective.
 mysqldump &

MySQL Enterprise Backup (mysqlbackup).

 Restoring.
 Conclusion.

3

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Backup Mission Objective
Goal
 Testing for speed:
– Based on a current usage of mysqldump.
– Evaluation of MySQL Enterprise Backup.
– And some performance tuning / parallelizing.

4

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Backup Mission Objective
Setup
 What are we using to test the scenario:
– Ubuntu 12.04 LTS, 32bit Intel Pentium M 1.86Ghz, 2Gb
– Source disk: internal 80Gb ATA ST9808211A

– Destination:

external 1Tb SAMSUNG HD103SI

– MySQL Enterprise Edition 5.6.15
– MySQL Enterprise Backup 3.9.0

– Employees sample database duplicated via MySQL Utilities 1.3.6 (on Win7

PC) to generate a ~5Gb MySQL Server.
mysqldbcopy --source=root:pass@host:3356 --destination=root:pass@host:3356 employees:employees1
employees:employees2 employees:employees3 employees:employees4 ... employees:employees18
employees:employees19 employees:employees20

5

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Backup Mission Objective
IO Expectations.
 To local disk:
dd if=/dev/zero of=/root/ddIOtest1 bs=1G count=1 oflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 41.0825 s, 26.1 MB/s

 To external HD disk:
dd if=/dev/zero of=/media/1T_iomega/ddIOtest1 bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 41.214 s, 26.1 MB/s

 To external HD disk via symbolic link:
dd if=/dev/zero of=/home/mysql/MEB/test/ddIOtest1 bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 41.3047 s, 26.0 MB/s

Other dd tests were run: bs=300M

count=3 @ 26.8 MB/s, bs=200M count=5 @ 26.7 MB/s, bs=100M
count=10 @ 26.7 MB/s, bs=300M count=5 @ 26.1 MB/s.

6

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
mysqldump & MySQL
Enterprise Backup

8

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
mysqldump
Non-Enterprise Backup
 Before we use our Enterprise solution, what would we be looking at for

backup & restore time frames?:
mysqldump -uroot -ppass -S /tmp/mysql.sock --all-databases 
--add-drop-database -r mysqldump_full.sql
start: Fri Jan 3 13:30:36 CET 2014
end:
Fri Jan 3 13:41:17 CET 2014
10:41 min.
$ du –sk
3453640 mysqldump_full.sql
5387 Kb/sec.

9

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
mysqldump
Non-Enterprise Restore
$ cp /usr/local/mysql/my.cnf mysqldump_full_test
$ cd mysqldump_full_test
$ vi my.cnf
change all file paths, port numbers, change server-id (just in case) and add a new socket dir.
$ cd /usr/local/mysql
$ scripts/mysql_install_db --defaults-file=/home/mysql/MEB/test/mysqldump_full_test/my.cnf --user=mysql -datadir=/home/mysql/MEB/test/mysqldump_full_test/datadir
$ mysqld_safe --defaults-file=/home/mysql/MEB/my.cnf --user=mysql -datadir=/home/mysql/MEB/test/mysqldump_full_test/datadir --socket=/tmp/mysql_mysqldump_restore.sock -port=13356
$ mysqladmin -uroot password ‘pass' -S /tmp/mysql_mysqldump_restore.sock
$ mysql -uroot -ppass -S /tmp/mysql_mysqldump_restore.sock
mysql> show databases;
(To avoid the GTID error, you might have to execute " reset master;" before trying the restore.)
mysql -uroot –ppass -S /tmp/mysql_mysqldump_restore.sock < mysqldump_full.sql
start: Fri Jan 3 15:16:45 CET 2014
end:
Fri Jan 3 16:26:26 CET 2014
1:09:41 min. (1hr 9 mins 41 sec.) 4181 sec.
$ du –sk
4974081 (21x employee schemas dir's)
1189.68 Kb / sec.
10

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Backup
mysqlbackup
 Simple usage:
mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-dir=/home/mysql/MEB/test
--with-timestamp backup

 And the results:
start: Tue Dec 31 13:09:05 CET 2013
end:
Tue Dec 31 13:13:56 CET 2013
5054864 2013-12-31_13-09-05
4:51 min.
17370.66666666667 Kb/sec.

11

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Backup
Configuration and Performance Times
 Parallel Backup
– By using parallelization configuration we can improve backup performance significantly. The

following is the default setting for MEB 3.9 (for more information see parallel backup description):
--read-threads=1 --process-threads=6 --write-threads=1 --limit-memory=300

 And again, the results:
read process write
limit number of buffers
threads threads threads memory
(16M each)
1
6
1
300
14
2
3
2
300
10
3
6
3
600
18
3
3
3
300
12
4
4
4
300
16
4
4
4
320
16
4
4
4
640
16
4
8
4
640
20

12

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Backup size (Kb)
5054864
5054872
5054872
5054868
5054872
5054876
5054876
5054876

Duration
(hh:mm:ss)
00:04:50
00:04:32
00:04:11
00:03:57
00:03:51
00:03:37
00:03:37
00:03:37

Kb/sec
17430.57
18584.09
20138.93
21328.56
21882.56
23294.35
23294.35
23294.35
Restoring

13

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
 Scenario specifics:
– We want to restore a single table, Partial Recovery, not the whole server.
– The table to be restored is on a running server and can’t be stopped.
– No compression is being used.

 What about having specified --user-tts at backup time?
– Backups taken with this option are meant to transport the table to another, new

environment, i.e. tables can’t be restored selectively from these types of backups.
– The tables to be restored can’t exist on the destination server.
– mysqlbackup is already flexible enough to be able to single out a table and restore it
via the transportable tablespace definition, i.e. discard / import tablespace.
14

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
Converting the on-disk backup to image.
 First convert to image, so that we can then extract the table, or

apply-logs from incremental backups taken post-Full backup:
mysqlbackup --user=root --socket=/tmp/mysql.sock 
--backup-image=/home/mysql/MEB/test/2014-01-02_13-57-17.mbi 
--backup-dir=/home/mysql/MEB/test/2014-01-02_13-57-17 --read-threads=4 
--write-threads=4 --process-threads=8 --limit-memory=320 backup-dir-to-image
Start:
140102 15:57:34
End:
140102 16:04:50
7:16 min.
5054052 /home/mysql/MEB/test/2014-01-02_13-57-17.mbi
11591.86 Kb/sec.

 Or…
15

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
Backing up directly to image.
 … have backed up directly to the single image file :
mysqlbackup --user=root --socket=/tmp/mysql.sock 
--backup-image=/home/mysql/MEB/test/full.mbi –backup-dir=/home/mysql/MEB/test/full 
--with-timestamp --read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 

backup-to-image
Start: 140102 14:43:01
End: 140102 14:47:43
4:42 min.
5054124 full.mbi
16735.50 Kb/sec

 Now to restore…

16

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
Native Transportable tablespace
 Knowing we're going to use transportable tablespace from the image

backup file, and that the table has just lost some rows (as if it had been
deleted, we'd have to recover in another env and then mysqldump it
out).
 First check the image file and list the table location:
mysqlbackup --user=root --socket=/tmp/mysql.sock 
--backup-image=/home/mysql/MEB/test/full.mbi --read-threads=4 --write-threads=4 
--process-threads=8 --limit-memory=320 --sleep=0 list-image

17

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
Native Transportable tablespace
 Restore:
mysql> lock tables salaries write;
mysql> alter table salaries discard tablespace;
mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-image=/home/mysql/MEB/test/full.mbi -read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 --sleep=0 --srcentry=datadir/employees/salaries.ibd --dst-entry=/opt/mysql/5615/data/employees/salaries.ibd
extract
Start: 140102 16:48:04
End:
140102 16:48:09
0:05 min.
143360
/opt/mysql/5615/data/employees1/salaries.ibd
28672.00 Kb/sec.
mysql> alter table salaries import tablespace;
mysql> desc salaries;

18

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
A Full Restore
 Consider that the table has been deleted and we need to restore the

full backup.
– Restore the image backup to a new backup / datadir.
– Start the restored environment with a modified my.cnf.
– Export & import the desired data for the affected table into the working

environment.
– Carry on working with some minor disruption to the affected table.

 The details:
19

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
A Full Restore: details.
mysqlbackup --user=root --password=oracle --socket=/tmp/mysql.sock --backupimage=/home/mysql/MEB/test/full.mbi –backup-dir=/home/mysql/MEB/test/full-img-restore --readthreads=4 --write-threads=4 --process-threads=8 --limit-memory=320 --sleep=0 image-to-backupdir
start: Thu Jan 2 16:58:28 CET 2014
end:
Thu Jan 2 17:04:46 CET 2014
6:18 min.
5054972 full-img-restore
13372.94 Kb/sec.

 Now, we can start up the restored env to use and abuse the salaries table we're worried

about:
$ cd /home/mysql/MEB/test/full-img-restore

20

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
A Full Restore: details. – continued
$ vi server-my.cnf
change all paths (datadir, socket, pid_file, log_bin, log_bin_index, log_error, port & report
port if using replication.
$ mysqld_safe --defaults-file=/home/mysql/MEB/test/full-img-restore/server-my.cnf --user=mysql -datadir=/home/mysql/MEB/test/full-img-restore/datadir -P13356 --socket=/tmp/mysql_restore.sock
&
$ mysql -uroot –ppass -S /tmp/mysql_restore.sock
mysql> use employees
mysql> show table like salaries;

 Now to double check the instance where we're missing the salaries table:
$ mysql -uroot –ppass -S /tmp/mysql.sock
mysql> use employees
mysql> show table status;
mysql> show create table salaries;
ERROR 1146 (42S02): Table 'employees.salaries' doesn't exist
21

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
A Full Restore: details. – continued
 So now to import / recreate the previously dropped 'employees.salaries' table,

and check times, after all, we are interested:
mysqldump –uroot –ppass -S /tmp/mysql_restore.sock --tables employees salaries |
mysql -uroot –ppass -S /tmp/mysql.sock employees
Start: Fri Jan 3 13:16:38 CET 2014
End:
Fri Jan 3 13:19:37 CET 2014
2:59 min
143364 /opt/mysql/5615/data/employees/salaries.ibd
800.91 Kb/sec.

22

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Restoring
Checking & Alternatives
MySQL Utilities 1.3.6
 Once the backup has been restored in another environment, use

MySQL Utilities ‘mysqldiff’ to see if it’s missing:
mysqldiff --server1=root:oracle@141.144.12.45:3356 -server2=root:oracle@141.144.12.45:13356 employees.salaries:employees.salaries

– If the row number is different, mysqldiff doesn’t detect this, it’s only for

object and structure differences.
# server1 on 141.144.12.45: ... connected.
# server2 on 141.144.12.45: ... connected.
# Comparing employees.salaries to employees.salaries
Success. All objects are the same.

23

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

[PASS]
Restoring
Checking & Alternatives
 Use Utilities mysqldbcompare to get exact changes and data consistency

checking. Saves having to restore the whole table:
mysqldbcompare --server1=root:oracle@141.144.12.45:3356 --server2=root:oracle@141.144.12.45:13356
employees:employees -a -d differ –vvv

could be used, however be wary of auto-increment
sequences & Foreign Keys.
 Also restore the .frm from the backup image fileset, to change the
datadir for that specific tablespace and then use mysqldump | mysql to
import the row data.
 mysqlfrm

24

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Conclusion

25

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Conclusion.

mysqlbackup restores the single transportable tablespace at
28672.00 Kb/sec where mysqldump is done at 800.91
Kb/sec: 35.79 times faster.
(In this scenario, a 4 column table with 2844047 rows).

26

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
27

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
28

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
29

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

More Related Content

What's hot

MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)Mydbops
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015Dave Stokes
 
MySQL Enterprise Backup
MySQL Enterprise BackupMySQL Enterprise Backup
MySQL Enterprise BackupMark Swarbrick
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxNeoClova
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage enginesVasudeva Rao
 
MySQL :What's New #GIDS16
MySQL :What's New #GIDS16MySQL :What's New #GIDS16
MySQL :What's New #GIDS16Sanjay Manwani
 
MySQL Enterprise Backup & Oracle Secure Backup
MySQL Enterprise Backup &  Oracle Secure BackupMySQL Enterprise Backup &  Oracle Secure Backup
MySQL Enterprise Backup & Oracle Secure BackupSanjay Manwani
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)NeoClova
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningLenz Grimmer
 
My First 100 days with an Exadata (WP)
My First 100 days with an Exadata  (WP)My First 100 days with an Exadata  (WP)
My First 100 days with an Exadata (WP)Gustavo Rene Antunez
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retoreVasudeva Rao
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMarco Tusa
 
Oracle Database In-Memory & Multitenant - TROUG Days'16 Istanbul
Oracle Database In-Memory & Multitenant - TROUG Days'16 IstanbulOracle Database In-Memory & Multitenant - TROUG Days'16 Istanbul
Oracle Database In-Memory & Multitenant - TROUG Days'16 IstanbulMahir M. Quluzade
 
IEEE Day 2013 - Best 10 New Features of Oracle Database 12c
IEEE Day 2013 - Best 10 New Features of Oracle Database 12cIEEE Day 2013 - Best 10 New Features of Oracle Database 12c
IEEE Day 2013 - Best 10 New Features of Oracle Database 12cMahir M. Quluzade
 
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software ReleaseIsabella789
 

What's hot (20)

MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)MySQL Enterprise Backup (MEB)
MySQL Enterprise Backup (MEB)
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10
 
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015MySQL's new Secure by Default Install -- All Things Open October 20th 2015
MySQL's new Secure by Default Install -- All Things Open October 20th 2015
 
MySQL Enterprise Backup
MySQL Enterprise BackupMySQL Enterprise Backup
MySQL Enterprise Backup
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage engines
 
MySQL :What's New #GIDS16
MySQL :What's New #GIDS16MySQL :What's New #GIDS16
MySQL :What's New #GIDS16
 
MySQL Enterprise Backup & Oracle Secure Backup
MySQL Enterprise Backup &  Oracle Secure BackupMySQL Enterprise Backup &  Oracle Secure Backup
MySQL Enterprise Backup & Oracle Secure Backup
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
 
My First 100 days with an Exadata (WP)
My First 100 days with an Exadata  (WP)My First 100 days with an Exadata  (WP)
My First 100 days with an Exadata (WP)
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retore
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the Cloud
 
Oracle Database In-Memory & Multitenant - TROUG Days'16 Istanbul
Oracle Database In-Memory & Multitenant - TROUG Days'16 IstanbulOracle Database In-Memory & Multitenant - TROUG Days'16 Istanbul
Oracle Database In-Memory & Multitenant - TROUG Days'16 Istanbul
 
IEEE Day 2013 - Best 10 New Features of Oracle Database 12c
IEEE Day 2013 - Best 10 New Features of Oracle Database 12cIEEE Day 2013 - Best 10 New Features of Oracle Database 12c
IEEE Day 2013 - Best 10 New Features of Oracle Database 12c
 
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release
1Z0-027 Exam-Oracle Exadata Database Machine Administration, Software Release
 

Similar to Meb Backup & Recovery Performance

Making Backups in Extreme Situations
Making Backups in Extreme SituationsMaking Backups in Extreme Situations
Making Backups in Extreme SituationsSveta Smirnova
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloudTahsin Hasan
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017Dave Stokes
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureKenny Gryp
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxRoger Eisentrager
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
Multiple instances on linux
Multiple instances on linuxMultiple instances on linux
Multiple instances on linuxVasudeva Rao
 
MySQL 内存分析
MySQL 内存分析MySQL 内存分析
MySQL 内存分析YUCHENG HU
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replicationPoguttuezhiniVP
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseNikhil Kumar
 
Webinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetWebinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetOlinData
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsRogério Rocha
 
Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryContinuent
 

Similar to Meb Backup & Recovery Performance (20)

Making Backups in Extreme Situations
Making Backups in Extreme SituationsMaking Backups in Extreme Situations
Making Backups in Extreme Situations
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on Linux
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Multiple instances on linux
Multiple instances on linuxMultiple instances on linux
Multiple instances on linux
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
 
MySQL 内存分析
MySQL 内存分析MySQL 内存分析
MySQL 内存分析
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
Mydumper
MydumperMydumper
Mydumper
 
Mysql
MysqlMysql
Mysql
 
Mysql
Mysql Mysql
Mysql
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
 
Webinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetWebinar - Setup MySQL with Puppet
Webinar - Setup MySQL with Puppet
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windows
 
Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & Recovery
 

More from Keith Hollman

MySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR ScenariosMySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR ScenariosKeith Hollman
 
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Keith Hollman
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoKeith Hollman
 
MySQL Technology Overview
MySQL Technology OverviewMySQL Technology Overview
MySQL Technology OverviewKeith Hollman
 
MySQL 8.0 Released Update
MySQL 8.0 Released UpdateMySQL 8.0 Released Update
MySQL 8.0 Released UpdateKeith Hollman
 
MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)Keith Hollman
 
MySQL 8.0 InnoDB Cluster demo
MySQL 8.0 InnoDB Cluster demoMySQL 8.0 InnoDB Cluster demo
MySQL 8.0 InnoDB Cluster demoKeith Hollman
 
MySQL NoSQL JSON JS Python "Document Store" demo
MySQL NoSQL JSON JS Python "Document Store" demoMySQL NoSQL JSON JS Python "Document Store" demo
MySQL NoSQL JSON JS Python "Document Store" demoKeith Hollman
 
MySQL Cluster: El ‘qué’ y el ‘cómo’.
MySQL Cluster: El ‘qué’ y el ‘cómo’.MySQL Cluster: El ‘qué’ y el ‘cómo’.
MySQL Cluster: El ‘qué’ y el ‘cómo’.Keith Hollman
 
MySQL Una Introduccion Tecnica
MySQL Una Introduccion TecnicaMySQL Una Introduccion Tecnica
MySQL Una Introduccion TecnicaKeith Hollman
 
A MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverA MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverKeith Hollman
 

More from Keith Hollman (11)

MySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR ScenariosMySQL Enterprise Backup - BnR Scenarios
MySQL Enterprise Backup - BnR Scenarios
 
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
Moodle Moot Spain: Moodle Available and Scalable with MySQL HA - InnoDB Clust...
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
 
MySQL Technology Overview
MySQL Technology OverviewMySQL Technology Overview
MySQL Technology Overview
 
MySQL 8.0 Released Update
MySQL 8.0 Released UpdateMySQL 8.0 Released Update
MySQL 8.0 Released Update
 
MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)MySQL Enterprise Edition - Complete Guide (2019)
MySQL Enterprise Edition - Complete Guide (2019)
 
MySQL 8.0 InnoDB Cluster demo
MySQL 8.0 InnoDB Cluster demoMySQL 8.0 InnoDB Cluster demo
MySQL 8.0 InnoDB Cluster demo
 
MySQL NoSQL JSON JS Python "Document Store" demo
MySQL NoSQL JSON JS Python "Document Store" demoMySQL NoSQL JSON JS Python "Document Store" demo
MySQL NoSQL JSON JS Python "Document Store" demo
 
MySQL Cluster: El ‘qué’ y el ‘cómo’.
MySQL Cluster: El ‘qué’ y el ‘cómo’.MySQL Cluster: El ‘qué’ y el ‘cómo’.
MySQL Cluster: El ‘qué’ y el ‘cómo’.
 
MySQL Una Introduccion Tecnica
MySQL Una Introduccion TecnicaMySQL Una Introduccion Tecnica
MySQL Una Introduccion Tecnica
 
A MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverA MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole Crossover
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Meb Backup & Recovery Performance

  • 1. 1 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 2. MySQL Enterprise Backup: Recovery Performance Keith Hollman MySQL Principal Sales Consultant EMEA
  • 3. Agenda  Backup Mission Objective.  mysqldump & MySQL Enterprise Backup (mysqlbackup).  Restoring.  Conclusion. 3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 4. Backup Mission Objective Goal  Testing for speed: – Based on a current usage of mysqldump. – Evaluation of MySQL Enterprise Backup. – And some performance tuning / parallelizing. 4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 5. Backup Mission Objective Setup  What are we using to test the scenario: – Ubuntu 12.04 LTS, 32bit Intel Pentium M 1.86Ghz, 2Gb – Source disk: internal 80Gb ATA ST9808211A – Destination: external 1Tb SAMSUNG HD103SI – MySQL Enterprise Edition 5.6.15 – MySQL Enterprise Backup 3.9.0 – Employees sample database duplicated via MySQL Utilities 1.3.6 (on Win7 PC) to generate a ~5Gb MySQL Server. mysqldbcopy --source=root:pass@host:3356 --destination=root:pass@host:3356 employees:employees1 employees:employees2 employees:employees3 employees:employees4 ... employees:employees18 employees:employees19 employees:employees20 5 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 6. Backup Mission Objective IO Expectations.  To local disk: dd if=/dev/zero of=/root/ddIOtest1 bs=1G count=1 oflag=direct 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 41.0825 s, 26.1 MB/s  To external HD disk: dd if=/dev/zero of=/media/1T_iomega/ddIOtest1 bs=1G count=1 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 41.214 s, 26.1 MB/s  To external HD disk via symbolic link: dd if=/dev/zero of=/home/mysql/MEB/test/ddIOtest1 bs=1G count=1 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 41.3047 s, 26.0 MB/s Other dd tests were run: bs=300M count=3 @ 26.8 MB/s, bs=200M count=5 @ 26.7 MB/s, bs=100M count=10 @ 26.7 MB/s, bs=300M count=5 @ 26.1 MB/s. 6 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 7. mysqldump & MySQL Enterprise Backup 8 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 8. mysqldump Non-Enterprise Backup  Before we use our Enterprise solution, what would we be looking at for backup & restore time frames?: mysqldump -uroot -ppass -S /tmp/mysql.sock --all-databases --add-drop-database -r mysqldump_full.sql start: Fri Jan 3 13:30:36 CET 2014 end: Fri Jan 3 13:41:17 CET 2014 10:41 min. $ du –sk 3453640 mysqldump_full.sql 5387 Kb/sec. 9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 9. mysqldump Non-Enterprise Restore $ cp /usr/local/mysql/my.cnf mysqldump_full_test $ cd mysqldump_full_test $ vi my.cnf change all file paths, port numbers, change server-id (just in case) and add a new socket dir. $ cd /usr/local/mysql $ scripts/mysql_install_db --defaults-file=/home/mysql/MEB/test/mysqldump_full_test/my.cnf --user=mysql -datadir=/home/mysql/MEB/test/mysqldump_full_test/datadir $ mysqld_safe --defaults-file=/home/mysql/MEB/my.cnf --user=mysql -datadir=/home/mysql/MEB/test/mysqldump_full_test/datadir --socket=/tmp/mysql_mysqldump_restore.sock -port=13356 $ mysqladmin -uroot password ‘pass' -S /tmp/mysql_mysqldump_restore.sock $ mysql -uroot -ppass -S /tmp/mysql_mysqldump_restore.sock mysql> show databases; (To avoid the GTID error, you might have to execute " reset master;" before trying the restore.) mysql -uroot –ppass -S /tmp/mysql_mysqldump_restore.sock < mysqldump_full.sql start: Fri Jan 3 15:16:45 CET 2014 end: Fri Jan 3 16:26:26 CET 2014 1:09:41 min. (1hr 9 mins 41 sec.) 4181 sec. $ du –sk 4974081 (21x employee schemas dir's) 1189.68 Kb / sec. 10 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 10. MySQL Enterprise Backup mysqlbackup  Simple usage: mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-dir=/home/mysql/MEB/test --with-timestamp backup  And the results: start: Tue Dec 31 13:09:05 CET 2013 end: Tue Dec 31 13:13:56 CET 2013 5054864 2013-12-31_13-09-05 4:51 min. 17370.66666666667 Kb/sec. 11 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 11. MySQL Enterprise Backup Configuration and Performance Times  Parallel Backup – By using parallelization configuration we can improve backup performance significantly. The following is the default setting for MEB 3.9 (for more information see parallel backup description): --read-threads=1 --process-threads=6 --write-threads=1 --limit-memory=300  And again, the results: read process write limit number of buffers threads threads threads memory (16M each) 1 6 1 300 14 2 3 2 300 10 3 6 3 600 18 3 3 3 300 12 4 4 4 300 16 4 4 4 320 16 4 4 4 640 16 4 8 4 640 20 12 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Backup size (Kb) 5054864 5054872 5054872 5054868 5054872 5054876 5054876 5054876 Duration (hh:mm:ss) 00:04:50 00:04:32 00:04:11 00:03:57 00:03:51 00:03:37 00:03:37 00:03:37 Kb/sec 17430.57 18584.09 20138.93 21328.56 21882.56 23294.35 23294.35 23294.35
  • 12. Restoring 13 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 13. Restoring  Scenario specifics: – We want to restore a single table, Partial Recovery, not the whole server. – The table to be restored is on a running server and can’t be stopped. – No compression is being used.  What about having specified --user-tts at backup time? – Backups taken with this option are meant to transport the table to another, new environment, i.e. tables can’t be restored selectively from these types of backups. – The tables to be restored can’t exist on the destination server. – mysqlbackup is already flexible enough to be able to single out a table and restore it via the transportable tablespace definition, i.e. discard / import tablespace. 14 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 14. Restoring Converting the on-disk backup to image.  First convert to image, so that we can then extract the table, or apply-logs from incremental backups taken post-Full backup: mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-image=/home/mysql/MEB/test/2014-01-02_13-57-17.mbi --backup-dir=/home/mysql/MEB/test/2014-01-02_13-57-17 --read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 backup-dir-to-image Start: 140102 15:57:34 End: 140102 16:04:50 7:16 min. 5054052 /home/mysql/MEB/test/2014-01-02_13-57-17.mbi 11591.86 Kb/sec.  Or… 15 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 15. Restoring Backing up directly to image.  … have backed up directly to the single image file : mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-image=/home/mysql/MEB/test/full.mbi –backup-dir=/home/mysql/MEB/test/full --with-timestamp --read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 backup-to-image Start: 140102 14:43:01 End: 140102 14:47:43 4:42 min. 5054124 full.mbi 16735.50 Kb/sec  Now to restore… 16 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 16. Restoring Native Transportable tablespace  Knowing we're going to use transportable tablespace from the image backup file, and that the table has just lost some rows (as if it had been deleted, we'd have to recover in another env and then mysqldump it out).  First check the image file and list the table location: mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-image=/home/mysql/MEB/test/full.mbi --read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 --sleep=0 list-image 17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 17. Restoring Native Transportable tablespace  Restore: mysql> lock tables salaries write; mysql> alter table salaries discard tablespace; mysqlbackup --user=root --socket=/tmp/mysql.sock --backup-image=/home/mysql/MEB/test/full.mbi -read-threads=4 --write-threads=4 --process-threads=8 --limit-memory=320 --sleep=0 --srcentry=datadir/employees/salaries.ibd --dst-entry=/opt/mysql/5615/data/employees/salaries.ibd extract Start: 140102 16:48:04 End: 140102 16:48:09 0:05 min. 143360 /opt/mysql/5615/data/employees1/salaries.ibd 28672.00 Kb/sec. mysql> alter table salaries import tablespace; mysql> desc salaries; 18 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 18. Restoring A Full Restore  Consider that the table has been deleted and we need to restore the full backup. – Restore the image backup to a new backup / datadir. – Start the restored environment with a modified my.cnf. – Export & import the desired data for the affected table into the working environment. – Carry on working with some minor disruption to the affected table.  The details: 19 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 19. Restoring A Full Restore: details. mysqlbackup --user=root --password=oracle --socket=/tmp/mysql.sock --backupimage=/home/mysql/MEB/test/full.mbi –backup-dir=/home/mysql/MEB/test/full-img-restore --readthreads=4 --write-threads=4 --process-threads=8 --limit-memory=320 --sleep=0 image-to-backupdir start: Thu Jan 2 16:58:28 CET 2014 end: Thu Jan 2 17:04:46 CET 2014 6:18 min. 5054972 full-img-restore 13372.94 Kb/sec.  Now, we can start up the restored env to use and abuse the salaries table we're worried about: $ cd /home/mysql/MEB/test/full-img-restore 20 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 20. Restoring A Full Restore: details. – continued $ vi server-my.cnf change all paths (datadir, socket, pid_file, log_bin, log_bin_index, log_error, port & report port if using replication. $ mysqld_safe --defaults-file=/home/mysql/MEB/test/full-img-restore/server-my.cnf --user=mysql -datadir=/home/mysql/MEB/test/full-img-restore/datadir -P13356 --socket=/tmp/mysql_restore.sock & $ mysql -uroot –ppass -S /tmp/mysql_restore.sock mysql> use employees mysql> show table like salaries;  Now to double check the instance where we're missing the salaries table: $ mysql -uroot –ppass -S /tmp/mysql.sock mysql> use employees mysql> show table status; mysql> show create table salaries; ERROR 1146 (42S02): Table 'employees.salaries' doesn't exist 21 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 21. Restoring A Full Restore: details. – continued  So now to import / recreate the previously dropped 'employees.salaries' table, and check times, after all, we are interested: mysqldump –uroot –ppass -S /tmp/mysql_restore.sock --tables employees salaries | mysql -uroot –ppass -S /tmp/mysql.sock employees Start: Fri Jan 3 13:16:38 CET 2014 End: Fri Jan 3 13:19:37 CET 2014 2:59 min 143364 /opt/mysql/5615/data/employees/salaries.ibd 800.91 Kb/sec. 22 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 22. Restoring Checking & Alternatives MySQL Utilities 1.3.6  Once the backup has been restored in another environment, use MySQL Utilities ‘mysqldiff’ to see if it’s missing: mysqldiff --server1=root:oracle@141.144.12.45:3356 -server2=root:oracle@141.144.12.45:13356 employees.salaries:employees.salaries – If the row number is different, mysqldiff doesn’t detect this, it’s only for object and structure differences. # server1 on 141.144.12.45: ... connected. # server2 on 141.144.12.45: ... connected. # Comparing employees.salaries to employees.salaries Success. All objects are the same. 23 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. [PASS]
  • 23. Restoring Checking & Alternatives  Use Utilities mysqldbcompare to get exact changes and data consistency checking. Saves having to restore the whole table: mysqldbcompare --server1=root:oracle@141.144.12.45:3356 --server2=root:oracle@141.144.12.45:13356 employees:employees -a -d differ –vvv could be used, however be wary of auto-increment sequences & Foreign Keys.  Also restore the .frm from the backup image fileset, to change the datadir for that specific tablespace and then use mysqldump | mysql to import the row data.  mysqlfrm 24 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 24. Conclusion 25 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 25. Conclusion. mysqlbackup restores the single transportable tablespace at 28672.00 Kb/sec where mysqldump is done at 800.91 Kb/sec: 35.79 times faster. (In this scenario, a 4 column table with 2844047 rows). 26 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 26. 27 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 27. 28 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
  • 28. 29 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.