Created On: 09 November 2011
Problem:
In a managed code Visual COBOL program for .NET you can specify DBMAN=ADO as a directive which will cause ADO commands to be generated for embedded EXEC SQL and EXEC ADO statements in your COBOL application.
In Visual COBOL how does one produce a trace file containing all commands that are executed by the Oracle Data Provider for .NET during the run of an application?
In Visual COBOL how does one produce a trace file containing all commands that are executed by the Oracle Data Provider for .NET during the run of an application?
Resolution:
Debug Tracing
ODP.NET provides debug tracing support, which allows logging of all the ODP.NET activities into a trace file. Different levels of tracing are available.
The provider can record the following information:
Entry and Exit information for the ODP.NET public methods.
User provided SQL statements as well as any SQL statements modified by the provider.
Connection Pooling statistics such as Enlistment and Delistment.
Thread ID (entry and exit).
Registry Settings for Tracing Calls
The following registry settings should be configured under
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID\ODP.NET\HOME
where ID is the appropriate Oracle Home.
TraceFileName
The valid values for TraceFileName are: any valid path and filename
TraceFileName specifies the filename that is to be used for logging trace information. If TraceOption is set to 0, the name is used as is. However, if TraceOption is 1, the Thread ID is appended to the filename provided.
TraceLevel
The valid values for TraceLevel are:
0 = None
1 = Entry, Exit, and SQL execution information
2 = Connection Pooling statistics
4 = Distributed Transactions (Enlistment and Delistment)
TraceLevel specifies the level of tracing in ODP.NET. Because tracing all the entry and exit calls for all the objects can be excessive, TraceLevel is provided to limit tracing to certain areas of the provider.
To obtain tracing on multiple objects, simply add the valid values. For example, if TraceLevel is set to 3, trace information is logged for Entry, Exit, SQL, and Connection pooling information.
TraceOption
The valid values for TraceOption are:
0 = Single trace file
1 = Multiple trace files
TraceOption specifies whether to log trace information in single or multiple files for each Thread ID. If a single trace file is specified, the filename specified in TraceFileName is used. If the multiple trace files option is requested, a Thread ID is appended to the filename provided to create a trace file for each thread.
ODP.NET provides debug tracing support, which allows logging of all the ODP.NET activities into a trace file. Different levels of tracing are available.
The provider can record the following information:
Entry and Exit information for the ODP.NET public methods.
User provided SQL statements as well as any SQL statements modified by the provider.
Connection Pooling statistics such as Enlistment and Delistment.
Thread ID (entry and exit).
Registry Settings for Tracing Calls
The following registry settings should be configured under
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID\ODP.NET\HOME
where ID is the appropriate Oracle Home.
TraceFileName
The valid values for TraceFileName are: any valid path and filename
TraceFileName specifies the filename that is to be used for logging trace information. If TraceOption is set to 0, the name is used as is. However, if TraceOption is 1, the Thread ID is appended to the filename provided.
TraceLevel
The valid values for TraceLevel are:
0 = None
1 = Entry, Exit, and SQL execution information
2 = Connection Pooling statistics
4 = Distributed Transactions (Enlistment and Delistment)
TraceLevel specifies the level of tracing in ODP.NET. Because tracing all the entry and exit calls for all the objects can be excessive, TraceLevel is provided to limit tracing to certain areas of the provider.
To obtain tracing on multiple objects, simply add the valid values. For example, if TraceLevel is set to 3, trace information is logged for Entry, Exit, SQL, and Connection pooling information.
TraceOption
The valid values for TraceOption are:
0 = Single trace file
1 = Multiple trace files
TraceOption specifies whether to log trace information in single or multiple files for each Thread ID. If a single trace file is specified, the filename specified in TraceFileName is used. If the multiple trace files option is requested, a Thread ID is appended to the filename provided to create a trace file for each thread.