DB2 Server for VSE & VM: Data Restore Guide


Using the TRANSLATE Function

Using Control Center

The steps which follow show how to TRANSLATE a database archive into a Data Restore BACKUP format using Control Center.

To invoke a TRANSLATE, select the Database Utilities Menu (U), followed by DR. Or, using fastpath, enter U.DR, from the Control Center Main Menu (see Figure 217).

Figure 217. Invoking Data Restore

+--------------------------------------------------------------------------------+
|  07.03.1997                Control Center Facility V5.1              11.57.18  |
| *--------------------------------- Main Menu --------------------------------* |
| | Option ===> u.dr                                         CTRLID: ELDBMSRV  | |
| |  Database => ELDB2B                                      NODE:   BOEVMCT1  | |
| |    *************************  DBA FUNCTIONS  ************************      | |
| |  O  Operator Commands                   C  Change CTRLCTR userid           | |
| |  S  Database Status                     P  Database Parameters             | |
| |  SI Database Startup (Immediate)        E  SQLEND Database (Menu)          | |
| |  SS Database Startup (Scheduled)        U  Database Utilities              | |
| |  A  Database Archiving (Menu)           R  Database Recovery (Menu)        | |
| |  T  Database TAPES (Menu)               M  Database Monitoring             | |
| |  V  View Message Log                    VJ View Database Job Schedule      | |
| |   ************ CONTROL CENTER ADMINISTRATOR FUNCTIONS  ***************     | |
| |  N  New Database Setup                  AU CTRLCTR Authorization           | |
| |  MS Master Schedule                     G  General CONTROL CENTER commands | |
| |  CCC   OO   NN  N TTTTT RRR    OO  L      CCC  EEEE NN  N TTTTT EEEE RRR   | |
| | CC C  O  O  NN  N   T   R  R  O  O L     CC C  E    NN  N   T   E    R  R  | |
| | C     O  O  N N N   T   R R   O  O L     C     E    N N N   T   E    R R   | |
| | C     O  O  N  NN   T   RRR   O  O L     C     EEE  N  NN   T   EEE  RRR   | |
| | CC C  O  O  N   N   T   R  R  O  O L     CC C  E    N   N   T   E    R  R  | |
| |  CCC   OO   N   N   T   R   R  OO  LLL    CCC  EEEE N   N   T   EEEE R   R | |
| |                                                                            | |
| *---------------------------------------------------------------SQMMENU------* |
|  PF:  1 Help   3 EXIT   5 What's New                                           |
+--------------------------------------------------------------------------------+

Before invoking TRANSLATE, you must first choose the archive series you wish to TRANSLATE. You must also define your translate output (disk or tape) and control files. This can be accomplished by editing the Database Tapes File.

To begin this step, type TM from the Data Restore menu as illustrated in Figure 218.

Figure 218. Choosing Archive Series and Defining TRANSLATE Tapes

+--------------------------------------------------------------------------------+
|  07.03.1997                  Control Center Facility                11.58.27   |
| *------------------------------- Data Restore Menu -------------------------*  |
| | Option ===> tm                                           CTRLID: ELDBMSRV |  |
| |    Database ===> ELDB2B                                  NODE:   BOEVMCT1 |  |
| |                                                          DRMACH: ELDB2DRF |  |
| |                                                                           |  |
| |     T  TRANSLATE ARCHIVE          TRANSLATE archive into BACKUP format    |  |
| |     U  UNLOAD DBSPACES            UNLOAD one or more dbspaces             |  |
| |     R  RELOAD TABLES              RELOAD one or more tables               |  |
| |     LL LISTLOG                    LISTLOG selection panel                 |  |
| |     AL APPLYLOG                   APPLYLOG selection panel                |  |
| |     VJ VIEW JOB SCHEDULE          VIEW database job schedule              |  |
| |     S  VIEW DRMACH STATUS         VIEW Data Restore Machine status        |  |
| |     SR RESET DRMACH STATUS        RESET Data Restore Machine status       |  |
| |     D  SHOWDBS                    Generate report about all dbspaces      |  |
| |          View Tapes   Edit Tapes    View History    View Log              |  |
| |  BACKUP      BT          BM             BH             BL                 |  |
| |  UNLOAD      UT          UM             UH             UL                 |  |
| |  TRANSLATE   TT          TM             TH             TL                 |  |
| |                                                                           |  |
| |           Enter OPTION, select DATABASE, press ENTER to process           |  |
| |                                                                           |  |
| *---------------------------------------------------------------SDRMAIN-----*  |
|  PF:   1 Help    3 End                                                         |
+--------------------------------------------------------------------------------+

