04 Database Backups

download 04 Database Backups

of 24

Transcript of 04 Database Backups

  • 8/11/2019 04 Database Backups

    1/24

    1

    SAP MaxDBDatabase Backups(Version 7.6/7.7)

    Suitable for SAP and non-SAP environments

  • 8/11/2019 04 Database Backups

    2/24

    2

    SAP 2008

    Upon completion of this presentation you will be able to create: A complete data backup An incremental backup A log backup

    with Database Manager GUI, Database Studio and Database Manager CLI.

    Objectives

    After this presentation youll know which backup types are available for MaxDB and howthese backups can be created. Youll learn how to do this with the three different toolsDatabase Studio, Database Manager GUI and Database Manager CLI.

  • 8/11/2019 04 Database Backups

    3/24

    3

    SAP 2008

    Backup Basics 1/2

    Backups are performed by the database process.

    Online backups of the volumes made with operating system tools (e.g. dd, copy) cannot be used.

    There are three backup types :Complete Data Backup: All data pages, configuration and parameter information.

    Incremental Data Backup: Backs up all data pages changed since the last complete databackup.Log Backup: All pages of log (in units of log segments) that have not already been backed up.

    Additionally Set AutoLog On automatically backs up the log as soon as a log segment is

    completed.

    First of all some basics about backups.

    You should always create the backups with database tools e.g. the Database Studioor scheduling them in the SAP planning calendar. Do not copy the volumes withoperationg system tools. Only using the database tools you will be able to recover to aspecific point in time.

    SAP MaxDB knows three different backup types:

    a complete data backup contains of course all data and additionally the databaseconfiguration and parameter settings.

    an incremental backup contains only the data which has been changed after the lastcomplete backup was created and additionally the database configuration andparameter settings.

    a log backup contains the log pages. A log backup is created in units of log segmentsand an automatic log backup can be enabled, which automatically backs up the logwhenever a log segment is completed.

  • 8/11/2019 04 Database Backups

    4/24

    4

    SAP 2008

    Backup Basics 2/2

    You should keep several generations of backups. For example tapes containing data

    or log backups should not be directly overwritten with the next backup.

    The automatic log backup (autosave log mechanism) should always be active.If automatic log backup is not active, you must regularly check whether there is enoughstorage space available in the log area.You should regularly archive the version files written during a log backup to a medium of your choice.

    Due to the database converter concept, SAP MaxDB does not support backup /restore of single tables/schemas. However, single tables/schemas can beextracted/loaded using the SAP MaxDB loader.

    You should not overwrite one data backup with the next one but keep several generations of backups.

    If you retain, say, the last four backup generations, it may be possible to use an older backup if a mediafailure occurs.

    Note that in case of a restore a more up-to-date data backup means that fewer log entries need to beredone. Therefore, perform data backups as often as possible.

    If you cannot or do not want to perform a data backup every day, you should at least perform anincremental data backup on each day of production.

    While a complete data backup is active, incremental and log backups cannot be started.

    You can perform data backups in parallel to reduce the time required for the backups.

    Complete and incremental data backups are also possible while the automatic log backup is active.

    It is recommended to enable the automatic log backup. That way you dont have to monitor the filling levelof the log volumes. If you dont enable the automatic log backup, make sure that there is always enoughspace available in the log volume and perform manual log backups regularly. If the log area is full, alldatabase tasks are suspended until a log backup is created and the log entries can be overwritten.

  • 8/11/2019 04 Database Backups

    5/24

    5

    SAP 2008

    External Backup Tools

    SAP MaxDB supports three kinds of external backup tools:

    Tivoli Storage Manager Networker Tools which support the Interface BackInt for Oracle or Backint for SAP MaxDB

    You can create backups using external backup tools.

    To use one of these tools you have to choose the device type Pipe for your backupmedium. Furthermore you have to specify, which backup tool should be used: ADSM,NSR or BACK.

    For Windows the media location must be specified as \\.\ where stands for any name. On a UNIX/Linux platform the location can be anyfile name of a non existing file.

    For details about using external backup tools please see the online documentation.

  • 8/11/2019 04 Database Backups

    6/24

    6

    SAP 2008

    Complete Backup with DBMGUI 1/2

    A complete backup saves all occupied pages of the data volume. In addition, the SAPMaxDB parameter file is written to the backup.

    The complete backup as well as the incremental backups are always consistent on thelevel of transactions since the before images of running transactions are stored in thedata area; i.e. they are included in the backup.

    Each backup gets a label reflecting the sequence of the backups. This label is used bythe administrative tools to distinguish the backups. A mapping from the logical backupmedium name to the backup label can be found in the file dbm.mdf in the Rundirectoryof the database instance.

    Each backup is logged in the file dbm.knl in the Rundirectory.

    To create a complete backup with Database Manager GUI choose Backup -> BackupWizard

    For a complete backup choose Complete Data Backup and press Next.

  • 8/11/2019 04 Database Backups

    7/24

    7

    SAP 2008

    Complete Backup with DBMGUI 2/2

    You can either select a backup medium from the list or create a new one.

    For a complete or incremental backup you can choose one of the three device typesfile, tape or pipe.

    After you have selected a backup medium the backup process has all the informationneeded for the backup. The wizard responds with a summary and the start request tocrosscheck the backup action before starting.

    During backup, a progress bar is displayed. Finally the result and environmentinformation is displayed.

  • 8/11/2019 04 Database Backups

    8/24

    8

    SAP 2008

    Incremental Backup With DBMGUI

    An incremental backup is also performed using the backup wizard.

    Instead of Complete Data Backup Incremental Data Backup has to be selected.

    A backup medium bound to this backup type has to be used if it does not exist, ithas to be created.

    All data pages changed since the last complete data backup are backed up.

    Prerequisite: a complete backup has been created successfully after the installation.

    Before you can create an incremental backup, a complete backup has to be created.

    An incremental backup is created in the same way as the complete backup. Just selecta backup medium bound to backup type incremental .

  • 8/11/2019 04 Database Backups

    9/24

    9

    SAP 2008

    Log Backup with DBMGUI 1/2

    A log backup can only be created when a complete backup has been createdsuccessfully.

    Then it is created in the same way as an complete backup. Start the Backup Wizardand choose Log Backup .

    SAVE LOG saves all occupied log pages from the archive log which have not beensaved before.

    If the log option auto overwrite is enabled, no log backups have to be performed.Trying to create an log backup would result in error -128,Log backup is not possiblebecause the log overwrite mode has been enabled.

  • 8/11/2019 04 Database Backups

    10/24

    10

    SAP 2008

    Log Backup with DBMGUI 2/2

    A backup medium bound to the backup type Log Backup has to be used if it does notexist, it has to be created

    For a log backup you can choose file or pipe (for external backup tools). It is notpossible to save log segments directly to tape.

    However, we recommend to save the log into version files. One version file will becreated for each log segment. Version files automatically get a number as extension(e.g. SAVE.LOG.0001, SAVE.LOG.0002, ...)

    After you have selected a backup medium, confirm the selection by pressing Start .

    When the backup finished, a summary is displayed containing the backup label.

  • 8/11/2019 04 Database Backups

    11/24

    11

    SAP 2008

    Automatic Log Backup with DBMGUI 1/2

    When the Autosave Log mechanism is activated, log segments are automaticallybacked up as soon as they are completed.

    To activate it, use the Backup Wizard .

    Choose Activate/Deactivate automatic log backup and press Next .

  • 8/11/2019 04 Database Backups

    12/24

    12

    SAP 2008

    Automatic Log Backup with DBMGUI 2/2

    Here as well a backup medium bound to the backup type Log Backup has to be used if it does not exist, it has to be created.

    If the selection is correct, enable the automatic log backup by pressing On .

    An information is displayed to show the success of the process.

  • 8/11/2019 04 Database Backups

    13/24

    13

    SAP 2008

    Backup History in DBMGUI

    To check wether the backup actions were succesful, have a look to the backup history(file dbm.knl). Choose Backup -> Backup History .

    A red entry shows an erroneous backup action.

    To figure out what went wrong with this backup action, check the files dbm.prt, dbm.ebpand knldiag.

  • 8/11/2019 04 Database Backups

    14/24

    14

    SAP 2008

    Creating Backups with Database Studio 1/4

    In Database Studio open the Administration section (context menu on the Database name-> Administration ).

    In the Backup section youll see the Backup History and all Backup Templates (formerlycalled Backup Medium ).

    Detailed information about each created backup including the label and the return codeare available.

    Furthermore you can create new Backup Templates and perform a Backup or aRecovery .

  • 8/11/2019 04 Database Backups

    15/24

    15

    SAP 2008

    Creating Backups with Database Studio 2/4

    Each backup template is bound to a specific backup type (complete data backup,incremental backup or log backup).

    When you start the backup from the context menu on a backup template the BackupWizard is automatically opened for the specific backup type and the backup will be startedusing the selected template.

  • 8/11/2019 04 Database Backups

    16/24

    16

    SAP 2008

    Creating Backups with Database Studio 3/4

    Another possibility to perform a backup is to choose Backup from the databases contextmenu.

    In this case you can choose what kind of a backup you would like to perform.

    In the next step you select or create the backup template for this action.

  • 8/11/2019 04 Database Backups

    17/24

    17

    SAP 2008

    Creating Backups with Database Studio 4/4

    The backup will be created after you confirmed the selected action.

    When the backup finished, information about the backup is displayed (backup label, size,location, ).

    While the backup is running you can choose to close the Backup Wizard using theBackground button. This enables you to work with the Database Studio while the backupis active.

    The progress of the backup can then be seen in the Actions tab in the lower part of theDatabase Studio window.

  • 8/11/2019 04 Database Backups

    18/24

    18

    SAP 2008

    Creating a Backup Medium with DBMCLI

    Syntax to create a backup medium with dbmcli:

    medium_put [ ]

    Example 1:Defining a File as Overwritable Medium for a Complete Data Backup (namedcompleteF)

    dbmcli -d -u , medium_put completeF/usr/maxdb/complete FILE DATA 0 8 YES

    Example 2:Defining a Tape Device as Medium for a Complete Data Backup (named completeT)

    dbmcli -d -u , medium_put completeT /dev/rft0TAPE DATA 64000 8 NO

    This shows the syntax for DBMCLI commands to create a backup template as well astwo examples.

    The first backup medium is an overwritable file, the other one is a tape device.

  • 8/11/2019 04 Database Backups

    19/24

    19

    SAP 2008

    Creating a Data Backup with DBMCLI

    Creating a Complete Data Backup

    dbmcli -d -u , -uUTL c backup_start completeT

    Example of a complete data backup wit h media exchange

    dbmcli -d -u , -uUTL

    backup_start completeT

    backup_replace completeT

    The backup_replace command has to be executed AFTER the tape has beenexchanged, so that the first part of the backup is not overwritten by the nextpart.

    This is the dbmcli command to create a complete backup.

    If the capacity of the medium is insufficient for the entire backup, you must carry out amedia change. In other words, the backup is written to the first medium until this is full,and then a succeeding medium is used. If you foresee this occurring, call up theDatabase Manager CLI in session mode, because you must not interrupt the sessionduring the backup operation.

  • 8/11/2019 04 Database Backups

    20/24

    20

    SAP 2008

    Incremental Backup with DBMCLI

    Defini ng a File as Medium for an Incremental Data Backup (named incrF)

    dbmcli -d -u , medium_put incrF/usr/maxdb/incr FILE PAGES

    Creating an Incremental Data Backup

    dbmcli -d -u , -uUTL -c backup_start incrF

    These are the commands to create a backup template for an incremental backup and tostart the backup action.

  • 8/11/2019 04 Database Backups

    21/24

    21

    SAP 2008

    Log Backup with DBMCLI

    Defini ng a File as Medium for an Interactive Log Backup (named logsave)

    dbmcli -d -u , medium_put logsave/usr/maxdb/log FILE LOG

    Creating an Interactive Log Backup

    dbmcli -d -u , -uUTL -c backup_start logsave

    These are the commands to create a backup template for a log backup and to start thebackup action.

  • 8/11/2019 04 Database Backups

    22/24

  • 8/11/2019 04 Database Backups

    23/24

    23

    SAP 2008

    Summary

    You should now be able to create:

    A complete data backup An incremental backup A log backup

    with Database Manager GUI, Database Studio and Database Manager CLI.

    Congratulations! Now you know the three different backup types and you can createthese backups with Database Studio, Database Manager GUI and Database Manager CLI.

  • 8/11/2019 04 Database Backups

    24/24

    SAP 2008

    Copyright 2008 SAP AGAll rights reserved

    No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changedwithout prior notice.

    Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

    SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned andassociated logos displayed are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

    The information in this document is proprietary to SAP. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This documentcontains only intended strategies, deve lopments, and functionalities of the SAP product and is not intended to be binding upon SAP to any particular course of business, product strategy,and/or development. SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, grap hics, links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

    SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitationshall not apply in c ases of intent or gross negligence.

    The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in thesematerials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages

    Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrckliche schriftliche Genehmigung durchSAP AG nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden.

    Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte knnen Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind.

    SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwhnte SAP-Produkte und Servicessowie die dazugehrigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Lndern weltweit. Alle anderen in diesem Dokument erwhntenNamen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zuInformationszwecken. Produkte knnen lnderspezifische Unterschiede aufweisen.

    Die in diesem Dokument enthaltenen Informationen sind Eigentum von SAP. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderenVereinbarung mit SAP. Dieses Dokument enthlt nur vorgesehene Strategie n, Entwicklungen und Funktionen des SAP-Produkts und ist fr SAP nicht bindend, einen bestimmtenGeschftsweg, eine Produktstrategie bzw. -entwicklung einzuschlage n. SAP bernimmt keine Verantwortung fr Fehler oder Auslassungen in diesen Materialien. SAP garantiert nicht dieRichtigkeit oder Vollstndigkeit der Informationen, Texte, Grafiken, Links oder anderer in diesen Materialien enthaltenen Elemente. Diese Publikation wird ohne jegliche Gewhr, weder ausdrcklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschlielich, hinsichtlich der Gewhrleistung der Marktgngigkeit und der Eignung fr einen bestimmten Zwecksowie fr die Gewhrleistung der Nichtverletzung geltenden Rechts.

    SAP bernimmt keine Haftung fr Schden jeglicher Art, einschlielich und ohne Einschrnkung fr direkte, spezielle, indirekte oder Folgeschden im Zusammenhang mit der Verwendungdieser Unterlagen. Diese Einschrnkung gilt nicht bei Vorsatz oder grober Fahrlssigkeit.

    Die gesetzliche Haftung bei Personenschden oder die Produkthaftung bleibt unberhrt. Die Informationen, auf die Sie mglicherweise ber die in diesem Material enthaltenen Hotlinkszugreifen, unterliegen nicht dem Einfluss von SAP, und SAP untersttzt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewhrleistungen oder Zusagen ber Internetseiten Dritter ab.

    Alle Rechte vorbe halten.