Tuesday, 14 March 2023

Why we need to delete the old transport requests?

 Below are a few reasons to delete 

  • Re-use the space in the file system
  • A large amount of data to be transported (lack of disk space)
  • Compliance
  • Increase the performance of the file system.

It is possible to delete the data which is no longer required from the sub directories datalog and cofiles of trans using the tp function clearold.

Note: It is recommended to archive rather than to delete directly.

Requirements

  • Check if olddata exists as subdirectory of trans

old data under trans directory: Check If the subdirectory 'olddata' within the transport directory (/usr/sap/trans) does exist or not. If not create it and  have one of the SAP System administrator as the Owner and remaining SAP system administrators sharing the same trans directory should have write permission (i.e., write authorization for the group).

  • Parameter Settings: The minimum age of files in the transport directory that can be deleted can be set in the transport profile.

The transport profile is the file 'TPPARAM' in the subdirectory 'bin' in the transport directory.

In releases prior to 4.5A, this file was called TPPARAM

The new transport profile TP_DOMAIN_<SID>.PFL generated by TMS is used for all calls of the transport control program from the SAP System. The settings in the transport profile TPPARAM are ignored.  <SID> is the SID of the first Domain controller when STMS was configured.


 

The following parameters can be set (all durations are in days):

datalifetime is the minimum lifetime of the files in data

loglifetime is the minimum lifetime of the files in log

olddatalifetime is the minimum lifetime of the files in olddata

cofilelifetime is the minimum lifetime of the files in cofiles

Example:

datalifetime=30

loglifetime=60

olddatalifetime=60

cofilelifetime=30

  • If STMS was configured with EXTENDED TRANSPORT CONTROL and used Target groups, make sure that that below parameter are set globally.

CTC=1

NBUFFORM=1

Note: If above parameters are not set globally, the tp function "check all" will return below error.

ERROR: A target system group (/FROMDEV/) is used with a name longer than 3.

This is only possible with NBUFFORM=TRUE!

ERROR: EXIT(16) -> process ID is: 27830

tp returncode summary:

TOOLS: Highest return code of single steps was: 16

ERRORS: Highest tp internal error was: 0204

tp finished with return code: 204

meaning:

  parameter is missing

Transports clean-up can be performed in two steps

  • First to run 'tp check all' is to make a list of all files in the subdirectories 'log', 'cofiles', 'data' and 'oldata' that are no longer required. This list can be found in the file 'ALL_old.lis' in the 'tmp' subdirectory of the transport directory. The age of the files is not taken into account here.
  • In the second step (tp clearold all), the age of the files that are listed in the file 'ALL_old.lis' is checked. Files from the directory 'data' which have exceeded their lifetime are moved to the subdirectory 'olddata'. Files from the other directories ('log', 'cofiles', 'olddata') which have exceeded their lifetime are directly deleted.

"tp"  checks and takes action on below sub directories of trans.

/usr/sap/trans/sapnames

/usr/sap/trans/cofiles

/usr/sap/trans/data

/usr/sap/trans/olddata

/usr/sap/trans/log

Actions being performed with TP clearold command

  • Determines the removable files from cofiles-directory ... and removes corresponding entries from files in sapnames-directory ... (/usr/sap/trans/sapnames/..)
  • Deletes the cofiles that are determined in above step from /usr/sap/trans/cofiles/...
  • Determine and delete the transport log files from /usr/sap/trans/log/....
  • Determine and delete the data files present in /usr/sap/trans/olddata
  • Moves the data files from /usr/sap/trans/data/ to /usr/sap/trans/olddata/
  • Determine and delete the data files present in /usr/sap/trans/olddata, which met expiration date. This Step again checks if any of the data files moved from /usr/sap/trans/data/ to /usr/sap/trans/olddata

Steps to start old transports deletion

  • Log on as one of the SAP System administrators, Change to the subdirectory 'bin' in the transport directory: Start tp with the arguments 'check' and 'all'

devadm % cd /usr/sap/trans/bin

devadm % tp check all pf=TP_DOMAIN_DEV.PFL

  • Start tp with the arguments 'clearold' and 'all':

devadm % tp clearold all pf=TP_DOMAIN_DEV.PFL

  • Creates CLEAROLD.LOG in /usr/sap/trans/tmp
  • CLEAROLD.LOG contains the entire log of actions taken on the sub directories of /usr/sap/trans.

Optionally we can simulate the "tp clearold all" by using the tp function "tp testold all"

devadm %tp testold all pf=/usr/sap/trans/bin/TP_DOMAIN_DEV.PFL

  • Creates TESTOLD.LOG in /usr/sap/trans/tmp
  • TESTOLD.LOG contains the entire log of actions that will be taken by the "tp clearold all" on the sub directories of /usr/sap/trans.
  • This just creates the log and does not perform any physical actions