The REPAIR LOCATE Option

 <  Day Day Up  >  

The REPAIR LOCATE Option

The LOCATE option of the REPAIR utility zaps DB2 data. The term zap refers to the physical modification of data at specific address locations. This form of the REPAIR utility can be used to perform the following functions:

  • Delete an entire row from a table space

  • Replace data at specific locations in a table space or index

  • Reset broken table space page bits

The REPAIR LOCATE utility functions similarly to the IBM AMASPZAP utility. By specifying page locations and offsets, specific RIDs, or key data, you can use the REPAIR utility to alter the data stored at the specified location. Although it generally is not recommended and is not easy, the REPAIR LOCATE utility can sometimes be of considerable help in resolving errors difficult to correct by normal means (that is, using SQL).

The sample JCL provided in Listing 31.6 depicts the REPAIR JCL necessary to modify the data on the third page of the fourth partition at offset 50 for the sample table space DSN8D81A.DSN8S81E .

Listing 31.6. REPAIR LOCATE JCL
 //DB2JOBU  JOB (UTILITY),'DB2 REPAIR LOCATE',MSGCLASS=X,CLASS=X, //   NOTIFY=USER //* //**************************************************************** //* //*       DB2 REPAIR UTILITY  : : LOCATE AND MODIFY DATA //* //**************************************************************** //* //UTIL EXEC DSNUPROC,SYSTEM=DSN,UID='REPRLOCT',UTPROC=" //* //*  UTILITY INPUT CONTROL STATEMENTS //*       The REPAIR statement modifies the data on the third //*       page at offset X'0080' from the value 'SP' to the //*       value 'ST'.  This update happens only if that location //*       contains 'SP'.  Additionally, the two characters are //*       dumped to ensure that the modification is correct. //* //DSNUPROC.SYSIN    DD  *     REPAIR OBJECT         LOCATE TABLESPACE DSN8D81A.DSN8S81D PAGE X'03'                VERIFY OFFSET X'0080' DATA 'SP'                REPLACE OFFSET X'0080' DATA 'ST'                DUMP OFFSET X'0080' LENGTH 2 /* // 

REPAIR LOCATE Locking Considerations

The REPAIR LOCATE utility with the DUMP option takes an S-lock on the table space and an index, if available, during the REPAIR phase. The REPAIR LOCATE utility with the REPLACE option takes a SIX-lock on the table space and any related indexes during the REPAIR phase.

REPAIR LOCATE Guidelines

Log All Repairs

Run the REPAIR utility with the LOG YES option. This ensures that all data changes are logged to DB2 and are therefore recoverable.

Ensure That Adequate Recovery Is Available

Create a backup copy of any table space to be operated on by the REPAIR utility when the intent is to modify data. To make a backup, use the COPY utility or the DSN1COPY service aid utility.

Avoid SVC Dumps When Using REPAIR

When determining the location and values of data to be repaired, use a dump produced only by one of the following methods :

  • REPAIR with the DUMP option

  • DSN1COPY service aid utility

  • DSN1PRNT service aid utility

Do not use an SVC dump, because the information contained therein might not accurately depict the DB2 data as it exists on DASD.

Use VERIFY with REPLACE

When replacing data in a DB2 table space, code the VERIFY option, which ensures that the value of the data being changed is as expected. If the value does not match the VERIFY specification, subsequent REPLACE specifications will not occur. This provides the highest degree of safety when executing the REPAIR utility and also maintains data integrity.

Use REPAIR LOCATE with Caution

REPAIR LOCATE should be used only by a knowledgeable systems programmer or DBA. Familiarity with the MVS utility program AMASPZAP is helpful.

Do Not Use REPAIR on the DB2 Catalog and DB2 Directory

REPAIR LOCATE can be used to modify the DB2 Catalog and DB2 Directory data sets. However, these data sets have a special format and should be modified with great care. It is recommended that REPAIR never be run on these data sets. If you do not heed this warning, be sure to consult the DB2 Diagnosis Guide and Reference for the physical format of these data sets before proceeding.

Repair the "Broken" Page Bit When Necessary

Sometimes DB2 erroneously sets the "broken" page bit. If you determine that the page is correct after examining the contents using dumps and the REPAIR utility, you can invoke REPAIR LOCATE with the RESET option to reset the "broken" page bit. However, be absolutely sure that the page in question is accurate before modifying this bit.

Grant REPAIR Authority Judiciously

Remember that REPAIR authority must be granted before anyone can execute the REPAIR utility. However, it is common for many shops to grant REPAIR authority to beginning users or production jobs in order to reset pending flags. Because the REPAIR authority cannot be broken down into which option is needed (that is DBD , LOCATE , or SET ), blanket authority to execute any type of REPAIR is given when REPAIR authority is granted. This could be dangerous if an uneducated user stumbles across the ability to zap DB2 table space data.

Remember that REPAIR authority is implicit in the group -level DBCTRL , DBADM , SYSCTRL , and SYSADM authorities.

 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net