This note deals with questions and answers about MaxDB backup/recovery.
1. Which database backup types are there?
2. Is the log area also saved during a data backup?
3. What must I bear in mind if I use tapes to back up data?
4. What options do I have for saving the log area?
5. What advantages does AUTOSAVE LOG offer?
6. What happens if the file system becomes full with AUTOSAVE LOG?
7. Is a time-controlled activation of AUTOSAVE LOG possible?
8. Can the log area be saved onto a tape?
9. Can the log area be saved to a pipe?
10. What should I bear in mind if the log area is saved to files?
11. How do I archive the log backup files that are generated?
12. Which MaxDB backup tools are available for a data backup or log backup?
13. What advantage does a backup using the MaxDB backup tool offer compared to a file system backup?
14. How is a file system backup integrated as of MaxDB Version 7.8?
15. Where can I find a how-to for the backup process with DBMCLI?
16. How do I check a database backup?
17. Does MaxDB support the use of external backup tools?
18. Is a compressed database backup an option?
19. Does MaxDB support backups to NFS-mounted file systems?
20. What is a database snapshot?
21. Which MaxDB tools are available for a recovery?
22. Where can I find a how-to for the recovery process with DBMCLI?
23. Can I execute a RESTORE LOG without having imported a suitable data backup?
24. What have I done wrong if the system issues error message 8003 'LOG and Data must be compatible'?
25. What does the recovery process look like when a log volume is lost (for example, due to disk errors)?
26. Where can I find more information about MaxDB backup/recovery?
Reason and Prerequisites
You use MaxDB Version 7.6 or higher.
You are using a MaxDB database in the OLTP or BW environment.
You use MaxDB as content server storage.
You use a MaxDB liveCache.
Solution
1. Which database backup types are there?
MaxDB differentiates between the following backup types:
A complete data backup backs up the entire data area. An incremental data backup backs up all of the data in the data area that has been changed since the last complete data backup. A log backup backs up all of the redo log entries that the database system wrote to the log area since the last log backup.
Further information about MaxDB logging is available in Note 869267 ("FAQ: MaxDB LOG area").
2. Is the log area also saved during a data backup?
No. A data backup using MaxDB tools backs up only the data that is stored in the data area. This includes the actual application data and the before images, so the recovery of a consistent database is possible only with a data backup.
The data that is stored in the log area is not backed up during a data backup.
3. What must I bear in mind if I use tapes to back up data?
Ensure that you do not use NOREWIND tapes to back up the data. MaxDB does not have a mechanism to locate a backup that starts in the middle of the tape.
If you use MaxDB Version 7.7 on UNIX, you must refer to Note 1364629 ("Backup/recovery via tape fails on Unix").
If you use MaxDB Version 7.7 on Windows, you must refer to Note 1438776 ("Recovery from tape fails on Windows").
4. What options do I have for saving the log area?
A prerequisite for being able to save the log area is that a data backup, which is suitable for the log must have been, for example, saved once and the log area must not have been deactivated or set to "Overwrite" between the data backup and the log backup.
You have two options for saving the log area:
a) Automatic Log Backup (AUTOSAVE LOG)
As soon as a log segment is full in the log area, the database system saves this log segment to a version file. It then releases the log segment again for overwriting in the log area.
SAP particularly recommends automatic log backup for database instances in which a large amount of data is changed and where you can calculate large numbers of Redo Log entries.
b) Interactive Log Backup (SAVE LOG)
You must use the MaxDB backup tools to explicitly trigger the interactive log backup.
5. What advantages does AUTOSAVE LOG offer?
As soon as a log segment is full in the log area, the database system saves this log segment to a version file. No monitoring by the database administrator is required in the sense of having to explicitly trigger a backup. The administrator needs only to guarantee that there is always sufficient space for log backups in the relevant file system.
6. What happens if the file system becomes full with AUTOSAVE LOG?
The backup activity is cancelled, and the AUTOSAVE LOG is deactivated. You must ensure that you explicitly reactivate the AUTOSAVE LOG when you have space in the file system again. If you do not activate AUTOSAVE LOG, the log area may become full.
7. Is a time-controlled activation of AUTOSAVE LOG possible?
As of MaxDB Versions 7.5.00.40 (PTS 1142630,1141721) and 7.6.02.01 (PTS 1142623), the autolog_on command has been extended. As of these versions, you can save log areas controlled by time.
autolog_on [<medium>] [INTERVAL <interval>]
The time-controlled AUTOSAVE LOG is deactivated by default (INTERVAL=0). If you enter a value in seconds that is greater than zero, the log segments are saved to version files as soon as the interval has expired. This happens independent of whether the log segment has already been completed. For the time-controlled AUTOSAVE LOG, the saved version files may differ in size.
8. Can the log area be saved onto a tape?
No, log backups onto tape are NOT supported. MaxDB does not support NO REWIND tapes. If the tape is rewound after the log backup, there is a danger that this log backup will be overwritten by a subsequent log backup because the tape has not been replaced. The log entries that have been saved and then overwritten by the second backup would then be irrecoverably lost.
9. Can the log area be saved to a pipe?
a) SAVE LOG
Interactive log backups to a pipe can also be made. If you are not using an external backup tool and want to carry out interactive log backups to pipes, you have to set the value of the special database parameter LOG_BACKUP_TO_PIPE (EnableLogBackupToPipe) to YES. However, SAP only recommends using pipes for interactive log backups if external backup tools are used.
Pipes for transferring of backup data are implicitly created by the database manager (DBMServer) during the backup activity. They may not exist in advance.
b) AUTOSAVE LOG
Automatic saving of log segments is triggered directly from the database kernel. There is no upstream instance (for example, DBMServer) that can guarantee creation of a pipe. Automatic log backups to a pipe CANNOT therefore be supported at present.
10. What should I bear in mind if the log area is saved to files?
When the system saves to a file, it creates the required number of files (version files) one after the other, and saves a dataset the size of a log segment in each one. The remaining data is saved in the last file.
Make sure that there is always sufficient space available for the log backups in the relevant file system. You should therefore archive the log backup files on a regular basis.
11. How do I archive the log backup files that are generated?
You can use the DBMCLI command archive_stage to save log backup files onto an external medium. You can use options to specify whether the archived files are to be compared with the original files for security reasons, and whether they are to be deleted at the original storage area after being archived. The archived version files are given their own external backup IDs and are entered in the backup history.
See the MaxDB documentation (Note 767598 -> DBMCLI documentation) for a precise description of how to use archive_stage.
12. Which MaxDB backup tools are available for a data backup or log backup?
You can perform a database backup using the MaxDB backup tools DBMGUI (MaxDB Versions lower than 7.7), Database Studio (MaxDB Version 7.5 or higher), or DBMCLI. You can use the scheduling calendar (CCMS transaction DB13 or DB13C) to schedule a backup for a particular point in time and execute it implicitly.
File system backups of MaxDB volumes are only possible when the database is offline because otherwise, input/output (I/O) consistency is not guaranteed. You can back up I/O-consistent snapshots and split mirrors of the file system or I/O subsystem.
13. What advantage does a backup using the MaxDB backup tool offer compared to a file system backup?
You can perform a file system backup only when the database is in the offline status. The length of time for which the database is unavailable for operation depends on the size of the dataset.
In contrast, you can back up the database while it is in the online status using the MaxDB backup tools, in parallel with production operation. You can use a backup generated online using database tools for a system copy.
A file system backup of the volumes (data and log) backs up all data (gross) that is saved in the volume.
In contrast, a backup using the MaxDB tools only backs up the data of a converter version, which may be required for a recovery.
When you create a file system backup, the system does not perform a check sum check on the blocks.
While the backup is being created using the MaxDB tools, the system executes consistency checks on the data.
Even if you back up the log volumes using a file system backup, you must also back up the log area using the database tools so that the log area can be released again for overwriting.
A file system backup is not included in the MaxDB backup history.
Backups performed using the MaxDB tools integrate the backup history, and this makes restoring the database in the event of a recovery a simple process.
14. How is a file system backup integrated as of MaxDB Version 7.8?
As of MaxDB Version 7.8, you can include file system backups in the MaxDB backup history, which means that file system backups are also possible when the database is in online status. The database core creates a a MaxDB snapshot to establish the I/O consistency using a data backup to a backup template with the device type EXTERNAL. You can then perform the file system backup, and you must explicitly inform the database of its success or failure using the DBM server command backup_finish.
In this way, you can perform the initial data backup as a file system backup also.
15. Where can I find a how-to for the backup process with DBMCLI?
A how-to for the backup process with DBMCLI is provided on the SAP Community Network (SCN) at:
http://wiki.sdn.sap.com/wiki/x/sx0B
16. How do I check a database backup?
You can use the MaxDB backup tools DBMGUI, Database Studio, or DBMCLI to check whether a backup can be imported and therefore, whether it can be used for a recovery. In this case, the service database is used to import the entire backup. The operation of the database must not be interrupted during this process.
You will find more information about this in the glossary of the MaxDB documentation (Note 767598) under the key word "Backup", in the Database Studio manual under the title "Checking Backups", as well as in the DBMCLI manual under the DBM command recover_check.
17. Does MaxDB support the use of external backup tools?
Yes. Max DB supports a number of backup tools from third parties, such as Networker, Netbackup from Veritas, and so on.
Which specific tools are supported, and how they can be included in a MaxDB environment is described in the MaxDB documentation (Note 767598)? Search the glossary for the keyword "external backup tool".
Scripts in the database manager also enable you to use all other backup tools that are able to process backups from pipes.
If you save the log area with external backup tools (interactive log backup), see Note 1392043.
18. Is a compressed database backup an option?
As of MaxDB Version 7.8, you can also create compressed database backups. To do this, choose the option COMPRESSED when defining the backup template. During the compression, the the databases use the gzip default compression level. Whether the compression increases or optimizes the backup time greatly depends on the data to be backed up.
NOTE: At present, we strongly advise against creating compressed database backups. For more information, see Note 1504667.
19. Does MaxDB support backups to NFS-mounted file systems?
Yes. For this, you must ensure the correct configuration of the Network File System (NFS) server. For more information, see Note 912905 FAQ: Storage systems used with MaxDB.
20. What is a database snapshot?
A database snapshot freezes the current status of the database area. After you have made a snapshot, you can continue to use the data of the database instance as normal and change data without this affecting the snapshot. At a later time, you can return to the status of the data area at the time of the snapshot. The snapshot contains all of the required information. You do not require a complete data backup for this.
A snapshot is NOT a data backup. To be able to recover your data following damage to the data area, you must regularly back up your data and logs.
For more information, see Note 1423732 "FAQ: SAP MaxDB Snapshots" and the glossary of the MaxDB documentation (Note 767598) under the keyword "Snapshot".
21. Which MaxDB tools are available for a recovery?
The MaxDB tools DBMGUI, Database Studio, or DBMCLI are available for a recovery (RESTORE DATA, RESTORE LOG).
For interactive recovery processes, you can use the Recovery Wizard in DBMGUI or Database Studio. The Recovery Wizard proposes the optimal recovery strategy.
You have the option to restore the database only up to a certain consistent status (RESTORE UNTIL). You can use an option to specify up to what point in time the entries should be imported from the log backups or, if necessary, from the log area.
22. Where can I find a how-to for the recovery process with DBMCLI?
A how-to for the recovery process with DBMCLI is provided on the SAP Community Network (SCN) at:
http://wiki.sdn.sap.com/wiki/x/jh4B
23. Can I execute a RESTORE LOG without having imported a suitable data backup?
No, log backups require a setup point in the data area in order to track or roll back transactions. If this setup point cannot be found, you cannot track the log area.
24. What have I done wrong if the system issues error message 8003 'LOG and Data must be compatible'?
Log-entries (After Images) and data of an instance must always be compatible. The data of an instance may not be mixed with log entries (After Images) from another instance in the case of a Restore Log.
To avoid incompatibility between log entries and data, the database kernel writes the DBIdent to
- The restart record in the second block of the first data volume,
- The log info page in the second block of the first log volume,
- Every data backup (Save Data/Save Pages)
- Every log backup.
DBIdent contains the name of the database server, the name of the database instance, and a time stamp for when the backup history started. This time stamp is, for example, set the first time a database instance is restarted, and at the end of a Restore Log with Until specifications.
The name of the database server and the instance name do not need to correspond to the current server or the current instance name. You can rename database instances without changing the DBIdent (see Note 604680).
Restart after recovery only works if the DBIdent in the log area matches the DBIdent in the data area or if the log area has been initialized.
If the log entries and data do not match, the database cannot be started and the restart terminates with error message 8003 'Log and Data must be compatible'.
25. What does the recovery process look like when a log volume is lost (for example, due to disk errors)?
Without a copy of the log area (using database tools or based on the hardware), data is lost when a log volume is lost because the log area that has not yet been saved cannot be used for a recovery. To keep the loss of data as small as possible, execute a data backup in the state ADMIN. This saves all changes that were stored in the data area with the last savepoint. To recover the database, choose the recovery with initialization and use this backup. The loss of data includes the period as of the last savepoint, which you can determine using the detailed information for this backup under 'Last Save Point' (Database Studio -> Administration -> Backup -> Details or DBMCLI command backup_history_list).
If a data backup in the state ADMIN is no longer possible because the data volumes are also affected by the disk error, you must execute a recovery with initialization using the last data backup and all of the following log backups. In this case, the loss of data includes the period as of the last log backup.
26. Where can I find more information about MaxDB backup/recovery?
You can find more information about MaxDB backup/recovery in glossary of the MaxDB documentation (Note 767598) under the keywords 'Backup' and 'Recover'.
Alternatively, you can use the SDN to access the MaxDB documentation at:
https://www.sdn.sap.com/irj/sdn/maxdb
CAUTION
Even though the recovery is always executed on one database instance only, these actions may affect the entire system landscape. A general description of the procedure and detailed information about the recovery in an SAP system landscape is available in the Best Practices documents of the Advanced Technology Group (ATG) on SAP Service Marketplace (https://service.sap.com/atg):
- Backup & Restore Concepts for SAP Business Suite
(http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000487237&)
- Emergency Handling for Recovery of SAP System Landscapes
(http://service.sap.com/~sapidb/011000358700000577832008E Data)
- Data Consistency Check for Logistics
(http://service.sap.com/~sapidb/011000358700001955832008E)
- Backup and Restore for SAP Business Suite
(http://service.sap.com/~sapidb/011000358700004447112001E)