Forum Stats

  • 3,854,538 Users
  • 2,264,379 Discussions
  • 7,905,721 Comments

Discussions

How to trace the OCI calls

user3489565
user3489565 Member Posts: 24
edited Feb 8, 2016 12:08PM in Oracle Call Interface (OCI)

Hi,

Is there a way to trace the OCI calls to determine how the parameters are aligned in the call, simialr as ODBC trace tool does. I am getting a core dump with following stack trace. Not sure how to start with

Call Stack:

Address   Frame

60F4835A  001290EC  LdiDateFromArray.+28

61AD0B5F  00129130  vsnpri+1BE81

61AD4C42  001291C4  vsnpri+1FF64

61AB0971  001292CC  ttcfour+37B

61AADA75  00129B94  ttcdrv+146F

05A956B0  00129BAC  nioqwa+30

62DD17B5  0012BED8  upigmxln+7FD3

62DC07BC  0012BF0C  upirtrc+44

62D47404  0012BF44  kpurcsc+5A

62D04873  0012E2C0  kpuexec+180D

62C2A9C2  0012E2EC  OCIStmtExecute+24

04CD89FF  0012ED4C  OCIStmtExecute+3F

Thanks,

Sachin

Best Answer

  • user3489565
    user3489565 Member Posts: 24
    edited Feb 8, 2016 11:59AM Answer ✓

    Hi,

    Looks like the export command was not working in Cygwin, hence env. variables were not set. It worked in mks. I can now see the *trc file in the ORA_CLIENTTRACE_DIR directory.

    I see that OCI calls are logged in ora_skgu_24064.trc1 file. what does the log file name signifies


    Thanks for your reply.



Answers

  • Sdhamoth-Oracle
    Sdhamoth-Oracle Member Posts: 189 Employee
    edited Feb 6, 2016 3:30AM

    OCI call can be traced via EVENT 10842.

    Set the following environment variables and run application from the same shell or command line window:

    EVENT_10842="server=<>;user=<>;stmt=<>;level=<>"

    ORA_CLIENTTRACE_DIR=<directory>

    Trace files(*trc) (OCI function call log), will be created in the directory that is set in ORA_CLIENTTRACE_DIR variable.

    For eg:

    setenv EVENT_10842 "server=all;user=scott;stmt=all;level=15"

    setenv ORA_CLIENTTRACE_DIR /tmp/trace

  • user3489565
    user3489565 Member Posts: 24
    edited Feb 6, 2016 10:43PM

    I tried to set the above env. variable in windows session, but it did not generate any *trc file in ORA_CLIENTTRACE_DIR. what could be wrong


  • Sdhamoth-Oracle
    Sdhamoth-Oracle Member Posts: 189 Employee
    edited Feb 6, 2016 11:31PM

    On Windows, the value of environment EVENT_10842 shouldn't be enclosed with double quotes.

    set EVENT_10842=server=all;user=scott;stmt=all;level=15

    Make sure you start the application from the same command prompt instead of starting it through START menu or double click on icon

    Also you can try disabling ADR by including/modifying the following two parameters into sqlnet.ora:

    DIAG_ADR_ENABLED=FALSE

    DIAG_DDE_ENABLED=FALSE

  • user3489565
    user3489565 Member Posts: 24
    edited Feb 8, 2016 11:59AM Answer ✓

    Hi,

    Looks like the export command was not working in Cygwin, hence env. variables were not set. It worked in mks. I can now see the *trc file in the ORA_CLIENTTRACE_DIR directory.

    I see that OCI calls are logged in ora_skgu_24064.trc1 file. what does the log file name signifies


    Thanks for your reply.



  • Sdhamoth-Oracle
    Sdhamoth-Oracle Member Posts: 189 Employee
    edited Feb 8, 2016 12:08PM

    I guess the number in the filename represents the pid of the Oracle shadow process that got created while establishing a connection to DB.

    Please remember to mark and close this thread as answered.

This discussion has been closed.