Вы находитесь на странице: 1из 24

1

SAP Max DB
Database Backups
(Version 7.6/7.7)
Suitable for SAP and non-SAP environments
2
SAP 2008
Upon c ompl et i on of t hi s pr esent at i on, you wi l l be abl e t o c r eat e:
A complete data backup
An incremental backup
A log backup
with Database Manager GUI, Database Studio and Database Manager CLI.
Obj ec t i ves
After this presentation youll knowwhich backup types are available for MaxDB and how
these backups canbe created. Youll learn howto do this with the three different tools
Database Studio, Database Manager GUI and Database Manager CLI.
3
SAP 2008
Bac k up Basi c s 1/2
Backups are performed by the database process.
Online backups of the volumes made with operating system tools (e.g. dd, copy) can
not 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 data
backup.
Log Backup: All pages of log (in units of log segments) that have not alreadybeen backed up.
AdditionallySet AutoLog On automaticallybacks 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 Studio
or scheduling themin the SAP planning calendar. Do not copy the volumes with
operationg systemtools. Only using the database tools you will be able to recover to a
specific point in time.
SAP MaxDB knows three different backup types:
a complete data backup contains of course all data and additionally the database
configuration and parameter settings.
an incremental backup contains only the data which has been changedafter the last
complete backup was created and additionallythe database configuration and
parameter settings.
a log backup contains the log pages. A log backupis createdin units of log segments
and an automatic log backup can be enabled, which automatically backs up the log
whenever a log segment is completed.
4
SAP 2008
Bac k up Basi c s 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 enough
storage 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 be
extracted/loaded using the SAP MaxDB loader.
You shouldnot overwrite one data backupwiththe next one but keepseveral generations of backups.
If you retain, say, the last four backup generations, it may be possible to use an older backup if a media
failure occurs.
Note that in case of a restore a more up-to-date data backup means that fewer log entries need to be
redone. 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 an
incremental 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 recommendedto enable the automatic log backup. That way you dont haveto monitor thefillinglevel
of the log volumes. If youdont enable the automatic log backup, make sure that there is always enough
space available in the log volume and performmanual log backups regularly. If the log area is full, all
database tasks are suspended until a log backupis created and the log entries canbe overwritten.
5
SAP 2008
Ex t er nal Bac k up Tool s
SAP MaxDB supports three ki nds 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 usingexternal backup tools.
To use one of these tools you have to choose the device type Pipe for your backup
medium. Furthermore you have to specify, which backup tool should be used: ADSM,
NSR or BACK.
For Windows the media location must be specified as \\.\<PipeName> where
<Pipename>stands for any name. On a UNIX/Linux platform the location can be any
file name of a non existing file.
For details about using external backup tools please see the online documentation.
6
SAP 2008
Compl et e Bac k up wi t h DBMGUI 1/2
A complete backup saves all occupied pages of the data volume. In addition, the SAP
MaxDB parameter file is written to the backup.
The complete backup as well as the incremental backups are always consistent on the
level of transactions since the before images of running transactions are stored in the
data area; i.e. they are included in the backup.
Each backup gets a label reflecting the sequence of the backups. This label is used by
the administrative tools to distinguish the backups. A mapping from the logical backup
medium name to the backup label can be found in the file dbm.mdf in the Rundirectory
of 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 -> Backup
Wizard
For a complete backup choose Complete Data Backup and press Next.
7
SAP 2008
Compl et e Bac k up wi t h 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 types
file, tape or pipe.
After you have selected a backup mediumthe backup process has all the information
needed for the backup. The wizardresponds with a summary and the start request to
crosscheck the backup action before starting.
During backup, a progress bar is displayed. Finally the result and environment
informationis displayed.
8
SAP 2008
I nc r ement al Bac k up Wi t h DBMGUI
An incremental backup is also performedusingthe backupwizard.
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, it
has to be created.
All data pages changed since the last complete data backup are backedup.
Prerequisite: a complete backup has beencreated successfullyafter the installation.
Before you can create an incremental backup, a complete backup has to be created.
An incremental backupis createdin the same way as the complete backup. J ust select
a backup mediumbound to backup type incremental.
9
SAP 2008
Log Bac k up wi t h DBMGUI 1/2
A log backup can only be created whena complete backup has been created
successfully.
Then it is createdin the same way as an complete backup. Start the Backup Wizard
and choose Log Backup.
SAVE LOG saves all occupied log pages from the archive log which have not been
saved 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 possible
because the log overwrite mode has been enabled.
10
SAP 2008
Log Bac k up wi t h DBMGUI 2/2
A backup medium bound to the backup type Log Backup has to be used if it does not
exist, it has to be created
For a log backup you can choose file or pipe (for external backup tools). It is not
possible to save log segments directly to tape.
However, we recommend to save the log into version files. One version file will be
created 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.
11
SAP 2008
Aut omat i c Log Bac k up wi t h DBMGUI 1/2
When the Autosave Log mechanism is activated, log segments are automatically
backed up as soon as they are completed.
To activate it, use the Backup Wizard.
Choose Activate/Deactivate automatic log backup and press Next.
12
SAP 2008
Aut omat i c Log Bac k up wi t h 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 selectionis correct, enable the automatic log backupby pressing On.
An informationis displayed to showthe success of the process.
13
SAP 2008
Bac k up Hi st or y i n DBMGUI
To check wether the backup actions were succesful, have a look to the backuphistory
(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.ebp
and knldiag.
14
SAP 2008
Cr eat i ng Bac k ups wi t h Dat abase St udi o 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 (formerly
called Backup Medium).
Detailed information about each created backup including the label and the return code
are available.
Furthermore you can create newBackup Templates and perform a Backup or a
Recovery.
15
SAP 2008
Cr eat i ng Bac k ups wi t h Dat abase St udi o 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 Backup
Wizard is automatically opened for the specific backup type and the backup will be started
using the selected template.
16
SAP 2008
Cr eat i ng Bac k ups wi t h Dat abase St udi o 3/4
Another possibility to perform a backup is to choose Backup from the databases context
menu.
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.
17
SAP 2008
Cr eat i ng Bac k ups wi t h Dat abase St udi o 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 the
Background button. This enables you to work with the Database Studio while the backup
is active.
The progress of the backup can then be seen in the Actions tab in the lower part of the
Database Studio window.
18
SAP 2008
Cr eat i ng a Bac k up Medi um w i t h DBMCLI
Syntax to create a backup mediumwithdbmcli:
medium_put <media_name> <location> <FILE/TAPE/PIPE> <backup_type> [<size>
<blocksize> <owerwrite> <autoloader> <os_command>]
Example 1:
Defining a File as Overwritable Medium for a Complete Data Backup (named
completeF)
dbmcli -d <db_name> -u <dbm_user>,<password> 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 <db_name> -u <dbm_user>,<password> medium_put completeT /dev/rft0
TAPE DATA 64000 8 NO
This shows the syntaxfor DBMCLI commands to create a backup template as well as
two examples.
The first backup mediumis an overwritable file, the other one is a tape device.
19
SAP 2008
Cr eat i ng a Dat a Bac k up wi t h DBMCLI
Creati ng a Complete Data Backup
dbmcli -d <db_name> -u <dbm_user>,<password> -uUTL c backup_start completeT
Exampl e of a complete data backup with media exchange
dbmcli -d <db_name> -u <dbm_user>,<password> -uUTL
backup_start completeT
backup_replace completeT
The backup_replace command has to be executed AFTER the tape has been
exchanged, so that the first part of t he backup is not overwritten by the next
part.
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 a
media 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 the
Database Manager CLI in session mode, because you must not interrupt the session
during the backup operation.
20
SAP 2008
I nc r ement al Bac k up wi t h DBMCLI
Defini ng a File as Medi um for an Incremental Data Backup (named i ncrF)
dbmcli -d <db_name> -u <dbm_user>,<password> medium_put incrF
/usr/maxdb/incr FILE PAGES
Creati ng an Incremental Data Backup
dbmcli -d <db_name> -u <dbm_user>,<password> -uUTL -c backup_start incrF
These are the commands to create a backup template for an incremental backupand to
start the backup action.
21
SAP 2008
Log Bac k up w i t h DBMCLI
Defini ng a File as Medi um for an Interacti ve Log Backup (named logsave)
dbmcli -d <db_name> -u <dbm_user>,<password> medium_put logsave
/usr/maxdb/log FILE LOG
Creati ng an Interacti ve Log Backup
dbmcli -d <db_name> -u <dbm_user>,<password> -uUTL -c backup_start logsave
These are the commands to create a backup template for a log backup and to start the
backup action.
22
SAP 2008
Aut omat i c Log Bac k up wi t h DBMCLI
Defini ng a File as Medi um for an Automati c Log Backup (named autosave)
dbmcli -d <db_name> -u <dbm_user>,<password> medium_put autosave
/usr/maxdb/auto FILE LOG
Activati ng the Automati c Log Backup with Medium autosave
dbmcli -d <db_name> -u <dbm_user>,<password> autolog_on autosave
Deacti vati ng the Automatic Log Backup
dbmcli -d <db_name> -u <dbm_user>,<password> autolog_off
These are the commands to create a backup template for the automatic log backupand
to activate and deactivate it.
The Status of the Automatic Log Backup can be checked with dbmcli command
autolog_show.
23
SAP 2008
Summar y
You shoul d now be abl e t o c r eat e:
A complete data backup
An incremental backup
A log backup
with Database Manager GUI, Database Studio and Database Manager CLI.
Congratulations! Nowyou knowthe three different backup types and you can create
these backups with Database Studio, Database Manager GUI and Database Manager
CLI.
24
SAP 2008
Copyr i ght 2008 SAP AG
Al l r i ght s r eser ved
No part of this publication may be reproduced or transmitted in any formor for any purpose without the express permission of SAP AG. The information contained herein may be changed
without 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 and
associated 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 document
contains only intended strategies, developments, and functionalities of the SAPproduct 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, graphics, 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 fromthe use of these materials. This limitation
shall not apply in cases 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 these
materials 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 welchemZweck und in welcher Formauch immer, ohne die ausdrckliche schriftliche Genehmigung durch
SAP 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 Eigentumanderer Softwarehersteller sind.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge und andere in diesemDokument erwhnte SAP-Produkte und Services
sowie die dazugehrigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Lndern weltweit. Alle anderen in diesemDokument erwhnten
Namen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben imText sind unverbindlich und dienen lediglich zu
Informationszwecken. Produkte knnen lnderspezifische Unterschiede aufweisen.
Die in diesemDokument enthaltenen Informationen sind Eigentumvon SAP. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderen
Vereinbarung mit SAP. Dieses Dokument enthlt nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP-Produkts und ist fr SAP nicht bindend, einen bestimmten
Geschftsweg, eine Produktstrategie bzw. -entwicklung einzuschlagen. SAP bernimmt keine Verantwortung fr Fehler oder Auslassungen in diesen Materialien. SAP garantiert nicht die
Richtigkeit 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 Zweck
sowie 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 imZusammenhang mit der Verwendung
dieser 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 diesemMaterial enthaltenen Hotlinks
zugreifen, unterliegen nicht demEinfluss 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 vorbehalten.

Вам также может понравиться