With COPY utility statement, the database administrator can create SESAM backup copies of the whole of the SESAM/SQL database or parts of the database, such as the catalog space or user spaces. SESAM/SQL creates SESAM backup copies either on magnetic tape cartridge or on disk. A SESAM backup copy can be created in online mode or in offline mode. It is also possible to create a backup from mirror units of a local or remote storage system using HSMS. In addition, the database administrator can have the formal correctness of the SESAM backup copy verified and can enable logging for a user space or a catalog space once the copy has been created. Spaces which only contain indexes and are not involved in the logical data backup can be excluded from the backup.
If the database is located on a DB user ID, SESAM/SQL will always first try to create the SESAM backup copy on the DB user ID. This is only possible if the preparations have been made for creating the files, see the section “Database files and job variables on foreign user IDs”. Otherwise the copies will be created on the DBH user ID.
If logging is enabled, COPY CATLOG and COPY CATLOG_SPACE always lead to a change of CAT-LOG file and DA-LOG file.
If logging is not enabled, SESAM/SQL creates the CAT-REC file according to the specifications in the media table the first time the COPY CATALOG or COPY CATALOG SPACE statement is issued.
For each COPY CATALOG and COPY CATALOG_SPACE, a CAT-REC copy is created on the same media where the CAT-LOG file is located. No metadata is stored for these additional copies. If the CAT-REC copy is to be located on the DB user ID, the above applies. CAT-REC copies from previous COPYs are overwritten.
SESAM backup copies on magnetic tape cartridge can be created using the COPY ... USING DIRECTORY utility statement or with the software products HSMS or ARCHIVE (see the “SQL Reference Manual Part 2: Utilities”). If an HSMS parameter file is present then the name specified for COPY ... USING DIRECTORY is interpreted as an HSMS archive. Otherwise the backup is performed using ARCHIVE.
Creating a SESAM backup copy online or offline
When COPY is executed, SESAM/SQL puts all the spaces (the catalog space and user spaces) acted on by COPY in a transaction-free state.
The following effects have to be taken in consideration when using COPY ONLINE: When COPY ONLINE is used, SESAM/SQL again permits SQL query and update statements and CALL DML statements once the creation of the copy has begun. SESAM/SQL rejects all other SQL statements and all utility statements and issues an SQL status code.
If the online backup is to take place in an HSMS archive, the database files to be backed up must not be located on private disk.
All the blocks in the user spaces that are to be modified during the copy operation are logged by SESAM/SQL prior to modification as so-called physical before-images (PBI) in the PBI file (in the case of disk copy and ARCHIVE) or they are logged by HSMS in the HSMS work file. This file is always created on the user ID in which the DBH is running. Once the copy operation is complete, SESAM/SQL terminates PBI logging and permits all statements access to the relevant user spaces.
When a SESAM backup copy is created on disk, SESAM/SQL immediately copies the logged before-images to the SESAM backup copy in order to ensure that the SESAM backup copy matches the relevant user space in its transaction-free state immediately prior to the actual copy operation.
When a SESAM backup copy is created on magnetic tape cartridge using ARCHIVE, SESAM/SQL also saves the PBI file on a separate magnetic tape cartridge. In this case, the file is not restored until a repair or reset is carried out with the utility statement RECOVER.
In the case of backup in an HSMS archive, the block to be backed up is einther read from the database file or from the HSMS work file and is then backed up. A specific SESAM/SQL DBH can execute more than one COPY ONLINE statement at a time. However, these must refer to spaces in different databases.When COPY OFFLINE is used, SESAM/SQL retains all update requests for the user spaces or the catalog space affected by the copy operation until the COPY OFFLINE is complete.
The SESAM backup copy matches the relevant space or spaces in the transaction-free state immediately prior to the actual copy operation.
Creating SESAM backup copies from mirror units using HSMS
COPY ... USING DIRECTORY
hsms_archive_name {BY_ADD_MIRROR_UNIT | BY_SRDF_TARGET}
is a very efficient means of backing up database files that are stored on a mirror unit in an HSMS archive on disk or on magnetic tape cartridge. Depending on the location of the mirror unit, two cases must be differentiated (explained here taking the Symmetrix function TimeFinder/Mirror as an example):
BY_ADD_MIRROR_UNIT
In this case the TimeFinder/Mirror function (Symmetrix Multi Mirror Facility) of the Symmetrix systems is used during ongoing operation. Database operation runs on the so-called normal unit in the local symmetrix. An additional disk, the so-called additional mirror unit, is used in the local symmetrix for data mirroring. The normal unit and additional mirror unit together are referred to as the multi-mirror pair.Figure 30: Configuration with TimeFinder
BY_SRDF_TARGET
In this case the SRDF (Symmetrix Remote Data Facility) function of the symmetrix systems is used during ongoing operation. Database operation runs on the so-called source unit in the local symmetrix. An additional disk, the so-called target unit, is used in the remote symmetrix for data mirroring. The source unit and target unit together are referred to as the remote copy pair.
The remote copy pair must be operated in synchronous mode.
The HSMS archive must be located on the same system to which the source unit is connected.To create a SESAM backup copy it is necessary that the target unit in the remote symmetrix is assigned an additional mirror unit. In other words the target unit and additional mirror unit are both located in the remote symmetrix and there form a multimirror pair (TimeFinder/Mirror).
Figure 31: Configuration with SRDF and TimeFinder
Note: To permit further data mirroring in the local symmetrix the source unit can be supplemented by an additional mirror unit (TimeFinder/Mirror). A SESAM backup copy could also be created from this using BY_ADD_MIRROR_UNIT (against a gray background in the figure, of no significance in the further description).
In both cases the SESAM backup copy is created from the additional mirror unit using HSMS. The database files must be located on the same additional mirror unit.
When the term mirror units is used in the description below, additional mirror units (symmetrix systems) or clone units (ETERNUS DX, symmetrix or CLARiiON CX systems) are also meant.
You can find more detailed information on these storage systems and on their replication functions in the “SHC-OSD (BS2000)” manual.
Procedure for backup from mirror units using HSMS
Backup takes place in three phases:
Firstly the mirror unit is split from the normal unit (case 1 in the previous section) or target unit (case 2). DML read access to the database is possible.
The specified database files are backed up from the mirror unit to the specified HSMS archive.
The database on the normal unit (case 1) or source unit (case 2) is processed by the DBH. Mirroring to the target unit (case 2) is continued. Read access to the database (in the case of COPY ... OFFLINE) or even DML update access (in the case of COPY ... ONLINE) is possible during the backup process.Once the backup to the HSMS archive is complete, the mirror unit and the normal unit (case 1) or target unit (case 2) are synchronized again. Read and write access is also possible during this time.
SESAM/SQL uses the HSMS concurrent COPY (CCOPY) function when executing the COPY statement. HSMS uses the software product SHC-OSD. For backup in an HSMS archive SESAM/SQL builds the HSMS statement BACKUP-FILES with the parameter WRITE-CHECKPOINTS=*YES in order to write restarting points. This means that the HSMS backup run can continue following an abortion with the HSMS statement RESTART-REQUESTS (you can find further information about this in the “HSMS (BS2000)” manual, volume 1).
The advantage of this process is that the database administrator does not have to worry about either splitting or synchronizing the mirror unit.
For this function the DBH task requires one of the privileges TSOS or HSMS-ADMINISTRATION.
Figure 32: Procedure for backup from additional mirror units using HSMS
Initialization phase: time from the start of the COPY statement to the separation of the mirror disks. During this phase only read access is possible for the spaces to be backed up. Write access is only possible at the end of the initialization phase. SESAM/SQL builds the HSMS statement BACKUP-FILES.
Backup and operation phase: time during which HSMS backup and database operation run in parallel. HSMS backs up the database files from the mirror unit to an HSMS archive. The database on the normal unit or the source unit is processed in parallel to this by the DBH. DML update statements are permitted again in COPY ONLINE.
Synchronization phase: time from the end of the HSMS backup to the completion of the mirror disk synchronization. Following the HSMS backup, the mirror disks are synchronized again. DML read and update statements are possible again.
The backup was successful if the backup to the HSMS archive was successful and the formal check with the CHECK FORMAL parameter specified did not result in an error. Successful backup is recorded in the RECOVERY_UNITS.
Notes about backup with the CHECK FORMAL parameter
The CHECK FORMAL parameter can be specified for an online backup from mirror units using HSMS.
If the source unit or normal unit belongs to a shared pubset, the SESAM/SQL DBH must run on the server which is represented as the master side for the shared pubset. The formal check of the spaces to be backed up is performed on the split additional mirror unit parallel to backing up the files to the HSMS archive.
Otherwise the parameter may not be specified for an online backup to magnetic tape cartridge.
If the parameter CHECK FORMAL is specified for an offline backup to magnetic tape cartridge, the formal check of the spaces to be backed up will first be performed and then the request is given to HSMS. This means that the spaces to be backed up will be locked until the formal check is complete. Separation of the disks only begins after this.
When such requirements apply, you should therefore favor online backup from additional disk units using HSMS.
In other cases the following procedure is recommended for an offline backup: The backup should be created with NO CHECK FORMAL. The database administrator should then read in the backup again from the HSMS archive, add the database to the SQL database catalog of another DBH and perform the formal check.
If an error is detected in a formal check, this means the backup was not successful; the original space is not flagged as “defective”, however.