cancel
Showing results for 
Search instead for 
Did you mean: 

deleting default trace file in java

Former Member
0 Kudos

Hello all,

Whats the best way to automatically delete default trace file in java instance? I want to delete these files lets say every week or 2 wkkds,Is there any type of configuration that can be done through NWA or OS...? or do i have to write some scripts? Please advice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Default traces are overwritten after a count. Say, u set the default trace file count to 10,

defaulttrace0 would be overwritten once defaulttrace9 is full. The file size can also be restricted.

The following are the corresponding parameters in 'Log Manager'

DefaultTraceFile_Count

DefualtTraceFile_Limit

Come up with an estimation as to how many logs are overwritten on a productive day and holidays and accordingly estimate as to how many files of which size you would be needing to fit your requirement for your retention perios(say 2 weeks)

By setting this , you are freed the burden to looking for a script, verify if it runs properly or monitor if the file system is getting full.

cheers !

PRADi

Former Member
0 Kudos

Thanks guys for your replies.

Pradeep,

1). So if i change the DefaultTraceFile_Count to 10 , would it not create defaultracfile_11 ,12 ,13 or so on...? Please correct me if i am wrong. This will basically creates default trace files_1 to 9 and when 9 gets full then it starts over from 0 and it will over write everything correct? what about auto archiving function ...can i archive these files before they get overwritten ?

Is it possibel to configure this way so the count will be 10 and then when file 9 is full then it will archive 1-9 files and starts over again?

2).is it possible to delete archived files automatically or its needs to be done manually?

3).Defaultracefile_limit, whats the appropriate size that i can reduce to ? default is i think 10485760 (KB).

I would appreciate your suggestion.

Thanks,

Former Member
0 Kudos

Perfect.

When set to 10, 0 -->9 are cyclic files. Regarding archiving, yes this is possible. Apart from defaulttrace files you can also archive other java log files (system, network,security etc). The configuration procedure is explained :-

http://help.sap.com/saphelp_nw04/helpdata/en/48/2edfd5bd3e0d4a81b90325fe195a70/frameset.htm

Once the 10th trace file(i.e.defaultrace9) is full, all the trace files (from defaulttrace0-defaultrace9) are zipped to a single file. The file compression ratio is extremely good.

Unfortunately there is no automated mechanism to clear off the archived files. This needs manual intervention(regular cleanup, script etc).

The archived log files may also be viewed for analysis from NWA.

While estimating the size for each defaulttrace consider three factors i) System load ii) Number of defaulttrace files.

iii) Retention days(without archiving)

Ex: System load as observed :

Say the trace file size is 10MB and 6 trace files get written in 4 hours of peak time and 1 trace files is written for 4 hours during non-peak time .Assuming 8 hours of peak business hours and rest all non-working hours.

No of files generated is 62 + 14 = 16 files of 10 MB each are generated per week day

If the defaulttrace file count is set to 16, you can retain one days' logs . Say you wish to retain the same with less number of files (i.e. 😎 you would have to increase the file size to 20 MB. Also will have to look at file system space availability.

CAUTION: For a file system occupancy estimate, you will have to also consider as to how many Server nodes are

configured as each node has its own log area !

For this you need to observe the pattern as to how many files are being written then estimate the size and count

cheers !

PRADi

Former Member
0 Kudos

Pradip,

Thanks once again for your helpful answer. Few more doubts, you said once 0-9 gets full then it will write all the trace files to one zip file, where is this zip file located? Are these zip files archived when we set up archive property to ON ? I am assuming when we we turn on the ArchiveOldLogfiles property I would need to specify the files i want to archive (such as default trace files, security files, system etc) and how often I want to archive correct?...Other thing that i would like to know, I understand its recommended to peform before archiving Security files....but in case of default trace files that should not be a concern i guess. I need to peform three things- set up count to 10, limit the file size (by reducing size)...and also by turning on the archiving property. please suggest.

Former Member
0 Kudos

1) where is this zip file located?

--> Every node has its own 'log' directory and 'archive' directory resides in this. (Ex: /usr/sap/<SID>/D*/j2ee/cluster/server0/log/archive)

2) Are these zip files archived when we set up archive property to ON ?

--> YES (ArchiveOldLogFiles =ON)

3) I am assuming when we we turn on the ArchiveOldLogfiles property I would need to specify the files i want to archive (such as default trace files, security files, system etc) -

> NO, the option of selecting which log type to archive is available only when you do a manual archive (Services>Log Configurator>Runtime> click on archive symbol).

For an automated archive, all log types are archived when their respective cycle of files are completed(i.e. if system logs are 5 (0-->4) One archive is generated when 6th file is produced(i.e. system0 is overwritten)

4) and how often I want to archive correct?

--> The frequency is dependent on load as to when the last archive file is full and the cycle is gonna repeat with the first file, there is no setting of manual frequency(Ex. nothing of the sort weekly/monthly archives)

Hope its clear !

cheers !

PRADi

Answers (1)

Answers (1)

JPReyes
Active Contributor
0 Kudos

I think your best shot is a script... I woulnt delete it without a backup.

Regards

Juan