Thursday, June 1, 2017

Identifying Which Session To Terminate

Identifying Which Session To Terminate


To identify the system identifier (SID) and serial number of a session, query the V$SESSION dynamic performance view

SELECT SID, SERIAL#, STATUS FROM V$SESSION WHERE USERNAME = 'M.QADER';

SID SERIAL# STATUS
----- --------- --------
2 13 ACTIVE
4 23 INACTIVE

A session is ACTIVE when it is making a SQL call to Oracle Database.

ALTER SYSTEM KILL SESSION '4,23';

To Check Locked Objects In Applications

To Check Locked Objects In Applications


 SELECT distinct 'alter system kill session'''||vs.sid||','||vs.serial#||''';'
       ,vs.USERNAME
       ,fu.user_name
       ,ACTION
FROM fnd_logins fl
,fnd_user fu
,v$locked_object vlocked
,v$process vp
,v$session vs
,dba_objects c
WHERE vs.sid   = vlocked.session_id
AND vlocked.object_id = c.object_id
AND vs.paddr   = vp.addr
AND vp.spid    = fl.process_spid(+)
AND vp.pid     = fl.pid(+)
AND fl.user_id = fu.user_id(+);

Troubleshoot Long Running Concurrent Request In Apps 11i/R12

Troubleshoot Long Running Concurrent Request In Apps 11i/R12



Step 1 : Check Concurrent Request ID of long running concurrent request from front end

Step 2 : Find SID, SERIAL# and SPID by running SQL (given below)

Step 3 : Enable event 10046 trace with level 12 using oradebug ( for 15-20 minute)

Step 4 : Disable trace (once you are happy with trace size)

Step 5 : Convert raw trace to TKPROF using various sort options like fchela, prsela, execpu

Step 6 : Check TKPROF out file to find root cause of slow concurrent request


In Detail:


Step 1 : Check Request ID from Find Concurrent request screen
system administrator--> concurrent request --> select phase=Running and status=Normal
uncheck on long running request

(In my case Request ID is 31487467) when prompted

SELECT a.request_id, d.sid, d.serial# ,d.osuser,d.process , c.SPID FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b, v$process c, v$session d WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id AND b.session_id=d.audsid AND a.request_id = &Request_ID;


O/P:

REQUEST_ID    SID    SERIAL#    OSUSER    PROCESS    SPID   

31487467           249     47495             oracle       12922           20732


Step 3.1 : Check and confirm SPID on Database Node

oracle@testdb trace]$ ps -ef|grep 20732
oracle   20732     1 14 16:03 ?        00:09:29 oracleJUNCLN (LOCAL=NO)
oracle   23967  9608  0 17:10 pts/2    00:00:00 grep 20732


Step 3.2 : Set OSPID (20732 in my case) for ORADEBUG


SQL> oradebug setospid 20732

Oracle pid: 58, Unix process pid: 20732, image: oracle@testdb.sapac.com.sa

SQL> oradebug event 10046 trace name context forever, level 12
Statement processed.

LEVEL 12 – Both Binds and Waits
LEVEL 8 – Only WAITS
LEVEL 4 – Only BIND Variables

Step 3.4 : Locate Trace file as

SQL> oradebug tracefile_name

/u01/oracle/JUNCLN/db/tech_st/11.1.0/admin/JUNCLN_testdb/diag/rdbms/juncln/JUNCLN/trace/JUNCLN_ora_20732.trc

Wait for 15-20 minutes


Step 4 : Disable trace

SQL> oradebug event 10046 trace name context off


Step 5: Create tkprof file like


