
Symptom
The directory /usr/sap/trans is filling up and most of the files are generated in cofile, datafile, sapnames and log directory which is the SAP transport files. You are planning to delete all these SAP transport files to regain space back in the /usr/sap/trans.
Solution
In this example, the STMS is configured as DEV > QAS > PRD. DEV is set as the domain controller. You can find the your transport domain controller via https://itsiti.com/find-stms-transport-domain-controller
1. Login to the operating system as sidadm and go to /usr/sap/trans/SID/bin
cd /usr/sap/trans/SID/bin
2. First of all, you need to execute command tp CHECK ALL. The command will generate a list of all deletable files for cofile, datafile and log directories.
> tp CHECK ALL pf=TP_DOMAIN_SID.PFL This is tp version 380.03.82 (release 720, unicode enabled) check>Log file is written to /usr/sap/trans/SID/tmp/CHECK.LOG check>Collected 30 filenames from [/usr/sap/trans/SID/buffer/.] check>Collected 8 Systemnames from [/usr/sap/trans/SID/buffer/.] check>Collected 01703 out of 01703 entries from buffer DEV. check>Collected 00004 out of 00004 entries from buffer QAS. check>Collected 00019 out of 00019 entries from buffer PRD. ... ... check>Marked 19 filenames for deletion from tmp-directory older than 365 days check>Elapsed time 0m 4s tp finished with return code: 0 meaning: Everything OK
3. The tp CHECK ALL command will logged all the information into /usr/sap/trans/SID/tmp/CHECK.LOG
> cd /usr/sap/trans/SID/tmp/ > tail -f CHECK.LOG found: AMODPROT.DEV but it is too young to die (by 250 days). found: ALL_old.lis but it is too young to die (by 365 days). found: ALL_old.bak but it is too young to die (by 364 days). found: xxx.DEV and will be marked for deletion. found: xxx.QAS and will be marked for deletion. found: xxx.PRD and will be marked for deletion. Marked 19 filenames for deletion from tmp-directory older than 15399 days
4. Before you proceed with the file deletion, you can try to execute a delete test.
> tp testold all pf=TP_DOMAIN_SID.PFL This is tp version 380.03.82 (release 720, unicode enabled) testold> WARNING, following filetypes will be modified : testold> rm files elder, than Wed Feb 29 05:27:42 2012 from cofiles. testold> rm files elder, than Sun Aug 12 06:27:42 2012 from log. testold> rm files elder, then Wed Feb 29 05:27:42 2012 from olddata. testold> mv files elder, than Sun Aug 12 06:27:42 2012 from data to olddata. *-------------------------------------------------* | This version of tp testold is a test version | | of clearold. No files are effected except for | | the log files. A detailed log is written to | | TESTOLD.LOG | *-------------------------------------------------* | Press <CTRL>-C to abort running session ... | | I am waiting 6 seconds ... | *-------------------------------------------------* |:::::::::::::::::::::::::::::::::::::::::: GO ...| *-------------------------------------------------* ... ... tp returncode summary: TOOLS: Highest return code of single steps was: 0 WARNS: Highest tp internal warning was: 0101 tp finished with return code: 0 meaning: Everything OK
5. You can get the log test from /usr/sap/trans/tmp/TESTOLD.LOG file
> tail -f TESTOLD.LOG Would remove CMODACT.DEV Would remove IMODPROT.QAS Would remove RADDBDIF.PRD
6. Before executing this step, you need create (if not exist) folder olddata. Assign the olddata with the sidadm:sapsys / rwxrwx–x / 771 authorization. Once created, you can proceed with the files deletion as per below. The command will delete files from the subdirectories cofiles, log, and olddata, and to move files from the subdirectory data to the subdirectory olddata. The log of the activity can be obtained from /usr/sap/trans/tmp/CLEAROLD.log
> mkdir olddata > chown sidadm:sapsys olddata > chmod 771 olddata
> tp CLEAROLD ALL pf=TP_DOMAIN_SID.PFL
Note
The tp CLEAROLD ALL command is executed as per settings below, which can be obtained by this command.
tp showparams SID pf=TP_DOMAIN_SID.PFL
DATALIFETIME > 200 OLDDATALIFETIME > 365 COFILELIFETIME > 365 LOGLIFETIME > 200 TMPLIFETIME > 365