DB2 Server for VSE & VM: Data Restore Guide


Step 4. Starting the RESTORE Function

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.

Step 4A. Restoring an Entire Database Using the Last 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) ---> /*

Statement 1
Specifies the DB2 for VSE for the RESTORE function.

Statement 2
Contains all DLBL defining the directory, log, and all dbextents.

Statement 3
Identifies the label on the tape.

Statement 4
Assigns a specific tape drive that will be used.

Statement 5
Rewinds the tape to its first file.

Statement 6
Executes the program XTS91001.

Statement 7
CONTROL statement specifying the dbname to control compatibility with BACKUP tape provided

Statement 8
Specifies the function to be performed. In this case, the RESTORE function.

Statement 9
Ends the SYSIN file.

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'

Statement 1
Rewinds the tape to its first file.

Statement 2
Identifies the file on the tape.

Statement 3
Specifies the destination of the SYSPRINT file.

Statement 4
Identifies the input source for the RESTORE function on SYSIN.

Statement 5
Executes the program 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

Statement 6
Points the user to the appropriate database.

Statement 7
Specifies the function to be performed; in this case, the RESTORE function.

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.

Step 4B. Restoring Specific Storage Pools Using the Last Archive

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)---> /*

Statement 1
Specifies the DB2 for VSE library for the RESTORE function.

Statement 2
Contains all DLBL defining the directory, log, and all dbextents.

Statement 3
Identifies the label on the tape.

Statement 4
Identifies the DIRWORK work file.

Statement 5
Assigns a specific tape drive that will be used.

Statement 6
Rewinds the tape to its first file.

Statement 7
Executes the program XTS91001.

Statement 8
CONTROL statement specifying the dbname to control compatibility with BACKUP tape provided

Statement 9
Specifies the function to be performed. In this case, the RESTORE function for some storage pools (maximum 10 pools).

Statement 10
Ends the SYSIN file.

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'

Statement 1
Rewinds the tape to its first file.

Statement 2
Identifies the file on the tape.

Statement 3
Identifies the DIRWORK work file.

Statement 4
Specifies the destination of the SYSPRINT file.

Statement 5
Identifies the input source for the RESTORE function on SYSIN.

Statement 6
Executes the program 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, ...)

Statement 7
Points the user to the appropriate database.

Statement 8
Specifies the function to be performed; in this case, the RESTORE function for some storage pools (maximum 10 pools).

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.

Step 4C. Restoring an Entire Database Using Any Archive

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) ---> /*

Statement 1
Specifies the DB2 Server for VSE & VM library for the RESTORE function.

Statement 2
Contains all the DLBL defining the directory, log, and all dbextents.

Statement 3
Identifies the label on the tape.

Statement 4
Assigns a specific tape drive that will be used.

Statement 5
Rewinds the tape to its first file.

Statement 6
Executes the program XTS91001.

Statement 7
Specifies instructions to the RESTORE function of Data Restore, for example, date and time. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 8
Specifies the function to be performed. In this case, the RESTORE function.

Statement 9
Ends the SYSIN file.

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'

Statement 1
Rewinds the tape to its first file.

Statement 2
Identifies the file on the tape.

Statement 3
Specifies the destination of the SYSPRINT file.

Statement 4
Identifies the input source for the DESCRIBE function.

Statement 5
Executes the program 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

Statement 6
Specifies instructions for the RESTORE function of Data Restore; for example, date and time of the archives. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 7
Specifies the function to be performed; in this case, the RESTORE function.

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

Step 4D. Restoring Specific Storage Pools Using Any Archive

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)---> /*

Statement 1
Specifies the DB2 for VSE library for the RESTORE function.

Statement 2
Contains all the DLBL defining the directory, log, and all dbextents.

Statement 3
Identifies the label on the tape.

Statement 4
Identifies the DIRWORK work file.

Statement 5
Assigns a specific tape drive that will be used.

Statement 6
Rewinds the tape to its first file.

Statement 7
Executes the program XTS91001.

Statement 8
Specifies instructions to the RESTORE function of Data Restore, for example, date and time. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 9
Specifies the function to be performed. In this case, the RESTORE function for some storage pools (maximum 10 pools).

Statement 10
Ends the SYSIN file.

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'

Statement 1
Rewinds the tape to its first file.

Statement 2
Identifies the file on the tape.

Statement 3
Identifies the DIRWORK work file.

Statement 4
Specifies the destination of the SYSPRINT file.

Statement 5
Identifies the input source for the DESCRIBE function.

Statement 6
Executes the program 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, ...)

Statement 7
Specifies instructions for the RESTORE function of Data Restore; for example, date and time of the archives. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 8
Specifies the function to be performed; in this case, the RESTORE function.

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

Step 4E. Restoring Using INCREMENTAL Archive

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) ---> /*

Statement 1
Specifies the DB2 Server for VSE & VM library for the RESTORE function.

Statement 2
Contains all the DLBL defining the directory, log, and all dbextents.

Statement 3
Identifies the label on the tape.

Statement 4
Identifies the label of the FULL archive.

Statement 5
Assigns a specific tape drive that will be used.

Statement 6
Rewinds the tape to its first file.

Statement 7
Executes the program XTS91001.

Statement 8
The OPTIONS statement specifies, if the FULLARC is on tape or DASD.

Statement 9
Specifies instructions to the RESTORE function of Data Restore, for example, date and time. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 10
Specifies the function to be performed. In this case, the RESTORE function.

Statement 11
Ends the SYSIN file.

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'

Statement 1
Rewinds the tape to its first file.

Statement 2
Identifies the file on the tape.

Statement 3
Specifies the destination of the SYSPRINT file.

Statement 4
Identifies the input source for the DESCRIBE function.

Statement 5
Executes the program 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

Statement 6
Specifies instructions for the RESTORE function of Data Restore; for example, date and time of the archives. For more information about what date and time to specify, see Chapter 13, Displaying the Contents of an Archive File.

Statement 7
Specifies the function to be performed; in this case, the RESTORE function.

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


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]