[oracle@testdb trace]$ tkprof JUNCLN_ora_20732.trc JUNCLN_ora_20732_txt explain=apps/******* sort=(exeela,fchela) sys=no


Step 6 : Check TKPROF file to find root cause of slow concurrent request


Session Details Queries

Session Details Queries

### session by cpu-usage:


SELECT ss.username, se.SID, VALUE / 100 cpu_usage_seconds
FROM v$session ss, v$sesstat se, v$statname sn
WHERE     se.STATISTIC# = sn.STATISTIC#
     AND NAME LIKE '%CPU used by this session%'
     AND se.SID = ss.SID
     AND ss.status = 'ACTIVE'
     AND ss.username IS NOT NULL
ORDER BY VALUE DESC;

### session sorted by logon time:

select  username
 , osuser
 , sid || ',' || serial# "ID"
 , status
 , to_char(logon_time, 'hh24:mi dd/mm/yy') login_time
 , last_call_et
 from v$session
 where username is not null
 order by login_time;



Top SQL's In Database

Top SQL's In Database


 SELECT *
  FROM (  SELECT username,
                 LAST_LOAD_TIME,
                 sql_text,
                 sql_id,
                 elapsed_time,
                 cpu_time,
                 user_io_wait_time
            FROM sys.v_$sqlarea s, dba_users u
           WHERE     u.USER_ID = s.PARSING_USER_ID
                 AND TRUNC (LAST_LOAD_TIME) = TRUNC (SYSDATE)
                 AND u.username =user
        ORDER BY 6 DESC)
 WHERE ROWNUM < 10;

Monday, May 29, 2017

OPP Manager Error 'ORA-600 [kqludp2]' Unable To Publish XML Reports

OPP Manager Error 'ORA-600 [kqludp2]' Unable To Publish XML Reports


Applies to:

Oracle Concurrent Processing - Version 12.1.3 to 12.1.3 [Release 12.1]
Oracle Application Object Library - Version 11.5.10.2 to 11.5.10.2 [Release 11.5]
Information in this document applies to any platform.

Symptoms:

In 11.5.10.2 / BI Publisher 5.6.3

After recently upgrading the database to10g, when attempting to run any BI Publisher report the request completes with warning and no output is produced.  The request log show there to be no Output Post Processor available or running, however, the concurrent administration form shows the OPP manager to be running.

ICM log has references to 'get_cart_appl failed due to ORA-01000: maximum open cursors exceeded'
Review of the OPP log shows the following error occurring:
 
[EXCEPTION] [OPPServiceThread0] java.sql.SQLException: ORA-00600: internal error code, arguments: [kqludp2], [0x9EAFC1B0], [0], [], [], [], [], []
ORA-06512: at "APPS.FND_CP_OPP_IPC", line 85
ORA-06512: at line 1

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:589)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1972)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2185)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2059)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2976)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:656)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:734)
at oracle.apps.fnd.cp.opp.OPPAQMonitor.initAQ(OPPAQMonitor.java:557)
at oracle.apps.fnd.cp.opp.OPPAQMonitor.init(OPPAQMonitor.java:533)
at oracle.apps.fnd.cp.opp.OPPAQMonitor.initialize(OPPAQMonitor.java:88)
at oracle.apps.fnd.cp.opp.OPPServiceThread.init(OPPServiceThread.java:91)
at oracle.apps.fnd.cp.gsf.BaseServiceThread.run(BaseServiceThread.java:134)

NOTE: This issue also occurs after applying the Patch:20395533:R12.AD.B.DELTA.6 (This is a pre-req for HR RUP8 20000288).

The issue can be reproduced at will with the following steps:

1. Run any BI Publisher report

Due to this issue, users are unable to run XML reports
Cause

This is Unpublished Bug 5895677 ATG11510RUP5D5:FUNC:STARTING OPP GIVES ORA-600[KQLUDP2] CAN'T RUN XDO WITH CP.

Seeing the following in the OPP log:
 
[EXCEPTION] [OPPServiceThread0] java.sql.SQLException: ORA-00600: internal error code, arguments: [kqludp2], [0x9EAFC1B0], [0], [], [], [], [], []
ORA-06512: at "APPS.FND_CP_OPP_IPC", line 85
ORA-06512: at line 1
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:589)

 
Solution:

1. Shut down all services
IMPORTANT: BE SURE TO RUN THESE SCRIPTS AS THE CORRECT USERS SYSTEM and APPLSYS ONLY.
Also, verify NO CP processes are running on OS. This includes FNDLIBR, FNDSM, etc.

 2. Run $FND_TOP/patch/115/sql/afopp001.sql as SYSTEM.

3. Run $FND_TOP/patch/115/sql/afopp002.sql as APPLSYS.  Commit.

4. Restart managers and test again.

Reference metalink Doc ID 1083510.1