Expiration processing without SMF

As an alternative to using SMF for expiration processing, expiration of OAM objects can use a Db2® table. When OAM deletes an object, rows will be added to the table. When expire processing is run, it will use the rows in that table to determine what Content Manager OnDemand objects to expire instead of, or in addition to, using the SMF records.

If OAM uses a different Db2 subsystem than the Db2 subsystem that Content Manager OnDemand uses, you must create the ARSOAM_DELETE table in the Db2 subsystem that is used by OAM. Use the following sample to create the ARSOAM_DELETE table as the SRVR_INSTANCE_OWNER (in ars.ini) for the instance for which deletion events need to be captured.

The following is the ARSTBEXP sample:

ARSTBEXP JOB (account),userid,MSGCLASS=A
//**************************************************************
//*
//*  FUNCTION: CREATE THE DB2 TABLES AND TABLESPACES REQUIRED
//*            TO RUN ARSEXOAM.
//*
//*  FMID:     H272950
//*
//*  NOTES:    ON MULTIPLE CPU SYSTEMS, THIS JOB MUST BE RUN
//*            ON THE SYSTEM WHERE DB2 EXECUTES.
//*
//**************************************************************
//*
//* TO CREATE THE ONDEMAND ARSOAMDL TABLESPACE
//*
//* 1. PROVIDE A SUITABLE JOBCARD FOR YOUR ENVIRONMENT.
//*
//* 2. REPLACE THE FOLLOWING SYMBOLIC FIELDS:
//*    db2ssid  - DB2 SUBSYSTEM NAME
//*    LIB      - DB2 RUNTIME LOAD LIBRARY
//*    PLAN     - DEFAULT DB2 PLAN NAME IS DSNTIA10
//*    ARSUSER  - DEFAULT SQLID IS ARSUSER
//*
//* 3. (OPTIONAL) CHANGE THE FOLLOWING CREATE PARAMETERS:
//*    DATABASE   - DEFAULT DATABASE IS ARSDBASE
//*    STOGROUP   - DEFAULT STORAGE GROUP IS ARSSGRP
//*    TABLESPACE - CHANGE DEFAULT TABLESPACE NAMES
//*    PRIQTY     - PRIMARY ALLOCATIONS
//*    SECQTY     - SECONDARY ALLOCATIONS
//*    BUFFERPOOL - 4K BUFFERPOOL NAME
//*    STEPLIB    - SPECIFIES THE SDSNLOAD DATA SET
//*
//* 4. SUBMIT THE JOB.
//*
//**************************************************************
//* STEP1: CREATE THE ARSEXOAM TABLESPACE, TABLE, AND INDEXES
//**************************************************************
//STEP1    EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB  DD DISP=SHR,DSN=DB2.V10R5M0.SDSNLOAD
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
 DSN SYSTEM(db2ssid)
 RUN  PROGRAM(DSNTIAD) PLAN(DSNTIA10) -
      LIB('DB2.RUNTIME.LOADLIB')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN    DD *
 SET CURRENT SQLID='ARSUSER';
 CREATE TABLESPACE ARSOAMDL
      IN ARSDBASE
      USING STOGROUP ARSSGRP
      PRIQTY 75
      SECQTY 75
      SEGSIZE 64
      BUFFERPOOL BP0;

 CREATE TABLE ARSOAM_DELETE
      (
        ODCLNAME  CHAR(44)    NOT NULL,
        ODNAME    CHAR(44)    NOT NULL,
        AGID_NAME CHAR(8)     NOT NULL WITH DEFAULT,
        NID       SMALLINT    NOT NULL WITH DEFAULT,
        DOC_NAME  CHAR(11)    NOT NULL WITH DEFAULT
      )
      IN ARSDBASE.ARSOAMDL;

  CREATE INDEX ARSOAM_DELETE_0
      ON ARSOAM_DELETE
      (ODCLNAME, ODNAME)
      USING STOGROUP ARSSGRP
      PRIQTY 60
      SECQTY 60
      BUFFERPOOL BP0;

  CREATE INDEX ARSOAM_DELETE_1
      ON ARSOAM_DELETE
      (AGID_NAME, NID, DOC_NAME)
      USING STOGROUP ARSSGRP
      PRIQTY 15
      SECQTY 15
      BUFFERPOOL BP0;
