Académique Documents
Professionnel Documents
Culture Documents
AD_BUGS A,
AD_PATCH_RUN_BUGS B,
AD_PATCH_RUN_BUG_ACTIONS C,
AD_FILES D,
AD_PATCH_COMMON_ACTIONS E,
AD_FILE_VERSIONS F,
AD_PATCH_RUNS G,
AD_APPL_TOPS H,
AD_PATCH_DRIVERS I,
AD_APPLIED_PATCHES J
where
A.BUG_ID = B.BUG_ID and
B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and
C.FILE_ID = D.FILE_ID and
E.COMMON_ACTION_ID = C.COMMON_ACTION_ID and
D.FILE_ID = F.FILE_ID and
G.APPL_TOP_ID = H.APPL_TOP_ID and
G.PATCH_DRIVER_ID = I.PATCH_DRIVER_ID and
I.APPLIED_PATCH_ID = J.APPLIED_PATCH_ID and
B.PATCH_RUN_ID = G.PATCH_RUN_ID and
C.EXECUTED_FLAG = Y and
G.PATCH_DRIVER_ID in
(select PATCH_DRIVER_ID
from AD_PATCH_DRIVERS
where APPLIED_PATCH_ID in
(select APPLIED_PATCH_ID
from AD_APPLIED_PATCHES
where PATCH_NAME = &Patch_Number))
GROUP BY
J.PATCH_NAME,
H.APPLICATIONS_SYSTEM_NAME,
H.NAME,
I.DRIVER_FILE_NAME,
D.APP_SHORT_NAME,
D.SUBDIR,
D.FILENAME,
E.ACTION_CODE;
Shell Program to get Total Memory being consumed by FORMS Process
#!/bin/sh
ALLPROCS=`ps -ef|grep f60webmx webfile= | grep -v grep | tr -s | cut -f3 -d `
LOOPCTR=1
for EACHPROC in $ALLPROCS
do
if [ $LOOPCTR -eq 1 ]
then PROCLIST=${EACHPROC}
LOOPCTR=2
else PROCLIST=${PROCLIST},${EACHPROC}
fi
done
# echo $PROCLIST
# ps -lf -p $PROCLIST -o rss,vsz,osz > f60procinfo.out
TOTMEM=0
PROCCTR=0
PROCMEM=`ps -lf -p $PROCLIST -o rss,vsz,osz | tail +2 | cut -f1 -d `
for EACHMEM in $PROCMEM
do
TOTMEM=`expr $TOTMEM + $EACHMEM`
PROCCTR=`expr $PROCCTR + 1`
done
echo The total memory for the ${PROCCTR} f60 forms processes is ${TOTMEM} KB
Script to Check for active and inactive JDBC Sessions
set lines 120
set pages 500
column module heading Module Name format a48;
column machine heading Machine Name format a25;
column process heading Process ID format a10;
column inst_id heading Instance ID format 99;
column inst_id heading Program format a15;
column username for a10
/
prompt
prompt Connection Usage Per process and module
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select count(*), process, module
from v$session
where program like %JDBC%
group by process, module
order by 1 asc
/
prompt
prompt Idle connections for more than 3 hours
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select count(*),machine, program
from v$session
where program like %JDBC%
and last_call_et > 3600 *3
group by machine, program
/
prompt
prompt Active connections which are taking more than 10 min to run
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select *
from v$session
where program like %JDBC%
and last_call_et > 600
and status = ACTIVE
order by last_call_et asc
/
prompt
prompt Statements from JDBC connections taking more than 10 min to run
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select s.process, s.sid, t.sql_text
from v$session s, v$sql t
where s.sql_address =t.address
and s.sql_hash_value =t.hash_value
and s.program like %JDBC%
and s.last_call_et > 600
and s.status = ACTIVE
/
prompt
prompt Active connections which are taking more than 20 min to run
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select *
from v$session
where program like %JDBC%
REM
REM SQL to count number of Apps 11i users
REM Run as APPS user
REM
select Number of user sessions : || count( distinct session_id) How_many_user_sessions
from icx_sessions icx where disabled_flag != Y and PSEUDO_FLAG = N and
(last_connect + decode(FND_PROFILE.VALUE(ICX_SESSION_TIMEOUT),
NULL,limit_time,
0,limit_time,FND_PROFILE.VALUE(ICX_SESSION_TIMEOUT)/60)/24) > sysdate and
counter < limit_connects;
REM
REM END OF SQL
REM
HOW TO DETERMINE ACTIVE FORMS USERS FOR FORMSGROUP
Check the number of f60webmx processes on the Middle Tier server.
For example:
ps -ef | grep f60webx | wc -l
Oracle Tuning And Diagnostics Script Active Session Info
SELECT b.sid, b.serial#, a.spid, b.sql_id, b.program, b.osuser, b.machine,
b.TYPE, b.event, b.action, b.p1text, b.p2text, b.p3text, b.state, c.sql_text,b.logon_time
FROM v$process a, v$session b, v$sqltext c
WHERE a.addr=b.paddr
AND b.sql_hash_value = c.hash_value
AND b.STATUS = ACTIVE
ORDER BY a.spid, c.piece
Trace SQL Query Average Execution Time Using SQL ID
d.tablespace_name Name,
d.contents Type,
d.extent_management Extent Management,
d.initial_extent Initial Extent,
TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),99,999,990.900) Size (M),
TO_CHAR(NVL(a.bytes NVL(f.bytes, 0), 0)/1024/1024,99,999,999.999) Used (M),
TO_CHAR(NVL((a.bytes NVL(f.bytes, 0)) / a.bytes * 100, 0), 990.00) Used %,
TO_CHAR(NVL(a.maxbytes / 1024 / 1024, 0),99,999,990.900) MaxSize (M),
TO_CHAR(NVL((a.bytes NVL(f.bytes, 0)) / a.maxbytes * 100, 0), 990.00) Used % of
Max
FROM sys.dba_tablespaces d,
(SELECT tablespace_name,
SUM(bytes) bytes,
SUM(decode(autoextensible,NO,bytes,YES,maxbytes))
maxbytes FROM dba_data_files GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) bytes FROM dba_free_space
GROUP BY tablespace_name) f
WHERE d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = f.tablespace_name(+)
ORDER BY 10 DESC;
Cache Hit Ratio
SELECT ROUND(((1-(SUM(DECODE(name,
physical reads, VALUE,0))/
(SUM(DECODE(name, db block gets, VALUE,0))+