< Day Day Up > |
The MERGECOPY UtilityThe MERGECOPY utility combines multiple incremental image copy data sets into a new full or incremental image copy data set. See Listing 32.5 for sample JCL. The first control card depicts the merging of image copy data sets for the DSN8D81A.DSN8S81D table space into a full image copy. The second control card shows statements that create a new incremental image copy data set for the DSN8D81A.DSN8S81E table space. Listing 32.5. MERGECOPY JCL//DB2JOBU JOB (UTILITY), 'MERGECOPY',CLASS=X,MSGCLASS=X,NOTIFY=USER //* //**************************************************************** //* //* DB2 MERGECOPY UTILITY //* //**************************************************************** //* //COPY EXEC DSNUPROC,SYSTEM=DSN,UID='MERGCOPY',UTPROC=" //* //* UTILITY WORK DATASETS //* //DSNUPROC.SYSUT1 DD DSN=CAT.SYSUT1,DISP=(MOD,CATLG,CATLG), // UNIT=SYSDA,SPACE=(CYL,(10,1)),DCB=BUFNO=20 //DSNUPROC.SYSCOPY1 DD DSN=CAT.FULLCOPY.SEQ.DATASETD(+1), // DISP=(MOD,CATLG),DCB=(SYS1.MODEL, BUFNO=20), // SPACE=(CYL,(5,1),RLSE),UNIT=TAPE //DSNUPROC.SYSCOPY2 DD DSN=CAT.INCRCOPY.SEQ.DATASETE(+1), // DISP=(MOD,CATLG),DCB=(SYS1.MODEL, BUFNO=20), // SPACE=(CYL,(2,1),RLSE),UNIT=TAPE //* //* UTILITY INPUT CONTROL STATEMENTS //* The first MERGECOPY statement creates a new full //* image copy for the DSN8D81A. //* The second statement creates a new incremental copy //* for the named table space. //* //DSNUPROC.SYSIN DD * MERGECOPY TABLESPACE DSN8D81A.DSN8S81D DSNUM ALL NEWCOPY YES COPYDDN SYSCOPY1 MERGECOPY TABLESPACE DSN8D81A.DSN8S81E DSNUM ALL NEWCOPY NO COPYDDN SYSCOPY2 /* // MERGECOPY PhasesThe MERGECOPY utility runs in three phases:
Estimating SYSUT1 and SYSCOPY Data Set SizesThe MERGECOPY utility sometimes requires the use of the SYSUT1 work data set to merge image copies. If it is impossible to simultaneously allocate all the data sets to be merged, SYSUT1 is used to hold intermediate output from the merge. If not enough tape drives are available (to allocate the incremental copy data sets) when MERGECOPY runs, be sure to allocate a SYSUT1 data set. The SYSCOPY data set holds the final merged image copy data and must be specified. The space required for this data set is the same as would be required for the SYSCOPY data set for the COPY utility. A merged image copy and a full image copy should be functionally equivalent and therefore should consume the same amount of space. The following formula should be used to calculate an estimated size for this data set. This calculation is only an estimate. More complex and precise calculations are in the DB2 Utility Guide and Reference manual, but this formula should produce comparable results. SYSUT1 = (size of the largest data set to be merged) x 1.5 SYSCOPY = (number of formatted pages) x 4096 If the table space being merged uses 32K pages, multiply the result of the SYSCOPY calculation by 8. The total number of pages used by a table space can be retrieved from either the VSAM LISTCAT command or the DB2 Catalog as specified in the NACTIVE column of SYSIBM.SYSTABLESPACE . If you are using the DB2 Catalog method, ensure that the statistics are current by running the RUNSTATS utility (discussed in Chapter 34). After calculating the estimated size for the data sets, convert the number into cylinders , rounding up to the next whole cylinder. Allocating work data sets in cylinder increments enhances the utility's performance. ConcurrencyConcurrent read and write activity can occur during execution of the MERGECOPY utility. The MERGECOPY utility can run concurrently with any utility except the following:
MERGECOPY GuidelinesWhen running MERGECOPY , consider using the following techniques and guidelines. Merge Incremental Copies As Soon As PossibleDirectly after the execution of an incremental COPY , run the MERGECOPY utility to create a new full image copy. In this way, the resources to create a new full image copy are used at a non-critical time. If you decide to avoid the creation of full image copies until there is an error, valuable time can be consumed by processing that could have taken place at a less critical time. Use MERGECOPY to Create Full Image CopiesSpecify NEWCOPY YES to produce a new full image copy. NEWCOPY NO can be used to produce a new incremental copy. Favor the creation of new full image copies rather than incremental copies because less work must be performed to correct an error if full table space image copies exist. Specify the SYSUT1 Data SetAlways specify a data set for SYSUT1 to avoid rerunning MERGECOPY . If SYSUT1 is not specified, the MERGECOPY job might be unable to allocate all the data sets needed for the merge, thereby requiring that MERGECOPY be run again. This must continue until all incremental copies have been merged into a new image copy data set, either full or incremental. If SYSUT1 is not specified, the output of the MERGECOPY utility indicates whether another merge must be run. MERGECOPY produces a message indicating the number of existing data sets and the number of merged data sets. If these numbers are not equal, rerun the MERGECOPY utility. Again, this can be avoided by specifying a SYSUT1 data set. Buffer the SYSCOPY and SYSUT1 Data SetsFor large image copies, set the BUFNO parameter in the JCL for the SYSCOPY DD statements to a number greater than 20. The BUFNO parameter creates read and write buffers in main storage for the data set, thereby enhancing the performance of the COPY utility. Ensure that sufficient memory (real or expanded) is available, however, before increasing the BUFNO specification for your SYSCOPY data sets. Also, consider specifying a larger BUFNO for the SYSUT1 data set if you expect many incremental image copies to be required. |
< Day Day Up > |