DB2 Server for VSE & VM: Control Center Operations Guide for VM


Chapter 21. Data Restore UNLOAD


Overview

The Data Restore UNLOAD function allows the user to unload one or many DBSPACES with the database up or down. It is different from the DBSU UNLOAD utility which is used in Control Center for DBSPACE reorganizations. The Data Restore UNLOAD does not unload DBSPACE table records in key order.

When the tables are reloaded using Data Restore, the tables are not reorganized. The DBSU and Data Restore unload formats are not compatible with each other.

However, because Data Restore unloads the active pages in the DBSPACE, it provides a faster unload than DBSU and can be used to provide a backup of critical DBSPACES. Data Restore UNLOAD unloads DBSPACES and Data Restore RELOAD reloads tables. Tables can later be recovered from either a Data Restore BACKUP, TRANSLATE, or UNLOAD.

Control Center will give the user a way to unload and store DBSPACES for later use.


How the UNLOAD Tool Works

An UNLOAD may be desired to provide a temporary backup for a DBSPACE before changing its tables. Or, a DBSPACE may be unloaded as part of a regular backup strategy for vital system tables.

To manage the different size and frequency requirements for unloading DBSPACES, Control Center will use an UNLOAD ID (UNLOAD identification name) to |identify each unload event. The UNLOAD ID is an eight (8) character name that will be used in the database UNLTAPES file to identify which files or tapes are to be used with a particular unload event. The UNLOAD ID will be used to identify the file (unloadid UNLDDBSP) which will contain the list of DBSPACES to unload. The UNLOAD ID will also be used in the UNLDHIST file to refer to the unload event that has completed.

To set up an UNLOAD event, the DBA will use the Control Center menu interface to select which DBSPACES to unload, the file or tapes to use, a unique UNLOAD ID that will be used to identify which output media to use, and the Data Restore values to use in the SYSIN file.

Data Restore allows you to UNLOAD a maximum of 90 DBSPACES. All the DBSPACES selected must fit on a maximum ten (10) lines of the SYSIN file. This is a Data Restore restriction. In practice, it will not be possible to fit 90 DBSPACES on 10 lines unless all the DBSPACE owners are "PUBLIC" and the DBSPACEnames are very short.

At execution time, the Data Restore machine will perform necessary FILEDEFS and LABELDEFS, create the SYSIN file, and execute the Data Restore UNLOAD routine (XTS91001 MODULE). The file or tape output will be recorded in the database UNLDHIST file, and the SYSPRINT file appended to the database UNLDDESC (unload description) file.

The unloaded DBSPACE tables can later be reloaded using the RELOAD tool.

UNLOAD Control and OUTPUT files

The basic files created will be:

Filename
Description

unloadid UNLDDBSP
If more than one DBSPACE is selected, this file will contain a formatted list of the DBSPACES that will be used in the SYSIN file. The file is kept on the Control Center service machine and will be used each time the UNLOAD ID job is executed.

dbmach UNLDSYIN
The SYSIN file created on the Data Restore machine to execute the UNLOAD. This file contains the Data Restore commands and options to be executed, and additional information provided by Control Center.

dbmach UNLDLIST
The output listing of the UNLOAD created by Data Restore This file will list all the tables that were unloaded, and shows the same table list as you would see in the SYSPRINT for a DESCRIBE function. All SYSIN data is reproduced in the listing file.

dbmach UNLDLOG
A log of the current UNLOAD. The file is maintained on the Control Center service machine. A backup will be made of the previous UNLDLOG file.

dbmach UNLDDESC
A copy of the UNLDLIST (SYSPRINT) file for every successful UNLOAD will be appended to the UNLDDESC file. This file will maintain every UNLOAD performed on the database. Periodically, the file will have to be edited to reduce its size. This can be done by using the filelist option on the Control Center General Utilities menu. (SQM =g.f dbmach UNLDDESC).

UNLOAD ERROR
If errors occur before, during, or after execution of the UNLOAD on the Data Restore machine, the ERROR file will indicate the type of error. If an error condition was detected during processing, then the name of the module and the approximate line number of the error will be presented. The ERROR file is sent to all database administrators listed in the specific database PARMS file.

Input and Output Media Processing

The output media (unloaded DBSPACE tables) is determined by the selection made on the set up panels. The media selected (DISK/TAPE/SCRATCH) must match the media type represented in the UNLTAPES file. If SCRATCH is selected, then the tapes listed in the UNLTAPES file will not be re-used. New SCRATCH tapes will be requested.

The UNLOAD (ARCHIV) tape will use cuu 181.


