Wednesday, August 23, 2017

Purge Application Log Files May Be Manually Regularly

you can purge the following Middle Tier files:

1. Shutdown middle (web) tier using the command: $ADMIN_SCRIPTS_HOME/adopmnctl.sh stopall

2. Clean out the Apache/oc4j log files in IAS 10g (10.1.3) ORACLE_HOME:

From an Unix shell where the Apps environment has been sourced,

a-1. $ cd $LOG_HOME/ora/10.1.3/Apache/
a-2. $ pwd (Verify that you are in the "Apache logs directory")
a-3. $ rm -r *

b-1. $ cd $LOG_HOME/ora/10.1.3/opmn/
b-2. $ pwd (Verify that you are in the "opmn logs directory")
b-3. $ rm -r *

c-1. $ rm $APPLRGF/javacache.log

d-1. $ cd $APPLRGF/jvmDump
d-2. $ pwd (Verify that you are in the "jvmDump directory")
d-3. $ rm -r *

For EACH j2ee log group, purge the following files:

You could have multiple JVMs per each type of log groups so "default_group_#" refers to generic #. Whereby the steps below for cleaning should be for each JVM.

e-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/forms/[ forms_default_group_# ]
e-2. $ pwd (Verify that you are in the "forms_default_group_#" directory)
e-3. $ rm -r *

f-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oacore/[ oacore_default_group_# ]
f-2. $ pwd (Verify that you are in the "oacore_default_group_#" directory)
f-3. $ rm -r *

g-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oafm/
g-2. $ pwd (Verify that you are in the oafm directory)
g-3. $ rm -r *

h-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oafm/[ oacore_default_group_# ]
h-2. $ pwd (verify that you are in the "oafm_default_group_#" directory)
h-3. $ rm -r *

Ref : Which Application Log Files May Be Manually Purged Regularly? (Doc ID 2005894.1)

Tuesday, August 8, 2017

Tuning OPP Heap Memory Issue

SELECT service_id, service_handle, developer_parameters
FROM fnd_cp_services WHERE service_id = (SELECT manager_type
FROM fnd_concurrent_queues
WHERE concurrent_queue_name = 'FNDCPOPP');

use the below command to check whether you will succeed with 2GB of heapsize or not.

$ java -Xmx2048m -version

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Increase the memory value from 512 to 1024 or higher

UPDATE fnd_cp_services
SET developer_parameters ='J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx1024m'
WHERE service_id = (SELECT manager_type FROM fnd_concurrent_queues
WHERE concurrent_queue_name = 'FNDCPOPP');


Monday, August 7, 2017

Find Details of Specific OS PID

SELECT p.spid, s.SID, s.serial#, s.action, s.username, s.status, s.program "Session Program",
       p.program "Process Program", s.module, s.lockwait, s.state, s.sql_hash_value,
       s.schemaname, s.osuser, s.machine, s.last_call_et, p.program,
       p.terminal, logon_time, module, s.osuser , f.request_id,  f.request_date,
        f.completion_text, f.outcome_product,
        f.logfile_node_name, f.outfile_name, argument_text,
       f.outfile_node_name, f.oracle_id, f.concurrent_program_id,
       f.responsibility_application_id, f.responsibility_id,
       f.last_update_login, f.nls_language, f.controlling_manager, f.actual_start_date,f.actual_completion_date
  FROM v$process p, v$session s, fnd_concurrent_requests f
 WHERE s.paddr = p.addr /*and s.status = 'ACTIVE'*/
   AND s.username NOT LIKE '%SYS%'
   AND p.spid IN (SELECT oracle_process_id
                    FROM fnd_concurrent_requests
                   WHERE 1 = 1 AND oracle_process_id = &os_pid);

Find Concurrent Request id from SID

SELECT s.inst_id,a.request_id,s.sid,s.serial#,c.spid
  FROM apps.fnd_concurrent_requests a, gv$process c, gv$session s
   WHERE s.sid in ('&SID')
  AND s.paddr = c.addr
  AND a.oracle_process_id = c.spid
  AND a.phase_code = UPPER ('R');

Inactive Sessions

Inactive Session:

select distinct  a.logon_time,a.sql_id,a.username,a.module,a.inst_id,a.osuser,a.program,substr(machine,1,20) "Machine Name",a.status, ' alter system kill session '''||a.sid||','||a.serial#||''';'
from gv$session a, gv$sql b 
where a.status='INACTIVE'
and a.logon_time < sysdate-1 --and a.module like '%JDBC Thin Client%'
and a.machine like ‘%hostname%'  and username='APPS'

and a.sql_id=b.sql_id;

Total Count of sessions

select count(s.status) TOTAL_SESSIONS
from gv$session s;

Total Count of Inactive sessions

select count(s.status) INACTIVE_SESSIONS
from gv$session s, v$process p
where
p.addr=s.paddr and
s.status='INACTIVE';

SESSIONS WHICH ARE IN INACTIVE STATUS FROM MORE THAN 1HOUR

select count(s.status) "INACTIVE SESSIONS > 1HOUR "
from gv$session s, v$process p
where
p.addr=s.paddr and
s.last_call_et > 3600 and
s.status='INACTIVE';

How to Kill a INACTIVE session:

select 'alter system kill session ''' ||sid|| ',' || serial#|| ''' immediate;' from v$session where status='INACTIVE';


TOTAL FORM SESSIONS

SELECT COUNT(S.SID) INACTIVE_FORM_SESSIONS FROM V$SESSION S
WHERE S.STATUS='INACTIVE' and
s.action like ('%FRM%');

INACTIVE FORM SESSION:

col program for a15
col last_call_et for 999.99
select p.spid, s.sid, s.process,s.last_call_et/3600 last_call_et ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) "Last SQL"
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status='INACTIVE'
and s.action like 'FRM:%'
and s.last_call_et > 3600
order by last_call_et desc;


TOAD SESSIONS

select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program
from gv$session s, gv$process p
where
p.addr=s.paddr
and s.MODULE like ('%TOAD%')
Order by last_call_et;