BACKUP

The BACKUP utility copies one or more areas in a database to a backup file. The backup file can be used later as input for a restore operation.
idmscu19
The BACKUP utility copies one or more areas in a database to a backup file. The backup file can be used later as input for a restore operation.
The format of files produced by the BACKUP utilityis
not
compatible with the format of backup files produced by the 10.2 IDMSDUMP utility program. Files produced by BACKUP can only be used by the RESTORE utility and files produced by IDMSDUMP can only be used with IDMSRSTR.
This article describes the following information:
2
2
Authorization
To
You Need This Privilege
On
Back up an area
DBAREAD
The area
Back up a file
DBAREAD
The area(s) to which the file maps
Syntax
                             ┌─────────── , ────────────┐ ►►─── BACKUP ─┬─ AREA ─────▼─ segment-name.area-name ─┴─┬─────────┬─────────┬─►◄               │                                         └─ SHARE ─┘         │               │            ┌─────────── , ────────────┐                     │               ├─ FILE ─────▼─ segment-name.file-name ─┴─────────────────────┤               │                                                             │               │            ┌────── , ────────┐                              │               └─ SEGMENT ──▼─ segment-name ──┴──┬─────────────┬─┬─────────┬─┘                                                 ├─ BY AREA ◄──┤ └─ SHARE ─┘                                                 └─ BY FILE ───┘  
Parameters
  • AREA
    Directs the BACKUP utility to back up one or more areas. Multiple area names must be separated by commas.
  • segment-name
    The name of the segment associated with an area to be backed up.
  • area-name
    The name of an area.
  • SHARE
    Specifies that no locks are to be placed on the named areas. When you specify SHARE, each specified area is backed up regardless of whether a lock has been placed on the area by another program. SHARE allows the named areas to be backed up while another job is updating those areas at the same time, for example, it needs to be specified when taking a "hot backup" during which the areas that are being backed up are being updated by transactions executing under the central version.
    By default, if you do not specify SHARE, an external lock is placed on each specified area for the duration of the backup operation. If an external lock cannot be placed on an area, that area will not be backed up, and the backup operation will terminate with an error. Therefore, no more areas will be backed up. An external lock means that it is placed physically using the normal SMP lock.
    When you specify SHARE and
    do not
    vary the affected areas for retrieval only, the copy of the database created by the BACKUP utility may not be usable for restore operations.
  • FILE
    Directs the BACKUP utility to back up one or more files.
    Multiple file names must be separated by commas.
  • segment-name
    The name of a segment associated with a file to be backed up.
  • file-name
    The name of a file.
  • SEGMENT
    segment-name
    The name of the segment to be backed up.
  • BY AREA
    Specifies that each area defined within the segment is to be backed up. AREA is the default.
  • BY FILE
    Specifies that each file within the segment is to be backed up.
    The SHARE option is only valid for area processing. When you specify the BACKUP SEGMENT command with the BY FILE option, the SHARE option is ignored. If you specify the BY FILE option with the BACKUP SEGMENT command and the SHARE option is omitted, area locks are not set.
Usage
How to submit the BACKUP statement
You submit the BACKUP statement only through the batch command facility. You must run the batch command facility in local mode.
When to use SHARE
You can specify SHARE and get a backup usable for restore operations if you vary the affected area(s) for retrieval only. This prevents other users from changing the contents of the area during the backup operation.
If you specify SHARE without varying the area(s) for retrieval only, you should exercise extreme caution when making use of the backup.
BACKUP by file does not lock areas
When you back up by file, the BACKUP utility does not lock the associated area(s). Therefore, to preserve the integrity of the area, you should vary affected areas for retrieval only.
RESTORE the same object you backed up
If you back up by area, restore by area. If you back up by file, restore by file.
Number of BACKUP statements per BCF-job
Only one BACKUP statement per BCF-job is allowed. Specifying multiple BACKUP statements for the same BCF-job will result in all BACKUP files, except for the last one, being overwritten. This is caused by the way syntax parsing has been implemented, for example, for each BACKUP statement the BACKUP utility (such as, module IDMSUBKP) is called that at the beginning will open the BACKUP file specified by <ddname/filename/linkname> SYS001 in OUTPUT mode and will close it before returning to the syntax parsing module.
JCL Considerations
When you submit a BACKUP statement through the batch command facility, the JCL to execute the facility must include statements to define:
  • The files associated with the areas to be backed up
  • The archive file which will contain the backup
For more information about the generic JCL used to execute the batch command facility, see the section for your operating system in this section.
Examples
Back up by area
The following example directs the BACKUP utility to back up three database areas.
backup area empdemo.emp-demo-region,             empdemo.org-demo-region,             empdemo.ins-demo-region;
Back up by file
The following example directs the BACKUP utility to back up three database files.
backup file empdemo.empdemo,             empdemo.orgdemo,             empdemo.insdemo;
Back up by segment
The following example directs the BACKUP utility to back up all areas in the empdemo segment.
backup segment empdemo;
Sample Output
Back up by area
When the backup by area operation in the previous example is completed, the BACKUP utility provides the following report.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 1   BACKUP  AREA EMPDEMO.EMP-DEMO-REGION,                EMPDEMO.ORG-DEMO-REGION,                EMPDEMO.INS-DEMO-REGION; UT015006 BACKUP file created on yyyy-mm-dd-hh.mm.ss.ffffff UT015005 Max Archive record size is 4,280 UT000038 Starting BACKUP of area EMPDEMO.EMP-DEMO-REGION UT000040 BACKUP complete UT000038 Starting BACKUP of area EMPDEMO.ORG-DEMO-REGION UT000040 BACKUP complete UT000038 Starting BACKUP of area EMPDEMO.INS-DEMO-REGION UT000040 BACKUP complete Status = 0        SQLSTATE = 00000
Output from back up by file
When the backup by file operation in the previous example is completed, the BACKUP utility provides the following report.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 3   BACKUP  FILE EMPDEMO.EMPDEMO,                EMPDEMO.ORGDEMO,                EMPDEMO.INSDEMO; UT015006 BACKUP file created on yyyy-mm-dd-hh.mm.ss.ffffff UT015005 Max Archive record size is 4,280 UT000039 Starting BACKUP of file EMPDEMO.EMPDEMO UT000040 BACKUP complete UT000039 Starting BACKUP of file EMPDEMO.ORGDEMO UT000040 BACKUP complete UT000039 Starting BACKUP of file EMPDEMO.INSDEMO UT000040 BACKUP complete Status = 0        SQLSTATE = 00000
Output from backup by segment
When the backup by segment operation in the previous example is completed, the BACKUP utility provides the following report.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 5   BACKUP  SEGMENT EMPDEMO; UT015006 BACKUP file created on yyyy-mm-dd-hh.mm.ss.ffffff UT015005 Max Archive record size is 4,280 UT000038 Starting BACKUP of area EMPDEMO.EMP-DEMO-REGION UT000040 BACKUP complete UT000038 Starting BACKUP of area EMPDEMO.INS-DEMO-REGION UT000040 BACKUP complete UT000038 Starting BACKUP of area EMPDEMO.ORG-DEMO-REGION UT000040 BACKUP complete Status = 0        SQLSTATE = 00000
More Information