From the Database TAPES File, we have chosen to TRANSLATE the archive entry (VOL100) from series 100. Next, we have added two entries for series 100 to handle the TRANSLATE process. The first entry, TRANS, must be specified for the TRANSLATE output file (either disk or tape). In our case, we have selected tape (Volid TRL200). The second entry must be disk (TRANSDSK); the filename, filetype and cuu must be provided (ELRES2 TRANSLAT 192). This file is where the Data Restore control information for SYS0001, HEADER, and DIRWORK, will be found.

Note:The series number must be the same for each archive and its associated output and control files used for the translation.

Figure 219. Database Tapes File

+--------------------------------------------------------------------------------+
|                                                                                |
|                                                                                |
|  07.03.1997                 Control Center Facility                 11.59.45   |
| *---------------------- Database  TAPES   File Update ----------------------*  |
| | Command ===>                                             CTRLID: ELDBMSRV |  |
| |  Database => ELDB2B                                      NODE:   BOEVMCT1 |  |
| |                                           VOLID/                          |  |
| | SERIES  TYPE     DATE   TIME     STATUS   FILENAME  FILETYPE  FM  SCRCUU  |  |
| |  100    ARCHIVE  97066  11:50:14 FILDEF   VOL100                          |  |
| |  100    LOG      00000  00:00:00 UNUSED   LOG100                          |  |
| |  100    LOG      00000  00:00:00 UNUSED   LOG101                          |  |
| |  100    TRANS    00000  00:00:00 UNUSED   TRL200                          |  |
| |  100    TRANSDSK 00000  00:00:00 UNUSED   ELRES2    TRANSLAT  *    192    |  |
| |  200    ARCHIVE  97066  10:54:47 FILLED   VOL200                          |  |
| |  200    LOG      97066  10:51:13 FILLED   LOG200                          |  |
| |  200    LOG      00000  00:00:00 UNUSED   LOG201                          |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |   Make changes, place D in SERIES to DELETE , press PF10 to process       |  |
| |                            Page 1     of 1                                |  |
| |                                                                           |  |
| *---------------------------------------------------------------SQMTP20-----*  |
|  PF:  1 Help   3 End    4 Add Tape   7 Bkwd     8 Fwd     10 Process updates   |
+--------------------------------------------------------------------------------+

After updating the Database Tapes File, to start the TRANSLATE function select T from the Data Restore Menu.

