Enterprise Manager Oracle Management Server (OMS) installations generate huge amounts of log and trace files under the covers these days, and although the logs are rotated out-of-the-box, they’re not automatically deleted. Over time (as I was reminded again today 🙄 ), these logs can amount to a large portion of your disk space being used.
MOS note 1450535.1 explains that Enterprise Manager Cloud Control 12c now can be configured to automatically delete the GCDomain.log, EMGC_ADMINSERVER.log, and access.log files, but it still doesn’t account for everything. The location of these log/trace files can be found as follows in an EM12c installation:
MW_HOME=/u01/app/oracle/middleware OMS_HOME=$MW_HOME/oms12c EM_INST_HOME=$OMS_HOME/gc_inst AGENT_HOME=$MW_HOME/agent12c
Oracle HTTP Server (OHS):
WebLogic Admin Server (primary OMS only):
WebLogic OMS (Managed Server):
WebLogic EM Node Manager:
Automatic purge scripts
…so to take care of this, I decided to put a script together which removes old log and trace files (over 15 days by default) from these locations:
…once tested, I scheduled this to run every Sunday at midnight via cron, on each OMS machine:
0 0 * * 0 /home/oracle/scripts/purge_em12c_logs.sh > /home/oracle/scripts/purge_em12c_logs.out
If anyone out there is still using Enterprise Manager 11g (or even 10g!) Grid Control, then I have a couple of scripts for those too, although the later could probably be refined:
purge_em10g_logs.sh (requires restart of the OMS)
12c Cloud Control: How to Enable Log Rotation Policy to Automatically Delete Older GCDomain.log, EMGC_ADMINSERVER.log and access.log Files? [ID 1450535.1]
EM 12c Cloud Control: Steps to Locate and Manage the Various Logs/Trace files in a 12c OMS Installation [ID 1448308.1]
12c Cloud Control: Which WLS Log Files Can be Removed / Purged Manually at Regular Intervals in 12c OMS Installation for Space Considerations? [ID 1445743.1]
I was really getting to a point of frustration just before i found your post. My “/” was constantly getting bigger and bigger, but I couldn’t trace exactly what was taking up space.Thanks to you script I moved from running 98% on / to 57%.
Thank you again.
Glad it helped you Mpho!