Before restoring, you need to decide if you want to restore the entire database or only the storage pools affected by a physical problem on disk.
First, determine which dbextents have been damaged, then execute the SHOWPOOL function to determine the storage pools associated with each dbextent (Refer to Chapter 15, Displaying Pool Organization for more information on the SHOWPOOL command).
Storage pool level recovery cannot be used if any of the following conditions are met:
If any of these conditions are met, then the entire database must be restored. Otherwise, only the affected storage pools need to be restored.
If you intend to use your last user archive to perform a full database RESTORE, use a job similar to the one shown in Figure 77 for VSE or Figure 78 for VM in the section Step 4A. Restoring an Entire Database Using the Last Archive.
If you intend to use your last archive to perform SPLR, use a job similar to the one shown in Figure 80 for VSE or Figure 81 for VM in the section Step 4B. Restoring Specific Storage Pools Using the Last Archive.
If you do not intend to use your last user archive to perform a full database RESTORE, use a job similar to the one shown in Figure 91 for VSE or Figure 92 for VM in the section Step 4E. Restoring Using INCREMENTAL Archive.
If you do not intend to use your last archive to perform SPLR, use a job similar to the one shown in Figure 87 for VSE or Figure 88 for VM in the section Step 4D. Restoring Specific Storage Pools Using Any Archive.
If you are in a VSE environment, restore your last archive using JCL similar to that in Figure 77.
Figure 77. Sample of JCL (VSE) to Restore an Entire Database from the Last Archive
// JOB RESTORE
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // EXEC PROC=ARIS71DB
(3) ---> // TLBL ARCHIV,'ARCHIVE.DB2',,,1
(4) ---> // ASSGN SYS006,180
(5) ---> // MTC REW,SYS006
(6) ---> // EXEC XTS91001,SIZE=AUTO
(7) ---> CONTROL DBNAME=dbname
(8) ---> RESTORE
(9) ---> /*
If you are in a VM environment, restore your last archive using an EXEC similar to that in Figure 78.
Figure 78. Sample of JCL (VM) to Restore an Entire Database from the Last Archive
/**/
(1) ---> 'VMFPLC2 REW'
(2) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(3) ---> 'FILEDEF SYSPRINT DISK RESTORE SYSPRINT A'
(4) ---> 'FILEDEF SYSIN DISK RESTORE SYSIN A'
(5) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 79. Sample of SYSIN to Restore an Entire Database from the Last Archive
(6) ---> CONTROL DBNAME=dbname
(7) ---> RESTORE
Make sure that you can access the dbname SQLFDEF file on the database production disk when you use Data Restore.
Use the LINK command and the ACCESS command to access the Data Restore minidisk to execute the RESTORE function.
Figure 80. Sample of JCL (VSE) to Restore a List of Storage Pools from the Last Archive
// JOB RESTORE
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // EXEC PROC=ARIS71DB
(3) ---> // TLBL ARCHIV,'ARCHIVE.DB2',,,1
(4) ---> // DLBL DIRWORK,,,VSAM
(5) ---> // ASSGN SYS006,180
(6) ---> // MTC REW,SYS006
(7) ---> // EXEC XTS91001,SIZE=AUTO
(8) ---> CONTROL DBNAME=dbname
(9) ---> RESTORE POOL=(n, m, ...)
(10)---> /*
If you are in a VM environment, restore your last archive using an EXEC similar to that in Figure 81.
Figure 81. Sample of JCL (VM) to Restore a List of Storage Pools from the Last Archive
/**/
(1) ---> 'VMFPLC2 REW'
(2) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(3) ---> 'FILEDEF DIRWORK DISK DIRWORK DATA H(RECFM F BLOCK 512'
(4) ---> 'FILEDEF SYSPRINT DISK RESTORE SYSPRINT A'
(5) ---> 'FILEDEF SYSIN DISK RESTORE SYSIN A'
(6) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 82. Sample of SYSIN to Restore a List of Storage Pools from the Last Archive
(7) ---> CONTROL DBNAME=dbname
(8) ---> RESTORE POOL=(n, m, ...)
Make sure that you can access the dbname SQLFDEF file on the database production disk when you use Data Restore.
Use the LINK command and the ACCESS command to access the Data Restore minidisk to execute the RESTORE function.
At this point, you have restored the database or the storage pools.
If you are in a VSE environment, restore your archive using a job similar to that shows in Figure 83.
Figure 83. Sample of JCL (VSE) to Restore an Entire Database from Any Archive
// JOB RESTORE
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // EXEC PROC=ARIS71DB
(3) ---> // TLBL ARCHIV,'ARCHIVE.DB2',,,1
(4) ---> // ASSGN SYS006,180
(5) ---> // MTC REW,SYS006
(6) ---> // EXEC XTS91001,SIZE=AUTO
(7) ---> CONTROL DATE=20/09/95 TIME=18:05:12, DBNAME=dbname
(8) ---> RESTORE
(9) ---> /*
If you are in a VM environment, restore your archive using an EXEC similar to that in Figure 84.
Figure 84. Sample of Procedure (VM) to Restore an Entire Database from Any Archive
/**/
(1) ---> 'VMFPLC2 REW'
(2) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(3) ---> 'FILEDEF SYSPRINT DISK RESTORE SYSPRINT A'
(4) ---> 'FILEDEF SYSIN DISK RESTORE SYSIN A'
(5) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 85. Sample of SYSIN to Restore an Entire Database from Any Archive
(6) ---> CONTROL DBNAME=dbname DATE=20/09/95 TIME=18:05:12
(7) ---> RESTORE
Make sure that you can access the dbname SQLFDEF file on the database production disk when you use Data Restore.
Use the LINK command and the ACCESS command to access the Data Restore minidisk to execute the RESTORE function.
When you finish restoring the database, you see a list of all messages issued similar to the report shown in Figure 86.
Figure 86. Example of a Function Report After a Database Is Restored
XTS9-143 CONTROL DBNAME=dbname
XTS9-143 RESTORE
XTS9-143 /*
XTS9-100 Data Restore feature VERSION 7.1.0
XTS9-304 Restore from user archive invoked
XTS9-305 Current database will be destroyed
XTS9-196 Do you want to continue the RESTORE process ?
XTS9-406 Enter 0(Cancel) OR 1(Continue)
1
XTS9-136 Processing dbname archived on (17/10/95-12:12:49)
XTS9-010 Restoring DIRECTORY
XTS9-024 20010 Directory blocks restored
XTS9-011 Restoring DDSK1
XTS9-025 2870 blocks restored
XTS9-011 Restoring DDSK2
XTS9-025 383 blocks restored
XTS9-011 Restoring DDSK3
XTS9-025 7 blocks restored
XTS9-011 Restoring DDSK4
XTS9-025 1 block restored
XTS9-011 Restoring DDSK5
XTS9-025 1 block restored
XTS9-011 Restoring DDSK6
XTS9-025 1 block restored
XTS9-011 Restoring DDSK7
XTS9-025 1 block restored
XTS9-011 Restoring DDSK8
XTS9-025 1 block restored
XTS9-307 Startup the database manager with parameter "STARTUP=U"
XTS9-007 Processing successfully completed
If you are in a VSE environment, restore your archive using a job similar to that shown in Figure 87.
Figure 87. Sample of JCL (VSE) to Restore a List of Storage Pools from Any Archive
// JOB RESTORE
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // EXEC PROC=ARIS71DB
(3) ---> // TLBL ARCHIV,'ARCHIVE.DB2',,,1
(4) ---> // DLBL DIRWORK,,,VSAM
(5) ---> // ASSGN SYS006,180
(6) ---> // MTC REW,SYS006
(7) ---> // EXEC XTS91001,SIZE=AUTO
(8) ---> CONTROL DATE=20/09/95 TIME=18:05:12, DBNAME=dbname
(9) ---> RESTORE POOL=(n, m, ...)
(10)---> /*
If you are in a VM environment, restore your archive using an EXEC similar to that in Figure 88.
Figure 88. Sample of Procedure (VM) to Restore a List of Storage Pools from Any Archive
/**/
(1) ---> 'VMFPLC2 REW'
(2) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(3) ---> 'FILEDEF DIRWORK DISK DIRWORK DATA H(RECFM F BLOCK 512'
(4) ---> 'FILEDEF SYSPRINT DISK RESTORE SYSPRINT A'
(5) ---> 'FILEDEF SYSIN DISK RESTORE SYSIN A'
(6) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 89. Sample of SYSIN to Restore a List of Storage Pools from Any Archive
(7) ---> CONTROL DBNAME=dbname DATE=20/09/95 TIME=18:05:12
(8) ---> RESTORE POOL=(n, m, ...)
Make sure that you can access the dbname SQLFDEF file on the database production disk when you use Data Restore.
Use the LINK command and the ACCESS command to access the Data Restore minidisk to execute the RESTORE function.
When you finish restoring some storage pools, you see a list of all messages issued similar to the report shown in Figure 90.
Figure 90. Example of a Function Report After Some Storage Pools are Restored
XTS9-143 CONTROL DBNAME=dbname
XTS9-143 RESTORE POOL=2
XTS9-143 /*
XTS9-196 Do you want to continue the RESTORE process ?
XTS9-406 Enter 0(Cancel) OR 1(Continue)
XTS9-403 Reply is 1
XTS9-136 Processing dbname archived on (11/06/96-17:06:37)
XTS9-182 Following files are needed for recovery
XTS9-195 UARCHIVE currently mounted
XTS9-179 Current log
XTS9-406 Enter 0(Cancel) OR 1(Continue)
XTS9-403 Reply is 1
XTS9-211 Beginning update of directory
XTS9-406 Enter 0(Cancel) OR 1(Continue)
XTS9-403 Reply is 1
XTS9-006 Processing DDSK2
XTS9-010 383 blocks restored
XTS9-307 Startup the database manager with parameter "STARTUP=U"
XTS9-007 Processing successfully completed
The following examples are processing the restore of an entire database but the restore of specific storage pools can also be processed.
Figure 91. Sample of JCL (VSE) to Restore an Entire Database from Any Archive
// JOB RESTORE
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2) ---> // EXEC PROC=ARIS71DB
(3) ---> // TLBL ARCHIV,'ARCHIVE.DB2',,,1
(4) ---> // TLBL FULLARC,'ARCHIVE.DB2',,,1
(5) ---> // ASSGN SYS006,180
(6) ---> // MTC REW,SYS006
(7) ---> // EXEC XTS91001,SIZE=AUTO
(8) ---> // OPTIONS DEVICE2=TAPE
(9) ---> CONTROL DATE=20/09/95 TIME=18:05:12, DBNAME=dbname
(10) ---> RESTORE
(11) ---> /*
If you are in a VM environment, restore your archive using an EXEC similar to that in Figure 92.
Figure 92. Sample of Procedure (VM) to Restore an Entire Database from Any Archive
/**/
(1) ---> 'VMFPLC2 REW'
(2) ---> 'FILEDEF FULLARC TAP1 SL 1 (RECFM VB BLOCK 3260'
(3) ---> 'FILEDEF SYSPRINT DISK RESTORE SYSPRINT A'
(4) ---> 'FILEDEF SYSIN DISK RESTORE SYSIN A'
(5) ---> 'XTS91001'
The SYSIN file must contain the following statements:
Figure 93. Sample of SYSIN to Restore an Entire Database from Any Archive
(6) ---> CONTROL DBNAME=dbname DATE=20/09/95 TIME=18:05:12
(7) ---> RESTORE
Make sure that you can access the dbname SQLFDEF file on the database production disk when you use Data Restore.
Use the LINK command and the ACCESS command to access the Data Restore minidisk to execute the RESTORE function.
When you finish restoring the database, you see a list of all messages issued similar to the report shown in Figure 94.
Figure 94. Example of a Function Report After a Database Is Restored
XTS9-143 CONTROL DBNAME=dbname
XTS9-143 RESTORE
XTS9-143 /*
XTS9-100 Data Restore feature VERSION 7.1.0
XTS9-304 Restore from user archive invoked
XTS9-305 Current database will be destroyed
XTS9-196 Do you want to continue the RESTORE process ?
XTS9-406 Enter 0(Cancel) OR 1(Continue)
1
XTS9-136 Processing dbname archived on (17/10/95-12:12:49)
XTS9-010 Restoring DIRECTORY
XTS9-024 20010 Directory blocks restored
XTS9-011 Restoring DDSK1
XTS9-025 2870 blocks restored
XTS9-011 Restoring DDSK2
XTS9-025 383 blocks restored
XTS9-011 Restoring DDSK3
XTS9-025 7 blocks restored
XTS9-011 Restoring DDSK4
XTS9-025 1 block restored
XTS9-011 Restoring DDSK5
XTS9-025 1 block restored
XTS9-011 Restoring DDSK6
XTS9-025 1 block restored
XTS9-011 Restoring DDSK7
XTS9-025 1 block restored
XTS9-011 Restoring DDSK8
XTS9-025 1 block restored
XTS9-307 Startup the database manager with parameter "STARTUP=U"
XTS9-007 Processing successfully completed