Wednesday, September 12, 2012

Scared of shutdown abort?

Identifying Which Instance Owns Which Shared memory and Semaphore Segments

Sometimes it happens that after a crash or after an abnormal shutdown the oracle database instance does not release the shared memory or semaphores.

And if you do not know how to find out the unreleased shared memory or semaphores, this how you do it.

How to find which instance owns which shared memory and semaphores

On a Unix machine give the following commands

table1



$ ipcs -b

IPC status from /dev/mem as of Mon Dec 23 11:47:25 IST 2002
T ID KEY MODE OWNER GROUP QBYTES
Message Queues:
q 0 0x4107001c --rw-rw---- root printq 4194304
T ID KEY MODE OWNER GROUP SEGSZ
Shared Memory:
m 11 0x00001515 --rw-rw-rw- root system 16
m 12 0x435dce60 --rw-rw-rw- root system 8024
m 13 0x0d01c353 --rw-rw-rw- root system 1440
m 179306510 0xffffffff D-rw------- ias9 dba 1052672
m 20709394 0xec8bc6b4 --rw-r----- ora8i732 dba 328286208
m 39452692 0x62a7d5a4 --rw-r----- oracle9i dba 520896512
m 64487446 0x076d8fb0 --rw-r----- oracle9i dba 437010432
m 56492055 0x02fa8d7c --rw-r----- ora8i732 dba 293888000
m 28442648 0xbe0bab6c --rw-r----- oracle9i dba 520896512
m 4325402 0xc4d72a50 --rw-r----- oracle9i dba 470073344
m 262171 0xffffffff D-rw-r----- oracle9i dba 470073344
m 19005482 0x493f947c --rw-r----- oracle9i dba 486850560
T ID KEY MODE OWNER GROUP NSEMS
Semaphores:
s 393216 00000000 --ra-ra-ra- imnadm imnadm 4
s 1 0x6201c1b8 --ra-r--r-- root system 1
s 11 0x580038a1 --ra-ra-ra- root system 1


The above table shows the output of the ipcs –b command. This displays the shared memory and the semaphores.

Now how to know which one to kill?

Say the instance ORCL has not released the memory or semaphores.

Do the following



$ export ORACLE_SID=ORCL
$ svrmgrl

Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.

Oracle8i Release 8.1.7.0.0 - Production
JServer Release 8.1.7.0.0 - Production

SVRMGR> connect internal
Connected.
SVRMGR> oradebug ipc
Information written to trace file.
SVRMGR> exit
Server Manager complete.
$


In case you get the error



SVRMGR> oradebug ipc
ORA-00074: no process has been specified
SVRMGR>


Then find pid of a background process.



$ ps –ef|grep smon [or pmon]

oracle9i 278798 1 0 11:57:26 - 0:00 ora_smon_FFSYSHCM
ora8i732 288438 1 0 Dec 21 - 0:02 ora_smon_CSSREP1
oracle9i 315834 1 0 11:49:58 - 0:00 ora_smon_FF4HCM
oracle8i 367370 1 0 11:47:41 - 0:00 ora_smon_PGUATOMR
ora8i732 25398 1 0 Dec 21 - 0:32 ora_smon_ORCL


This will give the pid of the instance ORCL which is 25398



SVRMGR> oradebug setospid 25398
SVRMGR> oradebug ipc
Information written to trace file.
SVRMGR> exit
Server Manager complete.
$


This will write down a trace file in your $ORACLE_BASE/admin/ORCL/udump

Extract from the trace file.

Table2


"ora_48170_orcl.trc" 78 lines, 3673 characters
/ora8i732/app/product/admin/ORCL/udump/ora_48170_orcl.trc
Oracle8i Release 8.1.7.0.0 - Production
JServer Release 8.1.7.0.0 - Production
ORACLE_HOME = /ora8i732/app/product/8.1.7
System name: AIX
Node name: tcs6m1
Release: 3
Version: 4
Machine: 000F2F7F4C00
Instance name: ORCL
Redo thread mounted by this instance: 1
Oracle process number: 8
Unix process pid: 48170, image: oracle@tcs6m1 (TNS V1-V3)