+--------------------------------------------------------------------------------+
|  07.03.1997                  Control Center Facility                12.01.15   |
| *------------------------------- Data Restore Menu -------------------------*  |
| | Option ===> t                                            CTRLID: ELDBMSRV |  |
| |    Database ===> ELDB2B                                  NODE:   BOEVMCT1 |  |
| |                                                          DRMACH: ELDB2DRF |  |
| |                                                                           |  |
| |     T  TRANSLATE ARCHIVE          TRANSLATE archive into BACKUP format    |  |
| |     U  UNLOAD DBSPACES            UNLOAD one or more dbspaces             |  |
| |     R  RELOAD TABLES              RELOAD one or more tables               |  |
| |     LL LISTLOG                    LISTLOG selection panel                 |  |
| |     AL APPLYLOG                   APPLYLOG selection panel                |  |
| |     VJ VIEW JOB SCHEDULE          VIEW database job schedule              |  |
| |     S  VIEW DRMACH STATUS         VIEW Data Restore Machine status        |  |
| |     SR RESET DRMACH STATUS        RESET Data Restore Machine status       |  |
| |     D  SHOWDBS                    Generate report about all dbspaces      |  |
| |          View Tapes   Edit Tapes    View History    View Log              |  |
| |  BACKUP      BT          BM             BH             BL                 |  |
| |  UNLOAD      UT          UM             UH             UL                 |  |
| |  TRANSLATE   TT          TM             TH             TL                 |  |
| |                                                                           |  |
| |           Enter OPTION, select DATABASE, press ENTER to process           |  |
| |                                                                           |  |
| *---------------------------------------------------------------SDRMAIN-----*  |
|  PF:   1 Help    3 End                                                         |
+--------------------------------------------------------------------------------+

Now the archive set to be translated needs to be specified. To view all the Archive Sets, type ALL, or press enter to see the current Archive Sets from the menu shown in Figure 220.

Figure 220. Select Archive Set for Translation

+--------------------------------------------------------------------------------+
|  07.03.1997                 Control Center Facility                 12.02.46   |
| *----------------------- Select Archive for Translation --------------------*  |
| | Command ==>                                              CTRLID: ELDBMSRV |  |
| |    Database ===> ELDB2B                                  NODE:   BOEVMCT1 |  |
| |                                                          DRMACH  ELDB2DRF |  |
| |                                                                           |  |
| |    Translate Set ===>          Archive Set for Translation                |  |
| |                             ( Blank for LATEST or ALL for all available ) |  |
| |         To TRANSLATE a database archive, you must view the Restore        |  |
| |    Set Report and select the archive set for translation.  The translate  |  |
| |    set will consist of tapes or disks from a previous database archive.   |  |
| |    You may choose ALL to display all for all available archive sets,      |  |
| |    or you may leave the translate set BLANK to retrieve the LATEST        |  |
| |    archive.                                                               |  |
| |                                                                           |  |
| |    The selected archive will be displayed, and you will be asked to       |  |
| |    enter the archive set number to begin the TRANSLATE.                   |  |
| |                                                                           |  |
| |        Enter Translate Set, press ENTER to process, or                    |  |
| |        press PF3 to QUIT                                                  |  |
| |                                                                           |  |
| *---------------------------------------------------------------SQMTR60-----*  |
|  PF:   1 Help    3 End (Quit)                                                  |
+--------------------------------------------------------------------------------+

From this menu (Figure 220), you will be placed in PEEK mode to review the Restore Set Report. This report will show the date, timestamp, series number, and the volid(s) belonging to each archive restore set.

+--------------------------------------------------------------------------------+
|RESTORE SET REPORT for Data Base ELDB2B      Date: 07.03.1997  Time: 15.36.43   |
|                                                                                |
|RESTORE SET(s) generated using LOGMODE = L                                      |
|                                                                                |
|  NOTE:  Examine the following restore set(s) and                               |
|       remember the restore set that you wish to use.                           |
|                                                                                |
|                                                                                |
|         Restore Set #1   From Data Base Archive Created 07.03.1997 15.03.11 ...|
|                                                                                |
|           Archive         Archive       Date     Time                          |
|        Type (DB or Log)   Sequence   Archived  Archived Series Volid           |
|        _________________  ________  __________ ________ ______ ______          |
|        Data Base Archive  Tape #1   07.03.1997 15.03.11   100  VOL100          |
|                                ....................................            |
|        ACTIVE Log         >>>>    Archived During The Recovery    <<<<         |
|                                                                                |
|         Restore Set #1 END ....................................................|
+--------------------------------------------------------------------------------+

The Translate Set Number specified must match the appropriate Series in the Database Tapes File. In our case, Translate Set 1 is associated with series 100, as both the Restore Set Report and Database Tapes file reflect.