Database UNLTAPES File

The UNLTAPES file is different from other Control Center tapes files. The differences are discussed in the following sections.

UNLOAD ID

Instead of "TYPE", referring to the type of operation the media will be used for (for example, "ARCHIVE", "LOG", "BACKUP"), this entry will identify the unique name assigned by the user for the UNLOAD event. It is critical that this UNLOAD ID be the exact name as indicated in the set up panels. Control Center will use this name when requesting tapes to be used in FILEDEF, LABELDEF, and tape mount operations.

UNLOAD Series

In the UNLTAPES file, it is not necessary to have more than one series of output media listed for the UNLOAD ID. If you only wish to maintain one level of DBSPACE backup, then your UNLOAD ID should be listed in series 100 only.

However, if you wish to keep multiple levels of backups for a DBSPACE, the UNLOAD ID may have multiple series (100, 200, 300, and so on), with each series using different VOLID or file names. If more than one series is defined for an UNLOAD ID, Control Center will cycle through each series until it starts back at series 100 again.

If output is to disk, then the previous file will be overwritten. If you change the file name of your output, be sure that there is enough space on the disk to hold the new file.

For disk output, the cuu indicated MUST be the link address on the Data Restore machine where the output will be written. The disk should not be linked and accessed prior to execution. Control Center will link to this address using the first available access cuu starting at "120". The first free filemode will be used. If the operation ends normally, the disk will be detached.

UNLOAD Tapes

Sometimes you will want to unload a DBSPACE to temporary storage until another operation is complete. You can define an UNLOAD ID that can be used many times to hold different DBSPACES. Each UNLOAD using this UNLOAD ID will overwrite the previous data.

Figure 119 is an example of the database UNLTAPES file entries required to process different unloads.

Figure 119. Example of UNLTAPES file entries for UNLOAD

100  UNLOAD1  97003  11:41:49 FILLED UNLD1100 DB2VM510 * 400
100  UNLOAD2  97003  10:57:08 FILLED VB3073
100  UNLOAD3  96364  13:51:42 FILLED VB3075
100  WORKDISK 97008  12:43:44 FILLED TEMP100 DB2VM510 * 403
200  UNLOAD1  97006  12:31:21 FILLED UNLD1200 DB2VM510 * 400
200  UNLOAD2  97010  14:29:09 FILLED VB3074
300  UNLOAD2  97017  14:29:09 FILLED VB3078


Passwords

UNLOAD requires the database password for user SQLDBA in the "DBAPW=" SYSIN file control statement.

If database disks are password protected, UNLOAD requires the "READ" password for all of the database disks in the "READPW=" SYSIN file control statement.

A password file (drmach LINKPWDS) file is required. Refer to Appendix C, Password Support for instructions of how to implement Data Restore password support.


How to Invoke UNLOAD

To invoke UNLOAD, select Option U from the Data Restore Menu. The first entry panel of the UNLOAD tool is shown in Figure 120.

Figure 120. Data Restore UNLOAD Panel

