Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable ODP.Net logging

Can anyone help me with enabling ODP.Net logging on a Windows XP machine? I googled and found following link but it did not work for me.

http://download.oracle.com/docs/html/E10927_01/featConfig.htm

I set the "TraceLevel" setting to "63" in registry but it did not help

Basically I want to capture all the database call happening from my C# code through the log.

I wish there was a tool like "SQL Profiler" for Oracle.

like image 740
Viren Jhala Avatar asked May 06 '11 18:05

Viren Jhala


2 Answers

I had the same issues on certain machines when troubleshooting some issues with Oracle Support. I found that changing the path to the output file a couple of times and multiple restarts finally forced the ODP client to start logging. Make sure that the output file is to a directory that your calling application identity has access to.

Check the following things in the registry keys. Here is an example from my machine for .net4 and 11.2.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\ODP.NET\4.112.2.0

  • 32 or 64 bit (correct node)
  • Change the Trace Level to 8 (or 64 I think for complete logging)
  • Change the Trace Option = 1
  • Set a valid TraceFileName
like image 84
tsells Avatar answered Sep 17 '22 02:09

tsells


Note that the trace will default to go in the root of the C drive. For Windows 7 and later, this requires administrator privilege or it will just fail silently. So either make sure your app is running as administrator or that you change the path of the file.

Also note, that if you want to trace ODP.NET fully managed, you need to put the settings inside the app or web config file, not the registry, AND the settings for TraceLevel are different (1 through 7).

And finally, when tracing unmanaged ODP.NET remember that there is a separate WOW registry node for 32 bit Windows. If your app is 32 bit, don't accidentally set it under the 64 bit portion of the registry.

like image 22
Christian Shay Avatar answered Sep 19 '22 02:09

Christian Shay