*** 2002-12-23 11:46:31.286
*** SESSION ID:(7.1) 2002-12-23 11:46:31.207
Dump of unix-generic skgm context
areaflags 00000037
realmflags 0000000f
mapsize 00001000
protectsize 00001000
lcmsize 00001000
seglen 00001000
largestsize 00000000c0000000
smallestsize 0000000000400000
stacklimit 0
stackdir -1
mode 640
magic acc01ade
Handle: 2011d3d8 `/ora8i732/app/product/8.1.7ORCL'
Dump of unix-generic realm handle `/ora8i732/app/product/8.1.7ORCL', flags = 00000000
Area #0 `Fixed Size' containing Subareas 0-0
Total size 0000000000011f94 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
0 0 56492055 0000000030000000 0000000030000000
Subarea size Segment size
0000000000012000 0000000011846000
Area #1 `Variable Size' containing Subareas 2-2
Total size 0000000006a99000 Minimum Subarea size 00100000
Area Subarea Shmid Stable Addr Actual Addr
1 2 56492055 000000003ad10000 000000003ad10000
Subarea size Segment size
0000000006b00000 0000000011846000
Area #2 `Database Buffers' containing Subareas 1-1
Total size 000000000acfe000 Minimum Subarea size 00002000
Area Subarea Shmid Stable Addr Actual Addr
2 1 56492055 0000000030012000 0000000030012000
Subarea size Segment size
000000000acfe000 0000000011846000
Area #3 `Redo Buffers' containing Subareas 3-3
Total size 000000000002a000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
3 3 56492055 0000000041810000 0000000041810000
Subarea size Segment size
000000000002a000 0000000011846000
Area #4 `Lock Manager' containing Subareas 5-5
Total size 0000000000002000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
4 5 56492055 0000000041842000 0000000041842000
Subarea size Segment size
0000000000002000 0000000011846000
Area #5 `Java' containing Subareas 4-4
Total size 0000000000008000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
5 4 56492055 000000004183a000 000000004183a000
Subarea size Segment size
0000000000008000 0000000011846000
Area #6 `skgm overhead' containing Subareas 6-6
Total size 0000000000002000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
6 6 56492055 0000000041844000 0000000041844000
Subarea size Segment size
0000000000002000 0000000011846000
Dump of AIX-specific shared memory info
Number of internal AIX shared memory segments 1
Segment Shmid Size Attach Addr
1 56492055 293888000 30000000
Maximum processes: = 315

Semaphore identifiers:
393216


From table 1 and table 2 you can see that 56492055 is the shared memory that is no longer required.

Use the ipcrm –m to remove the shared memory segment.


$ ipcrm –m 56492055


Similarly you can remove the semaphores


$ ipcrm –s 393216.

Or

To find the Shared Memory id and Semaphore id you can use:


$ORACLE_HOME/bin/sysresv
IPC Resources for ORACLE_SID "ORCL" :
Shared Memory:
ID KEY
56492055 0x8a85a74c
Semaphores:
ID KEY
393216 0x4bd4814c
Oracle Instance alive for sid "ORCL"


This will save lot of your valuable time when an instance crashes and the shared memory and semaphore is not released, preventing you from starting up the database again.

HTH
Regards

PS:
or simply do


ipcrm -m `ipcs -map|awk '$9==0 {print $2}'`


$9 gives NATTACH (The no of processes attached to shared memory segment).
For the killed instance this value is 0

$2 gives the shared memory key

HAPPY LEARNING!

Thursday, September 6, 2012

Oracle Apps R12 -Identify the configuration file for a parameter change in CONTEXT_FILE

Note:- This note describes the direct changes done on context_file and its corresponding configuration file, This example should only be tried by experienced APPS dba's.

Scenario:- I had to change the oacore JVM size in context_file and its corresponding config file, I took the backup of context_file and changed the oacore JVM size as required, but how do we identify the actual config file that needs a change.( Autoconfig would do this for you, But another script for checking helps you to directly identify the relevant config file - ;) a short cut)

1) Make a backup of context_file and make the changes of parameter as required(In my case oacore JVM size is increased from 512M to 768M)

2) Now run the script adchkcfg.sh script to identofy the relevant config file that needs to be changed

$ echo $CONTEXT_FILE


/u01/app/gebs/ajithlab.local/inst/AJITHLAB_ajithR12host15/appl/admin/AJITHLAB_ajithR12host15.xml