Figure 221. Translate Selection Set Menu

+--------------------------------------------------------------------------------+
|  07.03.1997                 Control Center Facility                 12.04.33   |
| *-------------------------- Translate Selection Set ------------------------*  |
| | Command ==>                                              CTRLID: ELDBMSRV |  |
| |    Database ===> ELDB2B                                  NODE:   BOEVMCT1 |  |
| |                                                          DRMACH: ELDB2DRF |  |
| |                                                                           |  |
| |  Translate Set    ===> 1          Translate Set Number to Use             |  |
| |                                   (Select from the list below)            |  |
| |  TAPEPWD          ===> N          Specify a 'Y' (YES) for pass-           |  |
| |                                   word authority to be handled;           |  |
| |                                   or 'N' (NO) if READ authority           |  |
| |                                   has already been provided.              |  |
| |         ------------------ Valid Translate Sets -------------------       |  |
| |  1 (07.03.1997)                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |    Enter TRANSLATE Set and press ENTER to process, or press F3 to QUIT    |  |
| |                                                                           |  |
| *---------------------------------------------------------------SQMTR70-----*  |
|  PF:   1 Help    3 End (Quit)                                                  |
+--------------------------------------------------------------------------------+

Before submitting the TRANSLATE job, there is one last chance to cancel or quit.

Figure 222. Translate Verification

+--------------------------------------------------------------------------------+
|  07.03.1997                  Control Center Facility                12.06.13   |
| *--------------------------- Translate Verification ------------------------*  |
| | Command ==>                                              CTRLID: ELDBMSRV |  |
| |    Database ===> ELDB2B                                  NODE:   BOEVMCT1 |  |
| |                                                                           |  |
| |    This is the LAST CHANCE to CANCEL the TRANSLATE.  If you want to       |  |
| |    continue with the TRANSLATE, press ENTER, if you want to CANCEL the    |  |
| |    TRANSLATE now, press PF3.                                              |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |                                                                           |  |
| |        Press ENTER to continue with the TRANSLATE request, or             |  |
| |        press PF3 to QUIT                                                  |  |
| |                                                                           |  |
| *---------------------------------------------------------------SQMAR80-----*  |
|  PF:   1 Help    3 End (Quit)                                                  |
+--------------------------------------------------------------------------------+

After the TRANSLATE job has been submitted, its log will be available for review. To browse this log, select TL from the Data Restore Menu, shown in Figure 218.

The following Translate Log, shows the job we submitted. The TRANSLATE file created can now be used as input for either a RESTORE or RELOAD function with Control Center.

