4

I'm having an issue attempting to generate a trace file for an application.

Attempting to troubleshoot an Oracle problem, but the trace file isn't being written. This is my app.config which gets moved to the Release folder as exename.app.config. I'm trying to run against Visual Studio.

Here's the app.config.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
    </startup>
    <oracle.manageddataaccess.client>
        <version number="*">
            <settings>
                <setting name="TraceFileName" value="C:\Temp\odpnet4.trc"/>
                <setting name="TraceLevel" value="7"/>
                <setting name="TraceOption" value="1"/>
            </settings>
        </version>
    </oracle.manageddataaccess.client>
</configuration>

And here's the source code:

    Dim o As New Oracle.ManagedDataAccess.Client.OracleConnection(connectionString)
    o.Open()

What am I doing wrong that I'm not seeing a file? Thanks

Ciarán Bruen
  • 5,221
  • 13
  • 59
  • 69
Ctznkane525
  • 7,297
  • 3
  • 16
  • 40
  • TraceLevel is not correct, probably the others aren't either. Note that the trace settings for the managed provider are different than unmanaged. I think the Tracelevel value is 1-7. Latest docs: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/odpnt/InstallManagedConfig.html#GUID-A9EF5624-1828-46DD-84D1-CC5F40BFB6F5 AND https://docs.oracle.com/en/database/oracle/oracle-database/12.2/odpnt/featDebug.html#GUID-A1A17BCF-10B2-4A61-8A50-A6CA91CD7CAE – Christian Shay Apr 12 '18 at 21:56
  • same issue with the 7..i removed the demandoracle and perf counter thing...any suggestions?...the traceoption of a 0 means a single file rather than if its multithreaded multiple files @ChristianShay – Ctznkane525 Apr 13 '18 at 00:14
  • Thanks Hans. Please post as answer and I'll give you the 50 worked right away. I sadly spent more time on that than I should have. – Ctznkane525 Apr 16 '18 at 15:30

2 Answers2

9
  <setting name="TraceFileName"         value="C:\Temp\odpnet4.trc"/>

How to do this correctly is documented, but you have to dig a bit. The relevant part is:

TraceFileLocation : Trace file destination location. This is different from ODP.NET, Unmanaged Driver, which supports TraceFileName.

Sigh.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Thankfully, [12.2](https://docs.oracle.com/en/database/oracle/oracle-database/12.2/odpnt/featDebug.html) fixes the inconsistency. Note that you have to install ODAC 12.2 or later to get the 12.2 driver, as the standard Windows client for 12.2 and later ships with ODP.NET 12.1 for some reason. – Chris R. Donnelly Jan 03 '19 at 15:56
0

There is an offical Oracle comparison chart showing config differences between the managed and unmanaged versions here: https://docs.oracle.com/cd/E85694_01/ODPNT/InstallConfigDiff.htm#ODPNT8173

These really matter. Do not assume any unmanaged settings persisted or are the same for the managed odp.net

Allen
  • 546
  • 5
  • 12