[applmgr@ajithR12host15.us.dell.com:/u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/bin][AJITHLAB_FORMS]

$ cd $AD_TOP/bin
$ ./adchkcfg.sh

Enter the full path to the Applications Context file:

/u01/app/gebs/ajithlab.local/inst/AJITHLAB_ajithR12host15/appl/admin/AJITHLAB_ajithR12host15.xml

Enter the APPS password:



The log file for this session is located at: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/log/09061142/adconfig.log



AutoConfig is running in test mode and building diffs...



AutoConfig will consider the custom templates if present.

Using CONFIG_HOME location : /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15

Classpath : /u01/app/gebs/ajithlab/apps_st/comn/java/lib/appsborg2.zip:/u01/app/gebs/ajithlab/apps_st/comn/java/classes



Using Context file : /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/AJITHLAB_ajithR12host15.xml



Context Value Management will now update the test Context file



Updating test Context file...COMPLETED



[ Test mode ]

No uploading of Context File and its templates to database.



Testing templates from all of the product tops...



Testing templates from all of the product tops...

Testing AD_TOP........COMPLETED

Testing FND_TOP.......COMPLETED

Testing ICX_TOP.......COMPLETED

Testing MSC_TOP.......COMPLETED

Testing IEO_TOP.......COMPLETED

Testing BIS_TOP.......COMPLETED

Testing AMS_TOP.......COMPLETED

Testing CCT_TOP.......COMPLETED

Testing WSH_TOP.......COMPLETED

Testing CLN_TOP.......COMPLETED

Testing OKE_TOP.......COMPLETED

Testing OKL_TOP.......COMPLETED

Testing OKS_TOP.......COMPLETED

Testing CSF_TOP.......COMPLETED

Testing IGS_TOP.......COMPLETED

Testing IBY_TOP.......COMPLETED

Testing JTF_TOP.......COMPLETED

Testing MWA_TOP.......COMPLETED

Testing CN_TOP........COMPLETED

Testing CSI_TOP.......COMPLETED

Testing WIP_TOP.......COMPLETED

Testing CSE_TOP.......COMPLETED

Testing EAM_TOP.......COMPLETED

Testing FTE_TOP.......COMPLETED

Testing ONT_TOP.......COMPLETED

Testing AR_TOP........COMPLETED

Testing AHL_TOP.......COMPLETED

Testing OZF_TOP.......COMPLETED

Testing IES_TOP.......COMPLETED

Testing CSD_TOP.......COMPLETED

Testing IGC_TOP.......COMPLETED



Differences text report is located at: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/cfgcheck.txt



Generating Profile Option differences report...COMPLETED

Differences text report for the Database is located at: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/ProfileReport.txt

Generating File System differences report......COMPLETED

Differences html report is located at: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/cfgcheck.html



Differences Zip report is located at: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/ADXcfgcheck.zip



AutoConfig completed successfully.

[applmgr@ajithR12host15.us.dell.com:/u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/bin][AJITHLAB_FORMS]





3) Now check the cfgcheck.txt , to identify the relevant config files that needs to be changed.
One such file identified is (/u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/opmn/conf/opmn.xml)

$ cat /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/cfgcheck.txt



Driver: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/driver/adtmpl.drv



Configuration File Changes

==========================



[CHANGED]

Existing file: /u01/app/gebs/ajithlab/apps_st/appl/admin/adconfig.txt

New file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/adconfig.txt

Diff file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_adconfig.txt



Existing file: /u01/app/gebs/ajithlab/apps_st/appl/admin/AJITHLAB/adalldefaults.txt

New file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/adalldefaults.txt

Diff file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_adalldefaults.txt



Existing file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/j2ee/oacore/config/server.xml

New file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/server.xml

Diff file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_server.xml



Existing file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/oracle-webservices.xml

New file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/oracle-webservices.xml

Diff file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_oracle-webservices.xml



Existing file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/opmn/conf/opmn.xml

New file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/opmn.xml

Diff file: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_opmn.xml



TEMPLATE CUSTOMIZATIONS