+--------------------------------------------------------------------------------+
| mm/dd/yyyy                      CONTROL CENTER                      hh:mm:ss   |
|*------------------------------- UNLOAD Utility -----------------------------*  |
||                                                           CTRLID: MSTRV1   |  |
|| Database ==> SQLDBA                                       NODE:   VMSYSTM1 |  |
||                                                           DRMACH: DREST1   |  |
|| Select DBSPACES ==> 2 (1= *, 2= Search List)                               |  |
||                       (3= Input file, 4= Type in one dbspace)              |  |
||                                                                            |  |
||    DBSPACE OWNER ==> ________  (blank for ALL, PUBLIC, PRIVATE, ownername) |  |
||    DBSPACE NAME  ==> _________________ (blank for ALL, use % for wildcard) |  |
||    DBSPACE PAGES:  MINIMUM ==> 1       MAXIMUM    ==> 9999999              |  |
||    STORPOOL      ==> ____            (blank for ALL Pools or specific pool |  |
||                                                                            |  |
||                                                                            |  |
||    DBSPACE INPUT FILE ==> ___________________ Filename, filetype, filemode |  |
||                                                                            |  |
||                                                                            |  |
||       The % SQL wildcard character can be used when specifying the         |  |
||       Dbspace Owner or Dbspace Name values for selection.                  |  |
||                                                                            |  |
|*---------------------------------------------------------------DRUNLD2------*  |
| PF1 HELP    PF3 QUIT    PF4 EXIT    PF5 Main Menu    Enter Retrieve List       |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

On this panel, you will tell Control Center what DBSPACES you wish to unload. If you choose to type the name of one DBSPACE, or to unload all DBSPACES('*'), you will be required to select the media, mode, and condition options.

Data Restore UNLOAD Options

Parameter
Description

Select DBSPACES
Used to specify how you wish to enter the name or names of DBSPACES to be unloaded.

Dbspace Owner
A valid DBSPACE owner. If Option 2 is used, then the owner can contain wildcards, or be "PRIVATE" for all private DBSPACES, or be left blank for "ALL" owners.

Dbspace Name
A valid DBSPACE name. If Option 2 is used, then the name can contain wildcards, or be left blank for "ALL" DBSPACEnames.

Pages
A valid minimum and maximum NPAGES to consider.

STORPOOL
A valid storage pool number. Include a minus sign (-) for non-recoverable pools.

If you choose DBSPACE selection Option 2 from the UNLOAD Dbspace Utility Menu, you will be presented with a list of the DBSPACES that match your selection criteria. You may UNLOAD a maximum of 90 DBSPACES; all the DBSPACES selected must fit on a maximum ten (10) lines of the SYSIN file. This is a Data Restore restriction.

You may eliminate DBSPACES from your list by indicating "O" on the left hand input line of the list panel. Control Center will build the SYSIN DBSPACE list for you. If the DBSPACES you selected will not fit on ten lines, or if you have more than 90 DBSPACES, you will be returned to the DBSPACE list panel.

The number of DBSPACES selected is indicated in the Selected DBSPACES field in the upper right hand corner of the panel. The Select UNLOAD DBSPACES panel is shown in Figure 121, and the OMIT DBSPACE Option O has been specified.

Figure 121. Select Unload Dbspaces Panel

+--------------------------------------------------------------------------------+
| mm/dd/yyyy                      CONTROL CENTER                      hh:mm:ss   |
|*--------------------------- Select Unload Dbspaces -------------------------*  |
||  Database => SQLDBA              Selected DBSPACES => 7                    |  |
||                                 PCTFREE  PCT                               |  |
|| SEL OWNER     NAME              ACQ ALT  INDX  POOL  NPAGES   NACTIVE      |  |
|| --- -------- ------------------ -------  ----  ---- --------  -------      |  |
||   _  D128980  DUKE_BIGTEST        10   0    10    -8    40960    16660     |  |
||   O  PUBLIC   BDGT_MSTRCA_DBS     10   0     5     6    20480       -1     |  |
||   _  PUBLIC   DATARFTR            10   0    33     4     6400       32     |  |
||   _  PUBLIC   DUKE_BIGTEST        10   0    30     6    40960    18124     |  |
||   _  PUBLIC   HELPTEXT            10   0    33     1     8192     1190     |  |
||   _  PUBLIC   SAMPLE              10   0    33     6    40960        4     |  |
||   _  PUBLIC   SORTA_BIG           10   0     5     6    20480       -1     |  |
||   _  SQMDEMO3 DUKE_BIGTEST        10   0    30    -8    40960    18369     |  |
||                                                                            |  |
||                                                                            |  |
||                                                                            |  |
||  Select:  O = Omit Dbspace                                                 |  |
||                                                                            |  |
||                              Page 1     of 1                               |  |
|*---------------------------------------------------------------DRUNLD3------*  |
|1 Help         3 QUIT         5 Continue                                        |
|9 Sort/Name   10 Sort/Nact   11 Sort/Pages   12 Sort/Pool                       |
|                                                                                |
+--------------------------------------------------------------------------------+

The menu which follows (Figure 122) is where the UNLTAPES (UNLOAD TAPES) file can be selected or updated. You must either verify the UNLOAD ID, series, media (file/tapes) to be used for the UNLOAD, or create a new entry for your unload.

Figure 122. Database UNLTAPES File Update Panel

+--------------------------------------------------------------------------------+
| mm/dd/yyyy                      CONTROL CENTER                     hh:mm:ss    |
|*----------------------- Database UNLTAPES File Update ---------------------*   |
|| Command ===>                                             CTRLID: MSTSRV1  |   |
||  Database => SQLDBA                                        NODE: VMSYSTM1 |   |
||                                           VOLID/                          |   |
|| SERIES  TYPE     DATE   TIME     STATUS   FILENAME  FILETYPE  FM  ADDRESS |   |
||  100    UNLOAD1  97003  11:41:49 FILLED   UNLD1100  DB2VM510   *   400    |   |
||  100    UNLOAD2  97003  10:57:08 FILLED   VB3073                          |   |
||  100    UNLOAD3  96364  13:51:42 FILLED   VB3075                          |   |
||  100    WORKDISK 97008  12:43:44 FILLED   TEMP100   DB2VM510   *   403    |   |
||  200    UNLOAD1  97006  12:31:21 FILLED   UNLD1200  DB2VM510   *   400    |   |
||  200    UNLOAD2  97010  14:29:09 FILLED   VB3074                          |   |
||  200    UNLOAD3  96334  17:25:17 FILLED   VB3076                          |   |
||  300    UNLOAD2  97017  14:29:09 FILLED   VB3078                          |   |
||                                                                           |   |
||                                                                           |   |
||                                                                           |   |
||                                                                           |   |
||   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    |
|                                                                                |
+--------------------------------------------------------------------------------+

From the panel below, you will decide whether to execute or to schedule the UNLOAD. You must also specify UNLOAD ID for the UNLOAD, who to notify, and make any necessary changes in the SYSIN options.

Figure 123. UNLOAD Execution Panel

+--------------------------------------------------------------------------------+
|  mm/dd/yyyy                      Control Center                      hh:mm:ss  |
| *-------------------------  DRF UNLOAD EXECUTION   --------------------------* |
| |  DATABASE ==> SQLDBA                                      CTRLID: MSTRSRV1 | |
| |                                                           NODE:   VMSYSTM1 | |
| |                                                                            | |
| | Execution       ==> 1            ( 1= Schedule, 2 = Execute Immediately    | |
| |                                                                            | |
| | UNLOAD ID       ==> ________     (Unique name for UNLOAD job )             | |
| |  The Unload Id will indicate which disk or tape set to be used.            | |
| |  The Unload ID MUST be the same as the ID used in the UNLTAPES file.       | |
| |                                                                            | |
| |                                                                            | |
| | NOTIFY ==> ________  (Userid)   ________   (Node )                         | |
| |                                                                            | |
| | MEDIA  ==> 1        ( 1= DISK,    2= Predefined TAPE, 3= SCRATCH Tape)     | |
| | MODE   ==> 1        ( 1= Online,  2= Offline )                             | |
| | COND   ==> 1        ( 1= Include, 2= Exclude )                             | |
| | WRKSIZE => 2048     ( Npages * 5 / 1024, default = 2048)                   | |
| |                                                                            | |
| |                                                                            | |
| *----------------------------------------------------------------DRUNLD4----*  |
|   PF1 HELP   PF3 QUIT     PF4 Modify/View UNLTAPES file     ENTER  Execute     |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Parameter
Description

Execution
Used to specify whether to (2) execute the unload immediately or (1) schedule for later execution. If schedule is selected, you will be presented with the scheduling panel.

UNLOAD ID
Unique name that will identify the unload. The name can be a maximum of 8 characters.

NOTIFY
Userid and NODE of person to notify when the UNLOAD is successful.

Media Type
Choose disk, pre-defined tapes, or SCRATCH tapes. If disk or pre-defined tapes are chosen, the entries in the database UNLTAPES must match the media type selected. If SCRATCH tape is selected, the tapes defined in the database UNLTAPES file will be replaced with the new SCRATCH tapes used. You will have the option of changing media on the last panel.

MODE
The MODE is the Data Restore UNLOAD SYSIN file command option "MODE=" which indicates whether the database will be running when the UNLOAD is executed. Select ONLINE (1) if the database will be running when the UNLOAD is performed. Select OFFLINE (2) if the database will not be running when the UNLOAD is performed. The default is ONLINE.

COND
The condition is the Data Restore UNLOAD SYSIN file command option "COND=", which indicates if the list of DBSPACES in the SYSIN file will be unloaded or excluded. INCLUDE (1) indicates that the list of DBSPACES will be unloaded. EXCLUDE (2) indicates that all DBSPACES except for those listed will be unloaded. EXCLUDE is not valid with the "*" DBSPACES selection option. The default is INCLUDE.

WRKSIZE
The WRKSIZE if the Data Restore UNLOAD SYSIN file command option "WRKSIZE=", which indicates the work size value to use for the UNLOAD. The default is 2048.

After the UNLOAD

The database UNLDHIST file will be updated with the file or tapes that were produced for the UNLOAD and the date and time stamps of the UNLOAD.

If the UNLOAD was successful, the UNLDLIST (SYSPRINT) file will be sent to the Control Center service machine. This file will be appended to the database UNLDDESC (unload describe) file to provide a running record of all successful unloads. When this becomes too large, it can be manually edited to remove old entries by using the General Utilities Filelist tool (SQM =G.F * UNLDDESC).


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