Figure 223. View Translate Log Using Control Center

 XTS9-143 * 03/07/1997               CONTROL CENTER                 15:37:43
 XTS9-143 *                         TRANSLATE ARCHIVE
 XTS9-143 * SYSIN FILE: ELDB2B TRANSYIN A
 XTS9-143 * :DBMACH= ELDB2B DRMACH= ELDB2DRF CTLMACH= SQLMSTR
 XTS9-143 * ARCHIVE: TAPE SERIES 100 FROM 07.03.1997 15.03.11
 XTS9-143 * TRANS:  TRANMEDIA
 XTS9-143 * TRANSDSK: ELRES2 SYS001/HEADER/DIRWORK G 192 121
 XTS9-143 *
 XTS9-143 * SYSPRINT DISK     ELDB2B   TRANLIST A1
 XTS9-143 * SYSIN    DISK     ELDB2B   TRANSYIN A1
 XTS9-143 * ARCHIV   TAP5  SL  00001  VOLID TRL200
 XTS9-143 * Z        DISK     DMSNAM   LOADLIB  *
 XTS9-143 * SYS0001  DISK     ELRES2   SYS0001  G1
 XTS9-143 * HEADER   DISK     ELRES2   HEADER   G1
 XTS9-143 * DIRWORK  DISK     ELRES2   DIRWORK  G1
 XTS9-143 * ARIARCH  TAP1  SL  00001  VOLID VOL100
 XTS9-143 *
 XTS9-143 * DDNAME   VOLID   FSEQ VOLSEQ GENN GENV  CRDTE  EXDTE SEC    FID
 XTS9-143 * ARCHIV   TRL200
 XTS9-143 * ARIARCH  VOL100
 XTS9-143 * **********************************************
 XTS9-143 OPTIONS CONFIRM=YES NOTATION=E LANG=S001
 XTS9-143       MSGCLASS=1 MSGDEV=3 CASE=M
 XTS9-143 CONTROL DBNAME=ELDB2B
 XTS9-143 TRANSLATE
 XTS9-143 /*
 XTS9-196 Do you want to continue the TRANSLATE process ?
 XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
 XTS9-403 Reply is 1
 XTS9-100 Data restore feature VERSION 7.1.0
 XTS9-193 Mount first tape of database server archive
 XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
 XTS9-403 Reply is 1
 XTS9-013 Table SQLDBA  .ACTIVITY           may be reloaded
 XTS9-013 Table DATARFTR.CMD                may be reloaded
 XTS9-013 Table SQLDBA  .DEPARTMENT         may be reloaded
 XTS9-013 Table SQLDBA  .DRIVER_TABLE       may be reloaded
 XTS9-013 Table SQLDBA  .ELOLANGUAGE        may be reloaded
 XTS9-013 Table SQLDBA  .ELOOPTIONS         may be reloaded
 XTS9-013 Table SQLDBA  .ELOTEXT1           may be reloaded
 XTS9-013 Table SQLDBA  .ELOTEXT2           may be reloaded
 XTS9-013 Table SQLDBA  .EMP_ACT            may be reloaded
 XTS9-013 Table SQLDBA  .EMPLOYEE           may be reloaded
 XTS9-013 Table SQLDBA  .INVENTORY          may be reloaded
 XTS9-013 Table SQLDBA  .ITEM               may be reloaded
 XTS9-013 Table SQLDBA  .ITEM1              may be reloaded
 XTS9-013 Table SQLDBA  .IXLNGVAR           may be reloaded
 XTS9-013 Table SQLDBA  .LMBRINS            may be reloaded
 XTS9-013 Table SQLDBA  .OPERATIONS         may be reloaded
 XTS9-013 Table SQLDBA  .PROJ_ACT           may be reloaded
 XTS9-013 Table SQLDBA  .PROJECT            may be reloaded
 XTS9-013 Table SQLDBA  .PROJECTS           may be reloaded
 XTS9-013 Table SQLDBA  .QUOTATIONS         may be reloaded
 XTS9-013 Table EXAMPLE .ROUTINE            may be reloaded
 XTS9-013 Table SQLDBA  .ROUTINE            may be reloaded
 XTS9-013 Table SQLDBA  .STORED QUERIES     may be reloaded
 XTS9-013 Table SQLDBA  .SUPPLIERS          may be reloaded
 XTS9-013 Table DATARFTR.SYSCATALOG         may be reloaded
 XTS9-013 Table DATARFTR.SYSCOLAUTH         may be reloaded
 XTS9-013 Table DATARFTR.SYSCOLUMNS         may be reloaded
 XTS9-013 Table DATARFTR.SYSINDEXES         may be reloaded
 XTS9-013 Table DATARFTR.SYSKEYCOLS         may be reloaded
 XTS9-013 Table DATARFTR.SYSKEYS            may be reloaded
 XTS9-013 Table SQLDBA  .SYSLANGUAGE        may be reloaded
 XTS9-013 Table DATARFTR.SYSTABAUTH         may be reloaded
 XTS9-013 Table SQLDBA  .SYSTEXT1           may be reloaded
 XTS9-013 Table SQLDBA  .SYSTEXT2           may be reloaded
 XTS9-013 Table DATARFTR.SYSUSAGE           may be reloaded
 XTS9-013 Table DATARFTR.SYSVIEWS           may be reloaded
 XTS9-007 Processing successfully completed

For more information about the TRANSLATE operation, as well as the other Data Restore functions using Control Center, refer to the appropriate chapters of the DB2 for VM Control Center Operations Guide.

Refer to Figure 224 for a sample command syntax that was used to translate a DB2 archive to a Data Restore archive format.

Figure 224. JCL File for Data Restore TRANSLATE

* $$ JOB JNM=DRFTRANS,CLASS=0,DISP=D
* $$ LST CLASS=A,DISP=D,PRI=3,DEST=(*,VSESQADM)
* $$ PUN CLASS=A,DISP=D,PRI=3,DEST=(*,VSESQADM)
// JOB DRFTRANS               TRANSLATE SQL ARCHIVE TO DRF BACKUP
// LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm.)
// TLBL     ARIARCH
// TLBL     ARCHIV
// ASSGN    SYS007,180              input tape : database manager archive
// ASSGN    SYS006,181              output tape
// MTC      REW,SYS007
// MTC      REW,SYS006
// DLBL DIRWORK,,,VSAM,CAT=VSESPUC
// DLBL SYS0001,,,VSAM,RECSIZE=4096,RECORDS=(100,100),CAT=VSESPUC
// DLBL HEADER,,,VSAM,RECSIZE=4096,RECORDS=(100,100),CAT=VSESPUC
// EXEC XTS91001,SIZE=AUTO
TRANSLATE
/*
/&
* $$ EOJ

The Data Restore TRANSLATE produces the work files, SYS0001, HEADER and DIRWORK. If you plan to RELOAD from a translated archive file, you must keep a copy of these work files in both VM and VSE. If you plan to RESTORE, these files can be destroyed after the TRANSLATE. In this case it is recommended in VSE to define these files with a retention period of zero days in order to avoid in the case of a follow-on run, the messages 4228I and 4233I, indicating that the "file already exists".

DB2 Archives

The following is an example of a function report for the TRANSLATE function on a DB2 FULL archive.



         XTS9-143 TRANSLATE
         XTS9-143 /*
         XTS9-196 Do you want to continue the TRANSLATE process ?
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
         XTS9-100 DATA RESTORE FEATURE VERSION 7.1.0
  --->   XTS9-229 The file is a DB2 FULL archive
         XTS9-193 Mount first tape of database server archive
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
         XTS9-013 Table SQLDBA  .ACTIVITY           may be reloaded
         XTS9-013 Table SQLDBA  .DEPARTMENT         may be reloaded
         XTS9-007 Processing successfully completed

The following is an example of a function report for the TRANSLATE function on a DB2 regular archive.



         XTS9-143 TRANSLATE
         XTS9-143 /*
         XTS9-196 Do you want to continue the TRANSLATE process ?
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
         XTS9-100 DATA RESTORE FEATURE VERSION 7.1.0
  --->   XTS9-229 The file is a DB2 regular archive
         XTS9-193 Mount first tape of database server archive
         XTS9-406 Enter 0(CANCEL) or 1(CONTINUE)
         XTS9-403 Reply is 1
         XTS9-013 Table SQLDBA  .ACTIVITY           may be reloaded
         XTS9-013 Table SQLDBA  .DEPARTMENT         may be reloaded
         XTS9-007 Processing successfully completed

Using the UNLOAD Function

Figure 225 shows you the statement to unload a single dbspace.

Figure 225. SYSIN File to Specify Unloading a Specific Dbspace

(1) ---> UNLOAD DBSPACE=(dbspacename)

Statement 1
Indicates that only one dbspace (dbspacename) is to be unloaded.

Unloading Multiple Dbspaces

Figure 226 shows how to list up to 90 dbspaces for unloading.

Figure 226. SYSIN File to Unload More than One Dbspace

(1) ---> UNLOAD DBSPACE =(dbspacename, dbspacename, ...)

Statement 1
Indicates that a list of dbspaces will be unloaded.

Unloading All Dbspaces Except Those Listed

Figure 227 shows how to use the COND= parameter to unload all tables except for the group listed. You can have as many as 90 tables in the list.

Figure 227. SYSIN File to Specify Excluding Dbspaces from the Unload File

(1) ---> UNLOAD DBSPACE =( dbspacename, dbspacename,...),COND=EXCLUDE

Statement 1
Lists the dbspaces that are excluded from the UNLOAD process. All other dbspaces are unloaded.

If you do not specify the COND= parameter, it defaults to INCLUDE and unloads all the tables in the list.

Unloading Multiple Dbspaces with the Server Stopped (VSE)

Figure 228 shows an example of the JCL (VSE) used to unload all dbspaces except one with the application server stopped.

Figure 228. JCL to Unload All Dbspaces But One Offline

         // JOB UNLOAD
(1) ---> // LIBDEF *,SEARCH=(PRD2.DB2vrm,PRD2.RCVvrm)
(2)  ---> // EXEC PROC=ARIS71DB
(3)  ---> // TLBL ARCHIV,'UNLOAD.DB2'
(4)  ---> // ASSGN SYS006,180
(5)  ---> // MTC REW,SYS006
(6)  ---> // EXEC XTS91001,SIZE=AUTO, PARM='DBNAME(dbname)'
(7)  ---> OPTIONS DEVICE=TAPE,REWIND=YES/NO
(8)  ---> CONTROL DBAPW=XXXXXXXX,DBNAME=dbname
(9)  ---> UNLOAD DBSPACE=(SAMPLE) COND=EXCLUDE MODE=OFFLINE
(10) ---> /*

Statement 1
Specifies the IBM DATABASE 2 Server for VSE & VM library for the UNLOAD function. You must specify the library.

Statement 2
Contains all DLBL defining 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, pointing it to the specified dbname.

Statement 7
Sets the device to a tape volume.In VSE, for UNLOAD program you can specify REWIND=YES or NO,(the default value is YES). If REWIND=NO is specified at OPEN/CLOSE time the tape will not be positioned.

Statement 8
Uses the Control statement to specify the password for the SQLDBA and identifies the dbname to be unloaded.

Statement 9
Indicates the type of UNLOAD to perform. In this case, an UNLOAD of all dbspaces except one will be performed.

Statement 10
Ends the SYSIN file.

Unloading All Dbspaces Except One With the Server Stopped (VM)

Sample of EXEC (VM) to unload all dbspaces except one with the database server stopped.

Figure 229. Procedure to Unload All Dbspace But One Offline

         /**/