=======================



Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/iAS_1012_env.tmp

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/custom/iAS_1012_env.tmp

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_iAS_1012_env.tmp



Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/adovars_ux.env

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/custom/adovars_ux.env

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_adovars_ux.env



Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/adovars_ux.env

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/custom/adovars_ux.env

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_adovars_ux0.env



Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/APPLSYS_ux.env

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/admin/template/custom/APPLSYS_ux.env

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_APPLSYS_ux.env



Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/orion_web_xml_1013.tmp

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/custom/orion_web_xml_1013.tmp

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_orion_web_xml_1013.tmp



Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/txkGenDefaultEnv.tmp

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/custom/txkGenDefaultEnv.tmp

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_txkGenDefaultEnv.tmp



Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/oc4j_properties_1013.tmp

Custom Template: /u01/app/gebs/ajithlab/apps_st/appl/fnd/12.0.0/admin/template/custom/oc4j_properties_1013.tmp

Diff File: /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/xt_oc4j_properties_1013.tmp



[applmgr@ajithR12host15.us.dell.com:/u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/bin][AJITHLAB_FORMS]


4) Open the diff file and check for the differences

$ cat /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/x_opmn.xml


Checking differences between

Existing file(<) : /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/opmn/conf/opmn.xml

New file(>) : /u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/admin/out/09061142/opmn.xml



===========================================================================

Differences

===========================================================================

114c114

<  data id="java-options" value="-server -verbose:gc -Xmx512M -Xms128M -XX:MaxPermSize=160M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Dcom.sun.management.jmxremote -Djava.security.policy=$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doracle.security.jazn.config=/u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/j2ee/oacore/config/jazn.xml -Dhttp.cookie.ignoreCommaInCookiesNamed=X_NoMatchingCookies"

-----

> data id="java-options" value="-server -verbose:gc -Xmx768M -Xms512M -XX:MaxPermSize=160M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Dcom.sun.management.jmxremote -Djava.security.policy=$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doracle.security.jazn.config=/u01/app/gebs/ajithlab.local/apps/AJITHLAB_ajithR12host15/ora/10.1.3/j2ee/oacore/config/jazn.xml -Dhttp.cookie.ignoreCommaInCookiesNamed=X_NoMatchingCookies"

119c119

data id="java-options" value="-server -verbose:gc -Xmx512M -Xms128M -XX:MaxPermSize=160M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Djava.security.policy=$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false"

-----

data id="java-options" value="-server -verbose:gc -Xmx768M -Xms512M -XX:MaxPermSize=160M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Djava.security.policy=$ORACLE_HOME/j2ee/oacore/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false"

[applmgr@ajithR12host15.us.dell.com:/u01/app/gebs/ajithlab/apps_st/appl/ad/12.0.0/bin][AJITHLAB_FORMS]

$

    HAPPY LEARNING !


Friday, August 3, 2012

Oracle Apps R12 -Few Middle Tier Tuning Tips

Applications Tier Tuning In R12







Check for necessary upgrades required in tech stack
===================================================
a) Upgrade to the latest certified technology stack

OC4J: OracleAS 10g 10.1.3.3.0, Metalink Note 454811.1

Forms: OracleAS 10.1.2.2, Metalink Note 437878.1

ATG: RUP 12.0.4 (Patch 6272680)



b) Upgrade to the latest JDK

Metalink Note 418664.1 for using Java with R12

Metalink Note 300482.1 for the latest certifications


c) Apps Version JDK Version Metalink Note


Forms
======

a) Deploy with socket mode for internal users

R12: Refer to Note 384241.1.

b) Enable Forms Dead Client Detection

Value specified in minutes: FORMS_TIMEOUT=10

In context file search for the following l
FORMS_TIMEOUT oa_var="s_forms_time"



Terminates fwebmx processes for dead clients.

c) Enable Forms Abnormal Termination Handler

Do not set FORMS_CATCHTERM

    FORMS_CATCHTERM oa_var="s_forms_catchterm"


d) Disable Cancel Query
Cancel Query increases middle-tier CPU as well as DB CPU

To Disable Cancel Query

Set the Profile “FND: Enable Cancel Query” to ‘No’

In context file search for the following line

FORMS_BLOCKING_LONGLIST oa_var="s_forms_blocklist"



Note: - For any forms related issues check for errors in the following log file



$LOG_HOME/ora/10.1.2/forms/socket.log



OC4J/JVM
=========

Thumbrule

• Only one JVM per 2 CPUs

