04 Database Backups

  • View
    214

  • Download
    0

Embed Size (px)

Text 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