(1) ---> 'FILEDEF ARCHIV TAP1 SL 1 (RECFM VB BLOCK 32760'
(2) ---> 'FILEDEF SYSPRINT DISK UNLOAD  SYSPRINT A'
(3) ---> 'FILEDEF SYSIN DISK UNLOAD SYSIN A'
(4) ---> 'XTS91001'

The SYSIN file must contain the following statements.

Figure 230. SYSIN File to Unload All Dbspaces But One Offline

(5) ---> CONTROL DBNAME=dbname DBAPW=XXXXXXXX
(6) ---> UNLOAD DBSPACE=(SAMPLE) COND=EXCLUDE MODE=OFFLINE

Statement 1
Identifies the output file.

Statement 2
Identifies the SYSPRINT file.

Statement 3
Identifies the SYSIN file.

Statement 4
Executes the program XTS91001.

Statement 5
Uses the Control statement to specify the password for the SQLDBA and identifies the dbname to be unloaded.

Statement 6
Defines the type of UNLOAD to perform. In this case, an UNLOAD of all dbspaces but one will be performed.

Make sure you can access the dbname SQLFDEF file on the database production disk when you execute Data Restore.

Make sure you LINK and ACCESS the Data Restore minidisk to execute the UNLOAD function.

Unloading Dbspaces With the Server Up

