RESTORE

The RESTORE utility restores one or more areas in a database by copying back the contents of a file created by the BACKUP statement. 
idmscu19
The RESTORE utility restores one or more areas in a database by copying back the contents of a file created by the BACKUP statement. 
This article describes the following information:
2
2
Authorization 
To restore an area, a file, or a segment, you need DBAWRITE access privileges on the area.
Syntax
                          ┌─────────── , ────────────┐ ►►─── RESTORE ─┬─ AREA ─▼─ segment-name.area-name ─┴──────────────┬───────────►◄                │                                                  │                │        ┌─────────── , ────────────┐              │                ├─ FILE ─▼─ segment-name.file-name ─┴──────────────┤                │                                                  │                │            ┌────── , ────────┐                   │                └─ SEGMENT ──▼─ segment-name ──┴─┬─────────────┬───┘                                                 ├─ BY AREA ◄──┤                                                 └─ BY FILE ───┘  
Parameters
  • AREA
    Directs the RESTORE utility to restore one or more areas.
  • segment-name
    Specifies the name of the segment associated with the area.
  • area-name
    Specifies the name of the area.
  • FILE
    Directs the RESTORE utility to restore one or more files.
  • segment-name
    Specifies the name of the segment associated with the file.
  • file-name
    Specifies the name of the file.
  • SEGMENT
    segment-name
    Specifies the name of the segment to be restored.
  • BY AREA
    Specifies that each area defined within the segment is to be restored. AREA is the default.
  • BY FILE
    Specifies that each file within the segment is to be restored.
Usage
How to submit the RESTORE statement
You submit the RESTORE statement only through the batch command facility. When submitting RESTORE statements, the batch command facility must be run in local mode.
Vary areas offline
Before running the RESTORE statement, vary all areas being restored offline to all DC/UCF systems. This will prevent all other jobs from accessing the areas until RESTORE processing is completed.
Restoring by area requires locks on areas
CA IDMS/DB locks an area before restoring it. If the area is already locked, it is not restored and the RESTORE operation will terminate with an error. No more areas are restored. It is possible that a local mode application abended without releasing an area lock. In this case, use the UNLOCK statement to unlock the area.
Restoring by file does not lock areas
When you restore by file, CA IDMS/DB does not lock the associated area(s).
RESTORE the same object you backed up
If you backed up by area, restore by area. If you backed up by file, restore by file.
Restoring from IDMSDUMP
RESTORE can only restore files produced by the BACKUP utility. RESTORE
cannot
restore files produced by the 10.2 IDMSDUMP utility program. You must use the 10.2 IDMSRSTR utility program to restore files produced by IDMSDUMP.
JCL Considerations
When you submit a RESTORE statement through the batch command facility, the JCL to execute the facility must include statements to define the file(s) containing the areas to be restored.
For more information about the generic JCL used to execute the batch command facility for your operating system, see z/OS JCL and z/VSE JCL .
Examples
Restoring by area
The following example directs the RESTORE utility to restore three database areas.
  restore area empdemo.emp-demo-region,                empdemo.org-demo-region,                empdemo.ins-demo-region;
Restoring by file
The following example directs the RESTORE utility to restore three database files.
  restore file empdemo.empdemo.                empdemo.orgdemo,                empdemo.insdemo;
Restoring by segment
The following example directs the RESTORE utility to restore all areas in the empdemo segment.
  restore segment empdemo;
Sample Output
Restoring a database by area
The following listing is generated after the statements in the "Restoring a Database by Area" example are successfully executed.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 2   RESTORE 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 UT000038 Starting RESTORE of area EMPDEMO.EMP-DEMO-REGION UT000040 RESTORE complete UT000038 Starting RESTORE of area EMPDEMO.ORG-DEMO-REGION UT000040 RESTORE complete UT000038 Starting RESTORE of area EMPDEMO.INS-DEMO-REGION UT000040 RESTORE complete Status = 0        SQLSTATE = 00000
Restoring a database by file
The following listing is generated after the statements in the "Restoring a Database by File" example shown previously are successfully executed.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 4   RESTORE FILE EMPDEMO.EMPDEMO,                EMPDEMO.ORGDEMO,                EMPDEMO.INSDEMO; UT015006 BACKUP file created on yyyy-mm-dd-hh.mm.ss.ffffff UT000039 Starting RESTORE of file EMPDEMO.EMPDEMO UT000040 RESTORE complete UT000039 Starting RESTORE of file EMPDEMO.ORGDEMO UT000040 RESTORE complete UT000039 Starting RESTORE of file EMPDEMO.INSDEMO UT000040 RESTORE complete Status = 0        SQLSTATE = 00000
Restoring a database by segment
The following listing is generated after the statements in the "Restoring a Database by Segment" example are successfully executed.
IDMSBCF  nn.n                                      CA IDMS Batch Command Facility                           mm/dd/yy   PAGE 6   RESTORE SEGMENT EMPDEMO; UT015006 BACKUP file created on yyyy-mm-dd-hh.mm.ss.ffffff UT000038 Starting RESTORE of area EMPDEMO.EMP-DEMO-REGION UT000040 RESTORE complete UT000038 Starting RESTORE of area EMPDEMO.INS-DEMO-REGION UT000040 RESTORE complete UT000038 Starting RESTORE of area EMPDEMO.ORG-DEMO-REGION UT000040 RESTORE complete Status = 0        SQLSTATE = 00000