Backup with IBM Db2 for i

Use

You must always have a recent and consistent backup of database data for IBM Db2 for i that you can use to recover the database in the event of failure involving data loss.

Prerequisites

You must plan for the following data when setting up a backup strategy for IBM Db2 for i:

  • Licensed Internal Code, operating system, licensed programs and system data

    This data can only be saved in offline mode. It needs to be backed up after major changes, such as installing new products.

  • Application data

    You can save this data in offline mode or in online mode. When saving data in online mode, some restrictions apply because the SAP application may hold locks on objects that prevent the objects from being saved. Some of these locked objects are temporary objects, so you can ignore the failure to save them. For more information about objects that need to be saved as well as the objects that are locked and do not need to be saved, see SAP Note 825473 Information published on SAP site.

IBM Db2 for i supports the following backup types:

Backup Type

Type of Data

Advantages

Disadvantages

Offline backup

System data, application data

Safest method to obtain a complete backup because no lock conflicts can occur

  • System downtime

  • Contents of SAP buffers and cursor caches lost

Online backup with complete transactions

Application data

  • SAP system stays up, so buffer contents are retained

  • Database library directly usable after a restore, no requirement to recover journalled changes

  • SAP system locked until checkpoint reached

  • Incomplete backup possible as a result of long running transactions or transport requests

Online backup with partial transactions

Application data

  • SAP system stays up, so buffer contents are retained

  • SAP system usable during backup, no checkpoint processing required

  • Incomplete backup possible as a result of long running transport requests

  • Additional complexity at restore time due to the requirement of journal change recovery

Process

  1. You decide which type of backup you want to do:

    • Offline backup

      An offline backup is required to backup the complete system, including the Licensed Internal Code and operating system. You can also perform an offline backup on the SAP data if you can afford system downtime, or if you consider completeness of the backup and a simple restore process more important than continuous system availability.

    • Online backup with complete transactions

      If you do not have long running transactions during your backup window and you do not want to shutdown your SAP system, but you can afford a short time window when the SAP system is locked, you can perform an online backup with complete transactions.

      To select this type of backup, specify the parameters SAVACT(*SYNCLIB) SAVACTWAIT( <wait time> ) on your save commands.

    • Online backup with partial transactions

      If you want to keep the impact of the backup on your production system as small as possible, perform an online backup with partial transactions.

      To select this type of backup, specify the parameters SAVACT(*SYNCLIB) SAVACTWAIT( <wait time> *NOCMTBDY *LOCKWAIT) on your save commands.

  2. You consider the frequency of backups.

    A complete system backup is only needed after major changes to the system, such as installing new software or fixes, or after major changes to the system configuration. When deciding on the frequency of backups of the database libraries, you need to consider the impact of the backup to your productive system as well as the required recovery time in case of data loss. After restoring the saved database library, you need to apply journalled changes to redo all modifications in the database that happened between the time of the last backup and the time just before the data loss. The more changes that need to be applied, the longer it takes to apply the journalled changes. The suggested backup frequency of your database libraries is between daily and weekly.

  3. You assess your tape devices.

    The type of tape device you are using to back up your system determine the downtime for offline backups.

  4. You perform a backup.

    You can perform a backup with the following operating system commands:

    • SAVE menu

    • SAVLIB or SAV command

    • You can also use the IBM software product Backup, Recovery, and Media Services for iSeries (BRMS).

      For more information about this product, see the IBM Documentation Backup, Recovery, and Media Services for iSeries (document number SC41-5345).

  5. You check your backups.

    After completing a backup, you should check the job log or look at the BRMS log if you used the IBM software product Backup, Recovery, and Media Services . Make sure that the backup completed successfully, and no objects were excluded from the backup. To find out if the recent backups were completed, and which objects were excluded for an incomplete backup, you can also use the Start of the navigation pathComputing Center Management System (CCMS) Next navigation step DB Administration Next navigation step Backup Logs (transaction DB12)End of the navigation path and choose the Database Backup History tab.