OEM Grid Control 10.2 – Purge logs

Came across an issue whereby the OC4J (Oracle Application Server Containers for Java EE) had exponentially grown over time and the em-application.log file was over 40gb. The other big file was the default-web-access.log file which was over 10gb.

As far as i am aware, these files don’t automatically purge and so a manual workaround is required.

To clean up and remove these files do the following. only remove if they are no longer required – if not copy the files first (as in the example below)

Steps taken:

1. Stop Grid Control
2. Move big files into backup file
3. Start Grid Control
4. Once happy, Remove backup files

[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             135G   74G   7G  96% /u01
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : ./opmnctl stopall
opmnctl: stopping opmn and all managed processes…
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : ./opmnctl status
Unable to connect to opmn.
Opmn may not be up.
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : cd /u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : ls -ltrh
total 49G
drwxrwx—    2 oracle   dba          4.0K Nov  8  2005 oc4j
-rw-r–r–    1 oracle   dba          8.9G Jun 22 10:59 default-web-access.log
-rw-rw—-    1 oracle   dba          828M Jun 22 10:59 server.log
-rw-rw—-    1 oracle   dba           40K Jun 22 10:59 rmi.log
-rw-rw—-    1 oracle   dba           20K Jun 22 10:59 jms.log
-rw-rw—-    1 oracle   dba           93K Jun 22 10:59 global-application.log
-rw-r–r–    1 oracle   dba           39G Jun 22 10:59 em-application.log
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : mv em-application.log em-application.log.backup
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : mv default-web-access.log default-web-access.log.backup
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : cd /u01/app/oracle/product/10.2/gc/oms10g/opmn/bin/
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : ./opmnctl startall
opmnctl: starting opmn and all managed processes…
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : ./opmnctl status

Processes in Instance: EnterpriseManager0..tcy.tradermedia.net
——————-+——————–+———+———
ias-component      | process-type       |     pid | status
——————-+——————–+———+———
HTTP_Server        | HTTP_Server        |   24406 | Alive
LogLoader          | logloaderd         |     N/A | Down
dcm-daemon         | dcm-daemon         |   25611 | Alive
OC4J               | home               |   24407 | Alive
OC4J               | OC4J_EMPROV        |   24408 | Alive
OC4J               | OC4J_EM            |   24409 | Alive
OC4J               | OCMRepeater        |   24417 | Alive
WebCache           | WebCache           |   24439 | Alive
WebCache           | WebCacheAdmin      |   24427 | Alive
DSA                | DSA                |     N/A | Down

[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/opmn/bin : cd –
/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : rm em-application.log.backup
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : rm default-web-access.log.backup
[**LIVE**]:/u01/app/oracle/product/10.2/gc/oms10g/j2ee/OC4J_EM/log/OC4J_EM_default_island_1 : df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             135G   74G   55G  58% /u01

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: