Data Restore BACKUP is used to perform a user archive of the database. It accesses, reads and unloads the database directory and data to either disk, tape, or both. The BACKUP output produced can later be used to either recover the whole database or selected tables.
When enabled, the Data Restore BACKUP will be performed automatically in conjunction with an explicit SQLEND user archive of the database.
If only a small part of data is modified daily, you can reduce the time required for a user archive by using the Incremental Backup function. Using the Incremental Backup function, only datapages which have changed since the last Full Backup are recorded.
Having Data Restore enabled to Control Center ("Drmstr-enabled" = "Y" in the database PARMS file), does NOT require that you perform Data Restore backups. For explicit archives, you can always select to execute a normal DB/2 archive. If the "Uarchive-enabled" database parameter value is "N", then Data Restore BACKUP will not be executed.
To use BACKUP with Control Center, it will be invoked as a SQLEND UARCHIVE. This will ensure that the database log history is updated, and the ARCHHIST files are properly updated for recovery or RESTORE operations.
Implicit archives will be initiated automatically by the database when the ARCHPCT of the log file is reached. Logmode A will cause an implicit |DB2 Server for VM archive, and logmode L will cause an implicit log archive. Since this is initiated by the database, if logmode A is used, Control Center will not be able to request a SQLEND UARCHIVE using BACKUP.
There are several ways that you can prevent an implicit archive from occurring. One way would be to schedule a log archive (or full archive for logmode A) at intervals that will normally prevent the ARCHPCT from being reached. Another way would be to schedule a database monitor routine (using SHOW LOG) that would periodically check the log percent, and explicitly initiate an archive if the log was near the ARCHPCT value.
BACKUP is executed on the Data Restore machine This means that the DASD and TAPES will be owned by the Data Restore and not the database manager. The reason for this is to:
The same tape series, as recorded by the "Archive_series" value in the database PARMS file, will be used for both archive and BACKUP. This is done in order to keep the BACKUP and archive events synchronized.
The ARCHHIST file records database archive and user archive events. It also holds all backup and archive information. Recovery sets are determined by information in the ARCHHIST file. BACKUP and TRANSLATE timestamps are appended to the corresponding ARCHHIST record so they can be mapped to the related ARCHHIST and TRANSHIST events. Keeping the series synchronized ensures that a BACKUP or TRANSLATE event will not be purged from the log files while there still is a corresponding archive event.
Unlike a log archive to disk, the filetype of the archive file is not changed by Data Restore during the BACKUP process. You must be sure to use unique FILETYPES for each BACKUP minidisk file that is listed in the TAPES file.
After the log archive (if logmode=L) completes, the BACKUP function will begin. Based upon input to the database PARMS file, and the database TAPES file, the proper SYSIN file will be created, media FILEDEFed and LABELDEFed, and tapes mounted.
After the BACKUP completes, Control Center will be notified and the database ARCHHIST file will be updated with the proper status.
If the BACKUP completes successfully, the tapes used during this process, along with the timestamp of the BACKUP, will be added to the ARCHHIST file. The archive complete record in the database ARCHHIST file will indicate the type of backup (FULL, Incremental, Dual) that was performed.
If the BACKUP fails, a failure record will be placed in the ARCHHIST file. Any log archives performed prior to BACKUP will still be valid.
After the BACKUP is finished, the database is restarted.
When using BACKUP, the entries in the database TAPES file will track the BACKUP tapes to be used, and the database ARCHHIST file will record the tapes or files that are used.
Execution of an Incremental Backup is treated like a normal user archive by DB2 Server for VM and the process used by Control Center to manage the Incremental Backup will look very similar to a normal BACKUP. However, the Incremental Backup will only backup those database data pages that have changes since the last Full Backup or ARCHIVE FULL.
Consider the following situation: a Full Backup is executed each weekend and Incremental Backup every day. The Incremental Backup produced on Monday will only contain pages modified on Monday. The Incremental Backup produced on Tuesday will contain pages modified on Monday and Tuesday (all pages modified since the last Full Backup), and so on.
Before an Incremental Backup for a database can be executed through Control Center the user must enable Incremental Backup (Enable-incbackup = Y) in the database PARMS file for that database and add Incremental Backup tapes or files to the database TAPES file. After updating the TAPES and PARMS files, the user must also perform a Full Backup or ARCHIVE FULL before Data Restore will allow an Incremental Backup.
An Incremental Backup is a USER ARCHIVE and is recorded in the database history area as a USER ARCHIVE. Databases using logmode = L will perform a log archive prior to the Incremental Backup.
When "Incbackup-enabled" = "Y" in the Control Center database PARMS (parameters) file, Control Center will only execute a BACKUP with the FULL or INCREMENTAL option. Full Backup is the default backup type. This will allow Control Center to keep a Full Backup and its Incremental Backups together in the same tape series. When "Incbackup-enabled" = "N", Control Center will not execute an Incremental Backup.
An ARCHIVE or BACKUP using the FULL option will backup all the pages of the database and will be used as the reference backup for subsequent Incremental Backups. The reference backup is not processed when executing Incremental Backup, but is required for the RELOAD and RESTORE functions.
A Full Backup or ARCHIVE FULL will place a timestamp in the database directory and also resets the modified_pages indicators. Only the last Full Backup or ARCHIVE FULL timestamp is kept in the database directory.
When a Full Backup or ARCHIVE FULL completes successfully, Control Center will record the timestamp in the database ARCHHIST file. When an Incremental Backup completes successfully, its timestamp and the timestamp of its reference backup will be included in the database ARCHHIST entry. This will allow Control Center to maintain and manage the Incremental Backup and its associated reference backup.
An Incremental Backup and its reference backup are equal to one usable BACKUP. If a reference backup has been overwritten, then the Incremental Backup associated with that reference backup can not be used for a RESTORE or RELOAD. To RESTORE or RELOAD from an Incremental Backup, Data Restore will first process all the changed pages recorded in the Incremental Backup and then process unchanged pages from the reference backup. Control Center will automatically manage all necessary FILEDEFs and tape mounts.
For implicit ARCHIVES, logmode A, the database server will perform an ARCHIVE FULL if there has been any Full Backup or ARCHIVE FULL performed previously. During archives, the database will indicate if an ARCHIVE FULL has executed.
An ARCHIVE FULL will have to be translated by Data Restore before it can be used to RELOAD or RESTORE an Incremental Backup. Data Restore will indicate if an ARCHIVE or ARCHIVE FULL is being translated.
Incremental Backup has its own "Incbackup-series" in the database PARMS file to control which set of tapes will be used for the next Incremental Backup.
The Incbackup-series in the database PARMS file indicates the series and subseries in the database TAPES file that will be used to supply tapes for the next Incremental Backup. The Incbackup-series is presented in the form "series.subseries" where:
The subseries is incremented only after an Incremental Backup successfully completes.
The Archive-series, Logarch-series and Trace-series are not incremented when an Incremental Backup completes.
The Incbackup-series will be maintained in the database PARMS file even when "Incbackup-enabled" = "N".
After an Incremental Backup completes, the subseries will be incremented even though there may not be an "INCBK" entry in the database tapes file for that Incbackup-series.
The user must setup the database TAPES file so that there will be enough entries of each tape type to accommodate the expected backup/archive workload. However, there will be times when a user has performed more than the usual number of Incremental Backups, and there may not be anymore "INCBK" entries in the database TAPES file to satisfy a regularly scheduled Incremental Backup. Control Center provides several options to ensure that archiving can continue.
If another Incremental Backup is requested when there is no "INCBK" entry for the current Incbackup-series, then one of these actions will occur:
If you have indicated the "NOAUTOFULL" command option then Control Center will not switch the Incremental Backup to a Full Backup regardless of the "Auto-full" value in the database PARMS file. The Incremental Backup will be cancelled.
If the Incremental Backup is cancelled, you can use the Tape Maintenance menu to add the new "INCBK" entry and then request another Incremental Backup.
The user must understand the implications of switching an Incremental Backup to a Full Backup. A Full Backup may take considerably longer than an Incremental Backup and can affect the execution of other scheduled database maintenance activity.
There may be times when switching or not switching makes more sense. The AUTOFULL/NOAUTOFULL command option offers the user the flexibility to control the Incremental Backup without changing the overall Incremental Backup strategy. In order to keep the Incremental Backup tapes together with its reference backup, Control Center will increment the Incbackup-series whenever a BACKUP or archive completes.
An incremental backup is a User Archive and when the database is using logmode L, log archives will be initiated by the database.
Number of LOG ARCHIVE entries in a series |
---|
There must be enough log archive entries in each Logarch-series to handle all log archives between Full Backup or ARCHIVE FULL in the Incbackup-series. If the database is logmode L, then a log archive is performed before each USER ARCHIVE (BACKUP or Incremental Backup). |
Before you begin using BACKUP, consider or perform the following:
The four files below provide necessary information to Control Center in managing BACKUP activity.
This file contains information that describes the interfaces to tape management systems like VMTAPE, EPIC and DYNAM/T. It is created during the service machine's installation and is located on Control Center's A-disk. Refer to the DB2 Server for VM Control Center Program Directory and Chapter 8, Managing the Environment for specific information regarding this file.
This exec is used by the Data Restore machine to issue tape mount requests, if required. It exists on the service machine's code disk and can be modified to accommodate unsupported tape management systems. The SQMSTAPE $EXEC contains the original product code and should not be modified.
Based on certain parameters chosen in the database PARMS file, BACKUP will automatically be initiated each time a SQLEND UARCHIVE is performed.
The database PARMS file contains Data Restore information that will be used during the BACKUP process. For specific details regarding this file, and the Data Restore parameters, refer to About the Database Parameters Tool.
Changing the Database PARMS File |
---|
It is important to note that any changes made to Data Restore parameters in a given database PARMS file WILL be used during the next Data Restore function regardless of the status of the database. This is because Data Restore parameters in the database PARMS file are re-initialized on the Data Restore machine prior to each Data Restore function. |
The database TAPES file contains the tapes or disks to be used during BACKUP. It must be defined before performing a BACKUP. Similar in structure to the database TAPES file, it is used prior to executing BACKUP to correctly establish required CMS FILEDEF and LABELDEF information that will be used during the operation. The current archive series (recorded in the database PARMS file), will be used to determine the BACKUP series.
Entries for the primary backup (ARCHIV) are indicated in the TAPES file by using a type of BACKUP. Entries for the dual backup (ARCHIV2) are indicated by using a type of BACKUP2. If the Dual_backup value in the database PARMS file is "N", then tape/file information for BACKUP2 will be ignored. Even if you do not anticipate using dual BACKUPS, it might be helpful to still include an entry for BACKUP2. If you only perform user archives, you still must have an ARCHIVE entry in the database TAPES file for each series.
Remember, if you use logmode A, and the log fills up, the archive will be automatically handled by Control Center based on the tape file information listed for that series. You do NOT need to always perform a SQLEND UARCHIVE because you have enabled Data Restore. For explicit (user initiated) archives, you can always select which kind of archive to execute (user or otherwise).
If the BACKUP or BACKUP2 (dual backup) media is disk, then the TAPES file entry must include the filename, filetype and link address of the disk where the file is to be written. The filemode value is required as a placeholder only. The filemode and access cuu (virtual address) will be determined prior to executing the FILEDEFS for the function.
Figure 112. Example Database TAPES file for DUAL backup to TAPE and DISK
SERIES TYPE DATE TIME STATUS FILENAME FILETYPE FM CUU
100 BACKUP 97021 19:00:56 FILLED VB3025
100 BACKUP2 97021 19:00:56 FILLED BACK100 DB2VM510 * 400
Figure 112 above shows BACKUP series 100 using dual backups where both tape and disk are specified. In this case, BACKUP, the primary backup, will use tapes VB3024 and VB3025, as needed. If an additional tape is needed, a SCRATCH tape will be acquired. The VOLID of the SCRATCH tape will be added to the TAPES file. BACKUP2 will use CMS file BACK100 DB2VM510, located on minidisk address 400, for the dual backup.
Changing BACKUP Output information |
---|
Changes to BACKUP output media types (disk to tape or tape to disk) or volid/file information will take effect immediately and should not be changed during execution of the BACKUP. Changes to database TAPES file while the function is running could cause the process to fail. |
BACKUP to tape and disk are fully supported. This information is specified in the database PARMS file. You can designate that your primary backup or dual backup be performed to tape and disk. See the example database PARMS file below in Figure 113 which shows dual BACKUP using both tape and disk. The only restriction is that all primary backups are of the same media type, and all your DUAL backups are of the same media type (tape or disk).
Figure 113. Example DUAL BACKUP to TAPE and DISK Database Parameters
:Archive_media.TAPE :Uarchive_enabled.Y :Drmstr_enabled.Y :Dual_backup.Y :Backup2_media.DISK :Scratch_tape_option.N |
To BACKUP using disk, the database TAPES file and the database PARMS file must be defined properly. The PARMS file will |indicate that disk is to be used instead of tape for the Archive_media and Backup2_media (if dual is used).
Note: | You should not specify a virtual address of less than 200. Addresses between 180 and 190 are reserved for tape usage and are detached during product operation. |
All media entries in the TAPES file must match the media format in the PARMS file. The volid for disk archiving should be expressed as a filename, filetype, filemode, and the link address (as defined in the VM directory).
A single BACKUP to disk cannot span multiple minidisks. Therefore, a full BACKUP must fit on a single minidisk. BACKUPS to tape may span multiple tapes.
Another requirement of BACKUP disks is that each output minidisk should not be linked and accessed by the Data Restore machine. Control Center will handle all required link and accessing. The link address listed in the TAPES file will be linked to using the next available virtual cuu starting with 120 and the next free filemode. This is to prevent the Data Restore machine from running out of filemodes or cuus when it must manage Data Restore functions for |multiple databases. Control Center will check the contents of the database SQLFDEF file to ensure that the cuu selected does not match an address used by the database. Data Restore will detach any cuus that match a database"s minidisk addresses as part of its operation. Control Center will also detach any duplicate links that the Data Restore machine has made to the same address.
In order to support the rotation from one tape series to the next, BACKUPS can only be executed by issuing a SQLEND UARCHIVE. The BACKUPS will always use the same series as the current archive series. This ensures correct mapping of a user ARCHIVE event to a BACKUP event.
Control Center will use the unique filename provided by the user in the TAPES file for each backup to disk. Therefore, each BACKUP file will be overwritten when the series is used again.
If you change the name of the BACKUP files, you should manually perform disk cleanup of any old BACKUP files.
At the completion of a full SQLEND UARCHIVE, Control Center will automatically switch to the next series of tapes within the TAPES file for the next archive or BACKUP, to prevent the next archive from writing over the previous archive. Control Center will use the same series as the archive to process the BACKUP.
User archiving without Data Restore can still be processed by changing the Drmstr_enabled parameter to "N" in the database PARMS file and keeping the Uarchive_enabled parameter set to "Y". However, if you do not use Data Restore, then you should have a user archive process in place as defined in Appendix F, User Archiving.
Once all the control files have been defined to Control Center and the Data Restore machine, BACKUP can be invoked either through command mode execution, or through Control Center's menu interface.
Since BACKUP is a USER ARCHIVE function, select Option A from the main menu of Control Center to reach the Archiving Tool. Then select Option I. Figure 114 is now displayed. Options on this menu are available to the BACKUP administrator for selection.
Figure 114. Database Archiving Initiation Panel
+--------------------------------------------------------------------------------+ | mm/dd/yyyy CONTROL CENTER hh:mm:ss | | *----------------------------- Initiate Archive -----------------------------* | | | Option ===> CTRLID: MSTRSRV1 | | | | Database ===> SQLDBA NODE: VMSYSTM1 | | | | | | | | ************************ ARCHIVE COMMANDS ************************ | | | | SA SQLEND ARCHIVE parms Full archive, data base down | | | | SL SQLEND LARCHIVE parms Log archive, data base down | | | | SU SQLEND UARCHIVE parms User archive, data base down | | | | A ARCHIVE parms Full archive, data base up | | | | L LARCHIVE Log archive, data base up | | | | | | | | ****************** Data Restore BACKUP COMMANDS ****************** | | | | BU BACKUP parms Data Restore Backup | | | | BI BACKUP INCREMENTAL parms Data Restore Incremental Backup | | | | | | | | Valid SQLEND Parms: DVERIFY, TRCPURGE | | | | Valid Incremental Backup Parms: AUTOfull NOAUTOfull | | | | | | | | Enter OPTION and PARMS, press ENTER to Process | | | | | | | *---------------------------------------------------------------SQMAR10------* | | 1 Help 3 End (Cancel) | | | +--------------------------------------------------------------------------------+
The AUTOFULL and NOAUTOFULL options can be used with Incremental Backup to control how Control Center will respond if there are no INCBK tapes for the current incbackup-series in the database TAPES file.
Note: | If you are using SCRATCH tapes for your Incremental Backup, the AUTOFULL/NOAUTOFULL option is not necessary. Control Center will automatically add a new INCBK SCRATCH entry in the database TAPES file for the current Incbackup-series and The Incremental Backup process will continue. |
If you have indicated the AUTOFULL command option then Control Center will switch an Incremental Backup to a Full Backup if there are no INCBK tapes for the current incbackup-series in the database TAPES file. With AUTOFULL, Control Center will switch the Incremental Backup to a Full Backup regardless of the Auto-full value in the database PARMS file.
If you have indicated the NOAUTOFULL command option then Control Center will not switch the Incremental Backup to an Full Backup regardless of the Auto-full value in the database PARMS file. The Incremental Backup will be cancelled.
The user must understand the implications of switching an Incremental Backup to a Full Backup. A Full Backup may take considerably longer than an Incremental Backup and can affect the execution of other scheduled database maintenance activity.
There may be times when switching or not switching makes more sense. The AUTOFULL/NOAUTOFULL command option offers the user the flexibility to control the Incremental Backup without changing the overall Incremental Backup strategy.
Note: | Executing the BACKUP command is the same as executing the User archive command when Data Restore is enabled to Control Center. |
After BACKUP is initiated using Control Center, either through command mode or panel interface, no further action will be required by the user.
You must have database or Control Center administrator authority to execute BACKUP. Those persons identified as Control Center administrators on other databases, or persons with Control Center user or operator authority cannot invoke BACKUP.
To cancel a Data Restore BACKUP, select Option C from the Archiving Menu, or use the command mode interface to terminate the Data Restore process. For BACKUPS, the cancel routine process will end with a user archive failed message sent to the database. Control Center will restart the database indicating the BACKUP has failed.