/* 

After creating the table, you must create a trigger on the OAM GROUPxx.OSM_OBJ_DIR table that contains the Content Manager OnDemand objects. A sample ARSEXTRG member is provided in SARSINST for you to modify and use. If multiple servers are running for multiple database owners, you have to create multiple triggers for each.

The following is ARSEXTRG sample:

//ARSEXTRG JOB (account),userid,MSGCLASS=A
//**************************************************************
//*
//*  FUNCTION: CREATE A TRIGGER ON THE OAM DIRECTORY TABLE TO
//*            INSERT THE COLLECTION AND OBJECT INTO THE OD
//*            ARSOAM_DELETE TABLE
//*
//*  FMID:     H272950
//*
//*  NOTES:    ON MULTIPLE CPU SYSTEMS, THIS JOB MUST BE RUN
//*            ON THE SYSTEM WHERE THE OAM DB2 EXECUTES.
//*
//**************************************************************
//*
//* TO CREATE THE ARSDEL TRIGGER:
//*
//* 1. PROVIDE A SUITABLE JOBCARD FOR YOUR ENVIRONMENT.
//*
//* 2. REPLACE THE FOLLOWING SYMBOLIC FIELDS:
//*    db2ssid  - DB2 SUBSYSTEM NAME
//*    LIB      - DB2 RUNTIME LOAD LIBRARY
//*    PLAN     - DEFAULT DB2 PLAN NAME IS DSNTIA10
//*    ARSUSER  - DEFAULT SQLID IS ARSUSER
//*
//* 3. (OPTIONAL) CHANGE THE FOLLOWING CREATE PARAMETERS:
//*    STEPLIB    - SPECIFIES THE SDSNLOAD DATA SET
//*    ARSDEL     - SPECIFIES THE TRIGGER NAME
//*    GROUP00    - NAME OF THE OAM DIRECTORY TABLE THAT
//*                 CONTAINS THE OD OAM OBJECTS
//*
//* 4. SUBMIT THE JOB.
//*
//**************************************************************
//* STEP1: CREATE THE ARSDEL TRIGGER
//**************************************************************
//STEP1    EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB  DD DISP=SHR,DSN=DB2.V10R5M0.SDSNLOAD
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
 DSN SYSTEM(db2ssid)
 RUN  PROGRAM(DSNTIAD) PLAN(DSNTIA10) -
      LIB('DB2.RUNTIME.LOADLIB') PARMS('SQLTERM(?)')
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN    DD *

 SET CURRENT SQLID='ARSUSER'?

 CREATE TRIGGER ARSDEL AFTER DELETE ON GROUP00.OSM_OBJ_DIR
   REFERENCING OLD AS OLD_OBJ FOR EACH ROW MODE DB2SQL
   BEGIN ATOMIC
     INSERT INTO ARSUSER.ARSOAM_DELETE
        SELECT C.ODCLNAME, OLD_OBJ.ODNAME, ' ', 0, ' '
          FROM OAMADMIN.CBR_COLLECTION_TBL C
          WHERE C.ODCLID = OLD_OBJ.ODCLID;
   END?
/*

In addition to the ARSEXPIR program , a new program (ARSEXOAM) will delete the indexes that are associated with objects deleted by OAM by processing the ARSOAM_DELETE table. The ARSEXOAM program will only delete indexes for objects stored in OAM. If you are using VSAM linear data sets to store objects, you will still have to capture SMF records for VSAM linear data and run ARSEXPIR. You can choose one of the following options:

  1. Capturing the SMF records for both VSAM linear data and OAM deletions and using ARSEXPIR for both
  2. Using ARSEXPIR just for VSAM linear data and using the Db2 trigger and ARSEXOAM program for OAM

If you are using only OAM, you may choose to use only the ARSEXOAM program

The following is a sample job:

//ARSEXOAM EXEC PGM=ARSEXOAM
//STEPLIB  DD   DISP=SHR,DSN=ARS.SARSLOAD
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
//DSNAOINI DD   PATH='/usr/lpp/ars/V10R5M0/config/cli.ini'
//ARSPARM  DD   *
ODINSTANCE=instance
ODUSER=userid
ODUSERPW=passwd
COMMITCNT=nnn
UNLOADMAX=nnn

Where:

STEPLIB
Specifies the SARSLOAD data set.
SYSPRINT
Specifies the message output from the ARSEXOAM utility
SYSOUT
Specifies the location for message output directed to stderr.
DSNAOINI
Specifies the location of the ODBC configuration file. This can be an MVS™ data set.
ARSPARM
Specifies the location for the input control statements. It accepts the following control statements, 1 per line:
ODINSTANCE= instance
Required. Specifies the instance name of theContent Manager OnDemand library server whose objects will be deleted. The ARSEXOAM program must be able to locate the SRVR_INSTANCE_OWNER for that instance name in the /usr/lpp/ars/V10R5M0/config/ars.ini of the MVS on which the ARSEXOAM runs
ODUSER=userid
Optional. Specifies a Content Manager OnDemand user ID that exists on the server.
ODUSERPW=passwd
Optional. Specifies the password associated with the user ID.
COMMITCNT=nnn
Optional. Specifies how many fetches are done between commits. Default is 1000. If 0, no commits are done while fetching
UNLOADMAX=nnn
Optional. Specifies how many objects to pass to arsadmin for each invocation. The default is to pass all of them in a single invocation of arsadmin. A commit is also done before invoking arsadmin.

A sample job ARSEXOAM is shipped in the SARSINST data set:

//ARSEXOAM JOB (account),userid,MSGCLASS=A                        
//**************************************************************  
//STEP1    EXEC PGM=ARSEXOAM,REGION=0M                            
//STEPLIB  DD DISP=SHR,DSN=ARS.V10R5M0.SARSLOAD  
  //         DD DISP=SHR,DSN=DB2.V10R5M0.SDSNEXIT                    
  //         DD DISP=SHR,DSN=DB2.V10R5M0.SDSNLOAD                    
  //DSNAOINI DD PATH='/usr/lpp/ars/V10R5M0/config/cli.ini'                  
//SYSPRINT DD SYSOUT=*                                            
//SYSOUT   DD SYSOUT=*                                            
//ARSPARM  DD *                                                   
  odinstance=ARCHIVE                                              
  oduser=arsuser                                                  
  oduserpw="password"                                             

When you use the ARSEXOAM program to expire documents from OAM, it is possible to improve the unload performance by using the ARS_EXPIRE_REQLIMIT parameter. This parameter controls the number of load IDs that are sent to the server in a single expiration request at a time. The default value is 1, meaning that a separate request for each load ID is processed. Load IDs for the same application group can be grouped together up to the value specified for the ARS_EXPIRE_REQLIMIT parameter. However, the grouped load IDs must be for the same application group.