Always its recommended to purge/move unwanted files from the system. Similarly we need to purge the logfiles for Oracle enterprise manager 12c cloud control. If we didn’t purge these logs it will keep on growing.
I received threshold alert for the disk space usage on OEM Server, All database logs/archiv are scheduled to purge are working fine. But still there are certain logfiles that should be purged.
Where are the logfiles which are consuming significant disk space?
/OEM/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1 [oem@oemnode1 EMGC_OMS1]$ ls -lrt total 518388 drwxr-x--- 2 oem dba 4096 Feb 18 2013 security drwxr----- 3 oem dba 4096 Feb 18 2013 cache drwxr-x--- 5 oem dba 4096 Feb 18 2013 data drwxr----- 3 oem dba 4096 Feb 18 2013 sysman drwxr----- 3 oem dba 4096 Feb 18 2013 adr drwxr----- 8 oem dba 4096 Feb 18 2013 stage drwxr-x--- 5 oem dba 4096 Mar 2 15:53 tmp drwxr-x--- 5 oem dba 24576 Jun 16 13:48 logs [oem@oemnode1 EMGC_OMS1]$
Lets see the size of these files:
[oem@oemnode1 EMGC_OMS1]$ du -sh * 5.2G adr 144K cache 4.5M data 25G logs 4.0K security 4.2M stage 91M sysman 825M tmp [oem@oemnode1 EMGC_OMS1]$
The directory “logs” is 25GB and it was never purged since the Installation (around 2 years). 25 GB in 2 years is not bad But still its not required to be on the system.
Check the file count inside logs directory:
[oem@oemnode1 logs]$ ls -l | wc -l 507 [oem@oemnode1 logs]$
Remove logfiles:
[oem@oemnode1 logs]$ rm EMGC_OMS1.out0*
Size after deleting the .out files:
[oem@oemnode1 logs]$ du -sh . 270M . [oem@oemnode1 logs]$
If you want to keep these logfiles for any future reference then you can tar these files and move it tape or any other backup server.
[oem@oemnode1 logs]$tar cvzf logs.tar.gz logs
Size after tar:
[oem@oemnode1 EMGC_OMS1]$ du -sh logs* 25G logs 507M logs.tar.gz [oem@oemnode1 EMGC_OMS1]$
We can even schedule a cron job for periodic deletion of these files from the system.
Thanks for reading.