Más contenido relacionado La actualidad más candente (20) Similar a MySQL Enterprise Backup apr 2016 (20) MySQL Enterprise Backup apr 20162. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
MySQL Enterprise Backup
Ted Wennmark, MySQL solution architect
ted.wennmark@oracle.com
Oracle Confidential –Internal/Restricted/Highly Restricted 2
3. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Why backups?
• Datais your most valuable IP. You hate to protect it from loss
• DisasterRecovery
• Hardware, Software, Developer or DBA error
• Migration and Upgrades – Change Hardware
• Create replica’ s for HA setup
• Archival – requirements to keep data for X number of years
• Move chunks of data
• Setup Test Environments
Oracle Confidential –Internal/Restricted/Highly Restricted 3
4. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Backup and Recovery can be trickier than it appears
Requires some fore thought and planning
• How do you backup your critical production systems?
• While servers are performing critical business functions
• And downtown is not acceptable
• Where negative performance impacts are not acceptable
• Finding proper backup storage is critical
Oracle Confidential –Internal/Restricted/Highly Restricted 4
5. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
What you can use depends on what you are backing up
• Size – A tiny table or a Massive Database
• Activity – Is the Database very busy or it is an inactive database
– Try not to overlap busy database with backups if possible
– For logical you ‘’l get locking collisions
– For physical the backup will be larger
• It collects data to make everything consistent – this takes space
• Recoverywill take longer – it must apply the data to make consistent.
• Cost – Is the data within the database compressed?
– Most databases are highly compressible– however if your database contains
compressedcell data – don’t recompression won’t help and will slow things down
Oracle Confidential –Internal/Restricted/Highly Restricted 5
6. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Recovery
• How fast do you need to recover?
• Immediate
– Replication
• ASAP
– Physicalis several orders of magnitude faster
• Doesn’t matter (its Archival)
– Then cost and size more of a factor
• Doesn’t matter (its Logical)
– Will be slower but flexibility is more important
Oracle Confidential –Internal/Restricted/Highly Restricted 6
7. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Cost/Benefit
Do the math
• Is it archived?
– Writing to a media manager or tape
– Writing to Cloud Storage
• Long term disk or other media cost
– Compressioncan save you $s
Oracle Confidential –Internal/Restricted/Highly Restricted 7
8. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
• Logical
– New mysqlpump (included in 5.7)
• A modern highly parallel data pump
– Mysqldump
– Mysqldbexport/import
• Part of MySQL Utilities
• Physical
• MySQL Enterprise Backup (MEB)
• Transportable Table Spaces
• OS Backups
– “Cold”File System Backups
– Snapshots
• For example LVM, other Filesystems or HW
based
• Continuous
– Replicas (MySQL Replication)
• Often with slave lag
– Binlog Tools
Oracle Confidential –Internal/Restricted/Highly Restricted 8
One size does Not fit all “Use Cases”
Pick the right tool(s) for the job(s)
9. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Logical Backups
• Backup
– Creates collection of SQL Statements used to recreate database objects (tables etc)
and the data within them – Inserts statements
– May include data in separate files saved in a cross platform format
• Restore
– Runs these SQL Statements to restore objects and the data
Oracle Confidential –Internal/Restricted/Highly Restricted 9
10. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Logical Backup
• Advantages
– Easy of use - simple commands allow you to easily backup and restore
– Good for small database or tables – minimum impact on backup and restore
performance
– Flexibility – logical backup allows you to choose what you want to backup and not
backup.Change the scripts to restore partially etc.
– Cross Platform –works no matter the platform
– Readability - Good assurance that database files are not corrupt - all the data is read
and it is read using standard SQL queries.
Oracle Confidential –Internal/Restricted/Highly Restricted 10
11. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Logical Backup
• Disadvantages
– Not an online solution – write operations are locked while performing the backup,
thereby blocking use of the database
– Poor to VERY Poor performance – backup and especially restore times are very slow
for larger databases( 1or more orders of magnitude)
– Large Files – will be many times larger than actually database files
– Not consistent unless you lock everything the database won’t necessarily be restored
to a consistentstate
– No incremental backup – all backups are full backups,can be time consuming and
require more storage
Oracle Confidential –Internal/Restricted/Highly Restricted 11
12. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
• HOT, NON-Blocking for Innodb
• Performance –faster for backups and faster for
restore
• Scalable – performance is near linear for larger
databases.
• Efficient –processed mostly run outside server
• More compact backup files – up to 90%
compression in some cases
• Secure – supports AES 256 compression
• Flexible – support for incremental backups,
partial backups, backup compression, point
in time recovery and more.
• Many target supported directly
– MediaManagers–Oracle Secure Backup
– Cloud Storage– AES S3,OpenStackSwift
– GeneralStreaming(pipe to SSH etc)
• Archival Backups – suitable archival format
for historical purposes
• Consistent – delivers consistent point in time
recovery
Oracle Confidential –Internal/Restricted/Highly Restricted 12
Physical Backup (MEB)
• Copy of the internal files that constitute the MySQL database
• Restore Copy back Internal Files and Replay data changes to make data
consistent.
13. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
• FULL Logical Backups
– Impractical in many situations
• Logical RESTORE takes much longer
– Typically2x of BACKUP time
Oracle Confidential –Internal/Restricted/Highly Restricted 13
Performance with MySQL Enterprise Backup
14. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
TransportableTablespace (MEB)
• Copy and Move a MySQL Innodb Tablespace
• Advantages
– Fast
• Runs at file level
• Flexible
– Can move one or more tablespaces
– Instanceremains up when “restoring” a tablespace
Oracle Confidential –Internal/Restricted/Highly Restricted 14
15. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
To consider performance think of structure of a
running backup – one way is like this
Oracle Confidential –Internal/Restricted/Highly Restricted 15
16. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
To consider performance think of structure of a
running backup – or like this
Oracle Confidential –Internal/Restricted/Highly Restricted 16
17. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
To consider performance think of structure of a
running backup – or like this
Oracle Confidential –Internal/Restricted/Highly Restricted 17
MEB 4.0 now
reports back
with Tape ID
18. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
To consider performance think of structure of a
running backup – or like this
Oracle Confidential –Internal/Restricted/Highly Restricted 18
Cloud
Storage
(S3, Swift))
19. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Oracle Secure Backup (OSB)
• Centralized Tape Backup Management
Oracle Confidential –Internal/Restricted/Highly Restricted 19
• RMAN-Oracle Recovery Manager,MEB– MySQLEnterprise Backup,SBT – Oracle’sAPI for Integrationwith Media
Managers
20. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
What determines backup speed? The longest time
Oracle Confidential –Internal/Restricted/Highly Restricted 20
21. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
What determines backup speed? The longest time
Oracle Confidential –Internal/Restricted/Highly Restricted 21
22. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
What determines backup speed? The longest time
Oracle Confidential –Internal/Restricted/Highly Restricted 22
23. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
What determines backup speed? The longest Time
Oracle Confidential –Internal/Restricted/Highly Restricted 23
Unlikely on
modern systems
24. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Too much Sharing – slows things down –
Mostly IO Contention, At times CPU
Oracle Confidential –Internal/Restricted/Highly Restricted 24
RISKY
Lose database
and database
backupif storage
systemfails
And SLOW
And has Side
Effects
25. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Improving backup speed
Oracle Confidential –Internal/Restricted/Highly Restricted 25
26. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Does Highest Compression=Higher Speed
Not typically
Oracle Confidential –Internal/Restricted/Highly Restricted 26
27. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
MySQL Enterprise Backup is Truly Parallel
Read, Write, Processing
Oracle Confidential –Internal/Restricted/Highly Restricted 27
28. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Selective backup with TTS
• What is TTS, why better (in some cases) than normal partial backup
Oracle Confidential –Internal/Restricted/Highly Restricted 28
• MySQL 5.6+ feature: Transportable
• Table spaces
– Online table portability: Import/Export
• In MySQL 5.7 supports TTS per
partition
• MEB implements methods that
– LimitedLocking time
– Easy of use
29. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Image or Directory backup and Performance
• MySQL Enterprise Backup supports
– Backup to a single image – a single file or streamed
– Backup to a directory
• In our testing confirms – Image is often a bit better
– Performance advantage comes from combining different steps that you might
otherwise have to perform in sequence
• Going forward - Focus on image (a file)
– Only supported for encryption, Cloud Storage, Media Managers..
– Image is simpler to manage
Oracle Confidential –Internal/Restricted/Highly Restricted 30
30. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
• Full Instance
– Config/Settings
• Selective
– Leverages TTS
– Great for large tables
• Encryption
– AES – required for sensitive data
• Skip Unused Pages
– Reduces space
• Continuous progress
– % Bytes, Status
• Monitor disk space
– Optional actions
• Warn & Retry, Abort, Remove
Oracle Confidential –Internal/Restricted/Highly Restricted 31
Other features MEB provides
31. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Understanding your system
• CPU load
– Patterns – look at times of day
– Load level – is it low or high – often DBs are low = 30%
• IO load
– Patterns – look at times of day
– Architecture
• IO rate
– How fast can you read database files?
– How fast can you write?
– Run DD or other tools – whats you MB/sec?
Oracle Confidential –Internal/Restricted/Highly Restricted 32
32. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Backup Strategy
• A comprehensive plan for backup and recovery
Oracle Confidential –Internal/Restricted/Highly Restricted 34
33. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Validate
• No backup strategy is complete without validating backup
Oracle Confidential –Internal/Restricted/Highly Restricted 35
34. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
References
• MySQL Enterprise Backup: Product Information
– www.mysql.com/products/enterprise/backup.html
• MySQL Enterprise Backup Team Blog
– https://blogs.oracle.com/mysqlenterprisebackup/
• MySQL Enterprise Backup: Documentation
– dev.mysql.com/doc/mysql-enterprisebackup/3.10/en/index.html
• How Do I get it
– https://edelivery.oracle.com
• Support and patches (My Oracle Support = MOS)
– https://support.oracle.com
Oracle Confidential –Internal/Restricted/Highly Restricted 36
35. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. |
Thanks for Attending
• You‟ll get the slides
• Please don‟t hesitate to send us ideas, feedback, doc requests, blog
requests, etc.
• http://bugs.mysql.com/report.php
• Directly through support
• Blog Comments
• Email
Oracle Confidential –Internal/Restricted/Highly Restricted 37
36. Copyright © 2014, Oracleand/orits affiliates. Allrights reserved. | Oracle Confidential –Internal/Restricted/Highly Restricted 38