Wednesday, September 04, 2013

12c cloud control log file housekeep.

orarac2poc:ORCL2:/home/oracle> df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      16220072   8313944   7068908  55% /
/dev/sda1               101086     21079     74788  22% /boot
tmpfs                  2097152   1169780    927372  56% /dev/shm
/dev/sdb1             36116556  33641364    640572  99% /u01

Googled, followed this article , and did minor enhancement for cron.

#!/bin/sh

export OMS_HOME=/u01/app/oracle/oms12c
export AGENT_HOME=/u01/app/oracle/agent12c

#find and clean Oracle 12c Agent log files older then 14 days
find ${AGENT_HOME}/agent_inst/sysman/log/ -name "gcagent.log.*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null

#find and clean Oracle 12c OMS log files older then 14 days
find ${OMS_HOME}/gc_inst/em/EMGC_OMS1/sysman/log/ -name "emoms.trc*" -mtime +14 -print|xargs rm  >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/em/EMGC_OMS1/sysman/log/ -name "emctl.log.*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/em/EMGC_OMS1/sysman/log/ -name "oms_diag_info*.msg" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null



#find and clean Oracle 12c Oracle HTTP Server (OHS) log files older then 14 days
find ${OMS_HOME}/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/  -name "access_log*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/  -name "em_upload_https_access_log*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/  -name "ohs1-*.log" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null

#find and clean Oracle 12c Oracle WebLogic log files older then 14 days
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/ -name "access.log*" -mtime +14 -print|xargs rm  >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/ -name "EMGC_OMS1.log*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/ -name "EMGC_OMS1.out*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs/ -name "EMGC_OMS1-diagnostic*.log" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_ADMINSERVER/logs -name "EMGC_ADMINSERVER.out*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null
find ${OMS_HOME}/gc_inst/user_projects/domains/GCDomain/servers/EMGC_ADMINSERVER/logs -name "GCDomain.log*" -mtime +14 -print|xargs rm >/dev/null 2>/dev/null

#find and clean Oracle 12c OPMN log files older then 14 days
#${OMS_HOME}/gc_inst/WebTierIH1/diagnostics/logs/OPMN/opmn

#find and clean Oracle 12c diagnose folder in oracle home log files older then 14 days
#find /home/oracle/oradiag_oracle/diag/clients/user_oracle/host_1387324873_11/alert  -name "log_*.xml" -mtime +14 -print|xargs rm

#the next line is commented for know because on 12c I disabled the module according to metalink note:1396472.1
#cat /u01/oracle/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/mod_wl_ohs.log>/u01/oracle/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/mod_wl_ohs_$DATE_VAR.log >/u01/oracle/gc_inst/WebTierIH1/diagnostics/logs/OHS/ohs1/mod_wl_ohs.log


orarac2poc:ORCL2:/u01/app> df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      16220072   8314016   7068836  55% /
/dev/sda1               101086     21079     74788  22% /boot
tmpfs                  2097152   1169780    927372  56% /dev/shm
/dev/sdb1             36116556  31533108   2748828  92% /u01

I also followed below doc to refine the setting for this poc server.
12c Cloud Control: How to Enable Log Rotation Policy to Automatically Delete Older GCDomain.log, EMGC_ADMINSERVER.log and access.log Files? (Doc ID 1450535.1)

spent some time to find out the port number of weblogic administration console.  it is 7101 , not 7102 mentioned in above metalink doc.


orarac2poc:RCAT:/u01/app/oracle/oms12c> find ./ -name portlist.ini
./oms/install/portlist.ini
orarac2poc:RCAT:/u01/app/oracle/oms12c> cat ./oms/install/portlist.ini

orarac2poc:RCAT:/u01/app/oracle/oms12c> find ./ -name *.ini
./.gcinstall_temp/staticports.ini
./oracle_common/oui/oraparam.ini
./oracle_common/oui/clusterparam.ini
./oracle_common/OPatch/opatch.ini
./oracle_common/inventory/Templates/oui/oraparam.ini
./oracle_common/inventory/Templates/oui/clusterparam.ini
./oracle_common/inventory/Templates/OPatch/opatch.ini
./Oracle_WT/oui/oraparam.ini
./Oracle_WT/oui/clusterparam.ini
./Oracle_WT/OPatch/opatch.ini
./Oracle_WT/inventory/Templates/oui/oraparam.ini
./Oracle_WT/inventory/Templates/oui/clusterparam.ini
./Oracle_WT/inventory/Templates/OPatch/opatch.ini
./oms/install/portlist.ini
./oms/install/installer/oraparam.ini
./oms/oui/oraparam.ini
./oms/oui/clusterparam.ini
./oms/OPatch/opatch.ini
./oms/inventory/Scripts/ext/lib/portrange.ini
./oms/inventory/Scripts/ext/lib/portrange_upgrade.ini
./oms/inventory/backup/2013-01-15_04-39-32-PM/Scripts/ext/lib/portrange.ini
./oms/inventory/backup/2013-01-15_04-39-32-PM/Scripts/ext/lib/portrange_upgrade.ini
./oms/inventory/Templates/install/installer/oraparam.ini
./oms/inventory/Templates/oui/oraparam.ini
./oms/inventory/Templates/oui/clusterparam.ini
./oms/inventory/Templates/OPatch/opatch.ini
./jdk16/inventory/Scripts/ext/lib/portrange.ini
./jdk16/inventory/Scripts/ext/lib/portrange_upgrade.ini
./jdk16/inventory/backup/2013-01-15_04-28-26PM/Scripts/ext/lib/portrange.ini
./jdk16/inventory/backup/2013-01-15_04-28-26PM/Scripts/ext/lib/portrange_upgrade.ini



orarac2poc:RCAT:/u01/app/oracle/oms12c> cat ./.gcinstall_temp/staticports.ini
Enterprise Manager Upload Http Port=4889
Enterprise Manager Upload Http SSL Port=4900
Enterprise Manager Central Console Http SSL Port=7799
Node Manager Http SSL Port=7403
Managed Server Http Port=7202
Enterprise Manager Central Console Http Port=7788
Oracle Management Agent Port=3872
Admin Server Http SSL Port=7101
Managed Server Http SSL Port=7301

https://10.139.90.42:7101/console