Figure 231 shows an example of a SYSIN file used to unload dbspaces with application server running.

Figure 231. SYSIN File to Unload Dbspaces Online

(1) ---> UNLOAD DBSPACE =(...),COND=xxx,MODE=ONLINE

Statement 1
Indicates that an UNLOAD will be performed while the application server is running. If the application server is not running an error occurs.

Make sure that you do  not  update dbspaces that are being unloaded while MODE=ONLINE is specified. This can result in a deadlock because of lock contention.

Because the UNLOAD function does not use SQL commands to perform the unload, the database manages the LOCK process when MODE=ONLINE is specified by issuing a LOCK DBSPACE command.

You must make sure that an an unacquired public dbspace is available when MODE=ONLINE is specified. The dbspace will be acquired (ACQUIRE PUBLIC DBSPACE command is used) and dropped (DROP DBSPACE command is used), which forces a checkpoint. The checkpoint ensures all updates to the dbspace are flushed to DASD.

Data Restore will execute a LOCK DBSPACE command in EXCLUSIVE MODE to avoid any modification on the dbspace being unloaded.

Unloading Dbspaces With the Database Server Down

Figure 232 shows an example of a SYSIN file used to unload dbspaces while the application server is down.

Figure 232. SYSIN File to Unload Dbspaces Offline

