TPX databases REORG ( ADMIN1 & ADMIN2 ) - VSAM files recommended procedure
search cancel

TPX databases REORG ( ADMIN1 & ADMIN2 ) - VSAM files recommended procedure

book

Article ID: 229752

calendar_today

Updated On:

Products

TPX - Session Management

Issue/Introduction

When there have been significant changes to the TPX VSAM files, such as adding a large number of new Users or
if integrity problems have been identified, its time to reorganize the VSAM files (REORG). 

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 should be stopped when running IDCAMS for backup, rename and during TPX 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.

To REORG the databases follow steps described below;

   1) Stop TPX.

     -  
Backup VSAM database IDCAMS REPRO, the DATA cluster ONLY to a flat file.
           (The 'DATA' only is required - the Index is rebuilt when the sorted flat file is REPRO'd with corrected pointers).

        Available JCL samples:

  • CB0VJCL(VBACKUP)
  • CB0VJCL(LSBACKUP) if the TPX files are managed by LServ.    

         # Example:  
            TPX.PROD.ADMIN2.DATA   to   TPX.PROD.ADMIN2.
BKUP.FLATFILE
                                                                 ensure there is 50% free space

   2) 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 a utility other than IDCAMS REPRO (UNLOAD) is used to create the flat file backup.

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

          JCL Sample:

//SORTA1   EXEC PGM=SORT                                          
//SYSPRINT DD  SYSOUT=*                                           
//SYSOUT   DD  SYSOUT=*                                           
//SORTIN   DD  DISP=SHR,DSN=TPX.PROD.ADMIN2.BKUP.FLATFILE ---> Input file   
//SORTOUT  DD  DSN= TPX.PROD.ADMIN2.FLATFILE.SRT,         ---> Output file
//             DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,DCB=(RECFM=VB,LRECL=8000,BLKSIZE=8004), 
//             SPACE=(TRK,(xx,xx)),VOL=SER=(xxxxxxx)                 
//SORTWK01 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK02 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK03 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK04 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK05 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK06 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SYSIN DD *                                                      
 SORT FIELDS=(9,17,A),FORMAT=BI                 ---> Sort statements                  
//*                                                               

 
   
3) Define a new ADMIN2 VSAM file.
         

         Sample JCL member for cluster definition (VADMIN1/VADMIN2/VMAIL/VNOTES/VVIEW) can be found in the CB0VJCL library.
          # Example:  
             TPX.PROD.ADMIN2.NEW

   4) Restore the VSAM file from the data segment of the sorted backup file.

        IDCAMS REPRO sorted flat file to temporary NEW VSAM file.
           - JCL Sample found at CB0VJCL(VRESTORE).
           - If you are using L-SERV to manage VSAM files, use member LSBACKUP instead of this job.
             # Example:  
             TPX.PROD.ADMIN2.FLATFILE.SRT to TPX.PROD.ADMIN2.NEW
          
   5) IDCAMS RENAME the VSAM datasets.

           -  Rename TPX.PROD.ADMIN2   to   TPX.PROD.ADMIN2.OLD
           -  Rename TPX.PROD.ADMIN2.
NEW   to   TPX.PROD.ADMIN2

   6) Run the RESET INTEGRITY job.

            - Verify RC=0  
            - the sample batch job is available in - CB0VSRC(BATCHINI)

   7) Start TPX.

   8) Verify if TPX is working as expected.  

If for any reason the changes need to be backed out:
  -  Stop TPX
  -  Reverse the IDCAMS RENAME to reinstate the original file.
  -  Run RESET INTEGRITY,
  -  Start TPX
.

Note:
  - Use ONLY IDCAMS to implement the above steps.  
  - This Knowledge article is specific to ADMIN1 & ADMIN2 TPX VSAM DATABASE REORG.
  - TPX Users and Profiles are maintained in the ADMIN2 database.

    See Article 229806 on how to REORG the Notes / View / Mail TPX VSAM databases.

Additional Information