Purge obsolete logs in oracle EBS r12

Delete logs in oracle apps R 12
Following command will help you in regular purging the log file of Oracle EBS R12.1 and R12.2

1. Report cache/Apache logs: Retention period 5days
/usr/bin/find $LOG_HOME/ora/10.1.2/reports/cache/ -mtime +30 -exec rm  {} \;
/usr/bin/find $LOG_HOME/ora/10.1.3/Apache -mtime +15 -exec rm  {} \;


2. Apache logs: Retention period 7days
/usr/bin/find $LOG_HOME/ora/10.1.3/Apache/ -mtime +30 -exec rm  {} \;

3. Concurrent manager log files : Retention period 30days
/usr/bin/find $LOG_HOME/appl/conc/log/ -mtime +30 -exec rm  {} \;

4. Concurrent manager out files : Retention period 30days
/usr/bin/find $LOG_HOME/appl/conc/out/ -mtime +30 -exec rm  {} \;

5. Appltmp logs: Retention period 30days
/usr/bin/find $APPLTMP/ -mtime +30 -exec rm  {} \;

6. Opmn logs: Retention period 7days
/usr/bin/find $LOG_HOME/ora/10.1.3/opmn/ -mtime +7 -exec rm  {} \;
  
find /oracle/PROD/inst/apps/PROD_appsprod/logs/ora/10.1.2/reports/cache  -mtime +30 -exec rm  {} \;


To automate the purging activity via crontab use the  below scripts :-

Script file:- purgingactivity.sh

 #!/bin/bash
. /oracle/PROD/apps/apps_st/appl/APPSPROD_appsprod.env

#Report cache logs: Retention period 30 days
find $LOG_HOME/ora/10.1.2/reports/cache/ -mtime +30 -exec rm  {} \;

#Apache logs: Retention period 30 days
find $LOG_HOME/ora/10.1.3/Apache/ -mtime +30 -exec rm  {} \;

#Concurrent manager log files : Retention period 7days
find $LOG_HOME/appl/conc/log/ -mtime +7 -exec rm  {} \;

#Concurrent manager out files : Retention period 7days
find $LOG_HOME/appl/conc/out/ -mtime +7 -exec rm  {} \;

#Appltmp logs: Retention period 30days
find $APPLTMP/ -mtime +15 -exec rm  {} \;

#Opmn logs: Retention period 7days
find $LOG_HOME/ora/10.1.3/opmn/*log* -mtime +7 -exec rm  {} \;


For R12.2:- 

# Remove Weblogic forms Server Logs

find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/forms_server1/logs -mtime +30 -exec rm  {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/forms_server1/logs -mtime +30 -exec rm  {} \;



find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/forms_server2/logs -mtime +30 -exec rm  {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/forms_server2/logs -mtime +30 -exec rm  {} \;



# Remove Weblogic oacore Server Logs
find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/oacore_server1/logs -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/oacore_server1/logs -mtime +30 -exec rm {} \;


find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/oacore_server2/logs -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/oacore_server2/logs -mtime +30 -exec rm {} \;


#Remove Weblogic oafm_server Server Logs

find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/oafm_server1/logs -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/oafm_server1/logs -mtime +30 -exec rm {} \;


find /oracle/DB/EBSFS/fs1/FMW_Home/user_projects/domains/EBS_domain/servers/oafm_server2/logs -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/user_projects/domains/EBS_domain/servers/oafm_server2/logs -mtime +30 -exec rm {} \;


# Remove Weblogic OHS Logs


find /oracle/DB/EBSFS/fs1/FMW_Home/webtier/instances/EBS_web_OHS1/diagnostics/logs/OHS/EBS_web -mtime +30 -exec rm {} \;
find /oracle/DB/EBSFS/fs2/FMW_Home/webtier/instances/EBS_web_OHS1/diagnostics/logs/OHS/EBS_web -mtime +30 -exec rm {} \;



find /oracle/DB/EBSFS/fs1/FMW_Home/webtier/instances/EBS_web_OHS2/diagnostics/logs/OHS/EBS_web -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/webtier/instances/EBS_web_OHS2/diagnostics/logs/OHS/EBS_web -mtime +30 -exec rm {} \;



# Remove Weblogic wlst Server Logs


find /oracle/DB/EBSFS/fs1/FMW_Home/logs -mtime +30 -exec rm {} \;

find /oracle/DB/EBSFS/fs2/FMW_Home/logs -mtime +30 -exec rm {} \;



# Remove old outputs $APPLCSF/out 

find /oracle/DB/EBSFS/fs_ne/inst/DB_samarth/logs/appl/conc/out -mtime +30 -exec rm {} \;



# Remove old reqs $APPLCSF/log


find /oracle/DB/EBSFS/fs_ne/inst/DB_samarth/logs/appl/conc/log -mtime +30 -exec rm {} \;

Once purgingactivity.sh will schedule through crontab job,automatically it will purge the all log.


The program “PURGE SIGNON AUDIT DATA” should be scheduled to run within the next 30 days with the following parameter value:

Audit date: <30 days prior to the scheduled run date>

In addition, the “Increment date parameters each run” scheduling option should be selected for the scheduled run of the program.
You can also run the below concurrent request from Sysadmin responsibility:
Purge Concurrent Request and/or Manager Data Program


2 comments:

Marcelo said...

Hi, thanks for the post, i was also reading note 2005894.1 and it says you first has to stop app tier, and you dont do it in your note. Is it safe to delete files without stopping apptier?
regards

Mohd Sajid Quamer said...

Thanks for you valuable comment. We are always purging old logs using -mtime +30 instead of rm -rf * (complete logs including current). In doc mentioned rm -rf * , It means will remove entire logs. So, if you are using rm -rf * . You should shutdown middle Tier and do the purging activity as well.

Post a Comment

Thanks for reading till end. I hope this will help you more to improve your knowledge.

Now it's your turn!

What do you think? Share your experience in the comments box and subscribe for more interesting post.