(1) ---> UNLOAD DBSPACE =(...),COND=xxx,MODE=OFFLINE

Statement 1
Indicates that the application server must be stopped before performing the unload. None of the considerations for MODE=ONLINE (Figure 231) apply here.

If the application server is running, an error occurs.

Output of an UNLOAD Function

Figure 233 shows an example of a function report.

Figure 233. Function Report for the UNLOAD Function

XTS9-143 CONTROL DBNAME=dbname
XTS9-143 UNLOAD  DBSPACE=(*)
XTS9-143 /*
XTS9-100 Data Restore feature VERSION 7.1.0
XTS9-309 Processing DB2 Server for VSE & VM version 7
XTS9-160 External labeling of this unload is
XTS9-142 Base BASE1    date 17/10/95 time 13:07:58
XTS9-013 Table SQLDBA.COST_TABLE may be reloaded
XTS9-013 Table SQLDBA.DEPARTMENT may be reloaded
XTS9-013 Table SQLDBA.EMPLOYEE may be reloaded
XTS9-013 Table SQLDBA.EMPLOYEE_ACTIVITY may be reloaded
XTS9-013 Table SQLDBA.FOREIG may be reloaded
XTS9-013 Table SQLDBA.INVENTORY may be reloaded
XTS9-013 Table SQLDBA.OPERATIONS may be reloaded
XTS9-013 Table SQLDBA.PLAN_TABLE may be reloaded
XTS9-013 Table SQLDBA.ROUTINE may be reloaded
XTS9-145 Table SQLDBA.STORED QUERIES may be reloaded
XTS9-013 Table SQLDBA.STRUCTURE_TABLE may be reloaded
XTS9-013 Table SQLDBA.SUPPLIERS may be reloaded
XTS9-013 Table SQLDBA.SYSTEXT2 may be reloaded
XTS9-013 Table SQLDBA.SYSUSERLIST may be reloaded
XTS9-006 Processing DDSK1
XTS9-005      1055 blocks saved
XTS9-006 Processing DDSK2
XTS9-005        78 blocks saved
XTS9-006 Processing DDSK3
XTS9-005         2 blocks saved
XTS9-007 Processing successfully completed

You can use the RELOAD function to reload the tables included in an UNLOAD output file. If you do not specify an owner as part of the dbspacename, the default value is PUBLIC. To unload private dbspaces, specify DBSPACE= (owner.dbspacename).

You can include an OPTIONS statement to supply more specific information to Data Restore (see OPTIONS and CONTROL Statements).

The list of reloadable tables and the number of blocks saved is displayed on the console as shown in Figure 233.

Forward log recovery is not available when restoring from unloaded dbspaces.


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