BackingUp MySQL

Embed Size (px)

Citation preview

  • 8/13/2019 BackingUp MySQL

    1/37

  • 8/13/2019 BackingUp MySQL

    2/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.2

    Backing Up the MySQLDatabase

    Sanjay ManwaniMySQL India Director

  • 8/13/2019 BackingUp MySQL

    3/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.3

  • 8/13/2019 BackingUp MySQL

    4/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.4

    Program Agenda

    Understanding Backup

    MySQL Enterprise Backup (MEB)

    Backup Strategies

    Whats New in MEB 3.9

  • 8/13/2019 BackingUp MySQL

    5/37Copyright 2013, Oracle and/or its affiliates. All rights reserved.5

    Understanding Backup

  • 8/13/2019 BackingUp MySQL

    6/37Copyright 2013, Oracle and/or its affiliates. All rights reserved.6

    Why Backup is important

    Audits

    Disasters

    Is HA setup a backup ?

    Is LVM a backup ?

  • 8/13/2019 BackingUp MySQL

    7/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.7

    Types of Backup and Tools for these ty

    Logical

    Mysqldump

    Mysqldbexport/import

    Physical

    MySQL Enterprise Backup (MEB)

  • 8/13/2019 BackingUp MySQL

    8/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.8

    Logical Backup

    Advantages

    Easy of use - simple commands allow you to easily backu

    Good for small database or tablesminimum impact on

    restore performance

    Flexibilitylogical backup allows you to choose what you

    and not backup. Change the scripts to restore partially etc

    Readability - Good assurance that database files are not

    data is read and it is read using standard SQL queries.

    Collection of SQL Queries to recreate the database

  • 8/13/2019 BackingUp MySQL

    9/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.9

    Logical Backup

    Disadvantages

    Not an online solution - write operations are locked while

    backup, thereby blocking use of the database.

    Poor performance for larger databasesbackup and esp

    times are very slow for larger databases.

    Not consistentdatabase wont necessarily be restored state.

    No incremental backupall backups are full backups, ca

    consuming and require more storage.

    Collection of SQL Queries to recreate the database

  • 8/13/2019 BackingUp MySQL

    10/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.10

    Physical Backup (MEB)

    Advantages

    Performancefaster for backups and faster for restore

    Flexiblesupport for incremental backups, partial backup

    compression, point in time recovery and more.

    Archival Backupssuitable archival format for historical

    Scalableperformance is near linear for larger databases

    Consistentdelivers consistent point in time recovery

    Copy of the internal files that constitute the MySQL databa

  • 8/13/2019 BackingUp MySQL

    11/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.11

    Physical v/s LogicalBackup

    0

    1

    2

    3

    4

    5

    6

    Category 1 Category 2 Category 3

    Series 1 Series 2 Series 3

    Comparison Summary

  • 8/13/2019 BackingUp MySQL

    12/37

  • 8/13/2019 BackingUp MySQL

    13/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.13

    MEB Backup

    Full Backup

    Incremental BackupFile based

    and Redo log only

    Compressed Backup

    Backup to Single File/Image Backup to tape

    Partial Backup

    What is methods are available to choose from

  • 8/13/2019 BackingUp MySQL

    14/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.14

    MEBApply log

    InnoDB consists of pages with

    information about the LSNnumber applicable to the page

    Applylog scans the InnoDB redo

    log and applies the relavant

    changes to the InnoDB page and

    upto the correct LSN to beapplied

    The intermediate step

  • 8/13/2019 BackingUp MySQL

    15/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.15

    MEBRecovery

    Copyback

    New! copyback-and-apply-log

    Validate

    Recovery is what is important

  • 8/13/2019 BackingUp MySQL

    16/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.16

    MEB Single image manipulation

    validate

    Ensure that the checksums are consistent list image

    Find the files that this image contains

    Extract

    Extract files from the image

    image-to-backup-dir

    Extract the full image into a directory

    backup-dir-to-image

    Convert a backup directory into a image

    Manage the backup archive/image

  • 8/13/2019 BackingUp MySQL

    17/37

  • 8/13/2019 BackingUp MySQL

    18/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.18

    MEB External Interaction

    Tape and Backup Solutions

    Oracle secure backup Netbackup

    Workbench

    Scheduling

    Monitoring

    MySQL Enterprise Monitor

    Advisors

    MEB integrates with external products

  • 8/13/2019 BackingUp MySQL

    19/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.19

    SBT InterfaceTape and Backup Solutions

  • 8/13/2019 BackingUp MySQL

    20/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.20

    Oracle Secure BackupTape and Backup Solutions

    A general-purpose network

    data protection tool thatsimplifies and automates

    the backup and restore of

    files on a file system.

    A media management

    layer for RecoveryManager through the SBT

    interface.

    Integrates with a wide

    variety of tertiary devices

  • 8/13/2019 BackingUp MySQL

    21/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.21

    WorkbenchMEB & Workbench

    Integrates with

    MEB

    Allows setup of

    automatic backup

    schedules

  • 8/13/2019 BackingUp MySQL

    22/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.22

    WorkbenchMEB & Workbench

    Allows some

    options

    Keeps information

    about backups

  • 8/13/2019 BackingUp MySQL

    23/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.23

    WorkbenchMEB & Workbench

    Helps setup and

    validates thesetup

    Helps in recovery

  • 8/13/2019 BackingUp MySQL

    24/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.24

    MEMMySQL Enterprise Monitor

    Integrates with MEB

    Generates events ifthe backup is not

    taken within specified

    amount of time

    MEB advisors in MEM

    MEM

  • 8/13/2019 BackingUp MySQL

    25/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.25

    MEM

    Allows thresholds to be

    setAdvises users to backup

    within their thresholds

    MEB advisors in MEM

  • 8/13/2019 BackingUp MySQL

    26/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.26

    Backup Strategies

    B k St t i

  • 8/13/2019 BackingUp MySQL

    27/37

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

    Backup Strategies

    Always need to be tailored based on environment data growth, read v/s write usage, size of DB, user base, d

    Based on backup policies of your organization

    Account for spurts in data growth

    Account for schema modificationBefore and after Needs to take into account quiet periods

    Needs to take into account your H/W and storage infrast

    IMPORTANTLYBased on your restore requirement

    .

    A comprehensive plan for backup and recovery

  • 8/13/2019 BackingUp MySQL

    28/37

    E l R St t

  • 8/13/2019 BackingUp MySQL

    29/37

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

    Example Recovery StrategyA comprehensive plan for backup and recovery

    Recoverlog to FullBackup For past 3 days

    RecoverIncremental

    Backup 3 days to 1 week

    ArchBack Archi

    backuthan

    to tap Delet

    moremont

  • 8/13/2019 BackingUp MySQL

    30/37

  • 8/13/2019 BackingUp MySQL

    31/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.31

    Whats New in MEB 3.9

    Whats New in MEB

  • 8/13/2019 BackingUp MySQL

    32/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.32

    Whats New in MEB

    New! Single Step

    Restore directly.

    New! Full Instance

    Config/Settings/

    New! Selective

    Leverages TTS Great for large tables

    New! Skip Unused Page

    Reduces space

    Continuous progress

    %, Bytes, Status

    Monitor disk space

    Optional actions

    Warn & Retry, Abor

    Usability, usability usability

    Selective backup with TTS

  • 8/13/2019 BackingUp MySQL

    33/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.33

    Selective backup with TTS

    MySQL 5.6 feature : Transportable Table spaces Online table portability : Import/Export

    Why use with MEB

    Locking time

    Ease of use

    What is TTS, why better than normal partial backup

    Skip Unused pages

  • 8/13/2019 BackingUp MySQL

    34/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.34

    Skip Unused pages

    InnoDB files dont shrink

    A small DB has many unused pages

    There is a performance penalty

    Cleaning up before a backup

    References

  • 8/13/2019 BackingUp MySQL

    35/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.35

    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-enterprise-backup/3.9/en/index.

    How Do I get it https://edelivery.oracle.com

    Support and patches (My Oracle Support = MOS)

    https://support.oracle.com

    http://www.mysql.com/products/enterprise/backup.htmlhttp://www.mysql.com/products/enterprise/backup.html
  • 8/13/2019 BackingUp MySQL

    36/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.36

  • 8/13/2019 BackingUp MySQL

    37/37

    Copyright 2013, Oracle and/or its affiliates. All rights reserved.37

    Graphic Section Divider