• No more than one JVM/CPU

• No more than 100 concurrent users per JVM



Response Time/CPU Usage


Customer complains about response time?



Solution: - Configure Apache to log the time it takes to service a request



Edit: $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf/httpd.conf

LogFormat "%h %T

Logs: $LOG_HOME/ora/10.1.3/Apache/access_log*



Example: -


Log Files to check

$LOG_HOME/ora/10.1.3/Apache/access_log*


For example:

• Status 500 (internal server error) may typically be seen for a JServ request and often means the JVM has some kind of problem or has died.

For example: This entry may indicate that the JServ JVM is not responding to any requests:



192.168.1.10 - - [21/Jun/2006:13:25:30 +0100] "POST /oa_servlet/actions/processApplicantSearch HTTP/1.1" 500 0


• Status 403 (forbidden) could typically be seen for oprocmgr



For example: This entry in access_log may indicate a problem with system configuration (oprocmgr.conf): requests and often means there is a misconfiguration that needs to be resolved.


192.168.1.10 - - [21/Jun/2006:13:25:30 +0100] "GET /oprocmgr-service?cmd=Register&index=0&modName=JServ


&grpName=OACoreGroup&port=16000 HTTP/1.1" 403 226



Run the below script to search for the above errors from access_log





## Start of script

##

## Check for HTTP statuses in 400 or 500 range for JServ

## or PLSQL requests only

##

awk ' $9>=400 && $9<=599 { print $0 }' access_log*
grep -e "servlet" -e "\/pls\/"
grep -v .gif ## ## Check for requests taking more than 30 seconds to be returned ## awk ' $11>30 {print $0} ' access_log*

##

## This one is not an exception report, you need to manually check

## Look for when the JVMs are restarting

##

grep "GET /oprocmgr-service?cmd=Register" access_log*

##

## End of script





Framework applications
========================
If there are no database-related issues, then you need to analyze the JVM



Techniques you can use:


$LOG_HOME/ora/10.1.3/opmn/OC4J~oacore~default_group_*


Example:-


94562.018: [GC 670227K->595360K(892672K), 0.0221060 secs]

94617.600: [GC 672480K->617324K(799104K), 0.0307160 secs]

94648.483: [GC 694444K->623826K(872384K), 0.0405620 secs]

94706.754: [Full GC 756173K->264184K(790720K), 0.8990440 secs]

94718.575: [GC 458782K->424403K(737536K), 0.0471040 secs]

94740.380: [GC 501646K->436633K(793600K), 0.0656750 secs]

94817.197: [GC 512473K->441116K(795136K), 0.0749340 secs]


Description: -


Here the first column 94562.018, 94617.600 show the time in seconds when GC happened. Inside the square bracket it indicates whether it’s a minor GC or FULL GC. That is followed by some number 670227K->595360K. The number on left side of -> indicate original size of live objects before GC and number after -> indicate size of live objects after GC. Number in the bracket (892672K) indicates total size of live objects allocated. Number after comma indicates time it took to complete garbage collection. For example in the first rows it took 0.0221060 secs for completing GC.


Review the frequency of collections; especially major collections (i.e. Full GC)




Recommendations to be given



a) Enable verbose GC to tune heap sizes based on the GC traffic
b) If full GCs are too frequent, consider increasing -Xms and -Xmx GC tuning
c) Bigger heaps => GC will take longer
d) Longer GCs => users may experience pauses
e) For the OACoreGroup JVMs start with the lower of the following two values:


Number of cores on the middle tier

Peak Concurrent users / 100



For example:


If you have 2 x Dual Core CPUs in your server and have 500 peak users, then 4 JVMs is the recommended starting point, since the number of cores is the lower number. However, if you only had 300 peak users, then you would configure 3 JVMs as a starting point as this is now the lower figure.



f) Size your maximum heap size as either 512 MB or 1 GB. If you start with 512 MB and find that more memory is required, increase to a maximum of 1 GB. If more memory than 1 GB is required, then add another JVM instead (free physical memory allowing) to increase the total memory available overall.



For example:


You are using 1 x JVM with 1 GB heap size and find you need to increase memory. Configure your system for 2 JVMs, each with 750 MB heap size, thus providing 1.5 GB in total.


HAPPY LEARNING!