Wednesday, 23 March 2011

How to Collect Thread dump for Oracle Applications - In this Case B2B 10g in Linux.

The command to perform a thread dump on linux is kill -3 <pid>. 

The <pid> can be found using opmnctl status for the midtier. 

Example of the output:

ias-component      | process-type       |     pid | status -------------------+--------------------+---------+---------
LogLoader          | logloaderd         |     N/A | Down   dcm-daemon         | dcm-daemon         |     N/A | Down   OC4J               | home               |    1648 | Alive  HTTP_Server        | HTTP_Server        |    1646 | Alive  B2B                | B2BServer          |    1647 | Alive  B2B                | OC4J_B2B           |    1649 | Alive  DSA                | DSA                |     N/A | Down   

In the above example, the <pid> is 1647.

The thread dumps are located in file $ORACLE_HOME/opmn/logs/B2B~B2BServer~*  or B2B~OC4J_B2B~* file. 

This needs to be done a least three times at interval about 15-30 seconds each after the issue (what ever you are debugging) has been re-produced. 

Example of a thread dump:

Full thread dump Java HotSpot(TM) Server VM (1.4.2_14-b05 mixed mode):

"Thread-9" prio=1 tid=0x088d0110 nid=0x22b8 runnable [0x857ab000..0x857ac228]
       at Method)
       at Source)
       at Source)
       at Source)
       at Source)
       at Source)
       at Source)
       at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(
       at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(
       at oracle.jdbc.driver.T4C8Oall.receive(
       at oracle.jdbc.driver.T4CCallableStatement.doOall8(
       at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(
       at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
       at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
       at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(
       - locked <0x91feaae8> (a oracle.jdbc.driver.T4CCallableStatement)
       - locked <0x91e29b38> (a oracle.jdbc.driver.T4CConnection)
       at oracle.jms.AQjmsConsumer.dequeue(
       at oracle.jms.AQjmsConsumer.receiveFromAQ(
       at oracle.jms.AQjmsConsumer.receiveFromAQ(
       at oracle.jms.AQjmsConsumer.receive(

1 comment: