TPX databases REORG ( MAIL /NOTES /VIEW ) - VSAM files recommended procedure
search cancel

TPX databases REORG ( MAIL /NOTES /VIEW ) - VSAM files recommended procedure

book

Article ID: 229806

calendar_today

Updated On:

Products

TPX - Session Management

Issue/Introduction

TPX VSAM databases MAIL /NOTES /VIEW, are sparingly used and hence do not need frequent REORG.

However, in case of heavy usage due to frequent activity, a problem has been identified, a reorg is recommended.
The process is the same as detailed in the Article: 229752 for  the Admin1 and Admin2 VSAM files.

Business requirements often limit the amount of time that TPX can be unavailable, hence to minimize the down time,
these instructions identify what steps can be taken to process a TPX database REORG.

TPX needs to be stopped when running IDCAMS for backup, rename and reset integrity batch job.
Suggest attempting this procedure during a time of low system activity.

Environment

Release : 5.4
Component : TPX for z/OS

Resolution

TPX needs to be quiesced for the entire sequence of the REORG in order to maintain the integrity of the current data.

A -  Process flow:

     Stop TPX.

     IDCAMS REPRO the DATA 'only', component to a flat file. 
     
     (Only the 'DATA' component of the VSAM cluster needs to be backed up.
     When sorted flat file is REPRO'd to the new vsam file, the Index cluster is rebuilt with correct pointers)       

      Sample JCL can be found in CB0VJCL(VBACKUP) or LSBACKUP if the TPX files are managed by LServ.

     IDCAMS VSAM REPRO (UNLOAD) tries to create flat file in sequence.
          
                 Example:  TPX.PROD.%file-name%.DATA to TPX.PROD.%file-name%.NEW.FLATFILE
                                   ensure 50% free space (replace %file-name% with MAIL, NOTES or VIEW)

  B -  Sort the new flat file.

       Since the records are unloaded in non-sequenced order, they need to be sorted.
       This becomes imperative if: 
          -  An issue has been identified with VSAM files.
          -  or the VSAM files need to be reorg (too many CA / CI splits or extensions) 
          -  or if utility other than IDCAMS REPRO (UNLOAD) used to create the flat file backup. 

               Sort starting at position 9 for a length of 17 in ascending order
               DFSORT example:  SORT FIELDS=(9,17,A),FORMAT=BI 

          -   Define a new MAIL / NOTES / VIEW VSAM file.
              Example:  TPX.PROD.%file-name%.NEW         (Replace %file-name% with appropriate filename)

          -   Copy
             IDCAMS REPRO sorted flat file to temporary NEW VSAM file.
             Example:  TPX.PROD. %file-name%.NEW.FLATFILE to TPX.PROD.%file-name%..NEW

C - Complete the process

   -   IDCAMS RENAME. 
            1) RENAME TPX.PROD. %file-name% to TPX.PROD.%file-name%.OLD
            2) RENAME TPX.PROD. %file-name%.NEW to TPX.PROD.%file-name%
  
   -  Run  - RESET INTEGRITY  batch job - Verify RC=0 
               - Sample batch job is available in  ..CB0VSRC(BATCHINI)
   -  Start TPX.

      Verify TPX is working as expected.  
        If for any reason the changes need to be backed out, reverse the IDCAMS RENAME to reinstate the original file.
        Run RESET INTEGRITY, before restarting TPX.

      Note: Use ONLY IDCAMS to implement the above steps.  
         This Knowledge article is specific to MAIL NOTES & VIEW  TPX VSAM DATABASE REORG.
         See Article 229752 on how to REORG the TPX ADMIN1 & ADMIN2 VSAM databases.

Additional Information