Oracle Data Provider for .NET, Managed Driver Configuration
ODP.NET, Managed Driver supports .NET configuration file-based settings in machine.config, application.config, and web.config. It does not support Windows registry based configuration. ODP.NET, Managed Driver settings in .NET configuration files are similar to ODP.NET, Unmanaged Driver settings to make porting easier.
The ODP.NET, Managed Driver configuration file section name is <oracle.manageddataaccess.client> as compared to <oracle.dataaccess.client> in ODP.NET, Unmanaged Driver. A typical .NET config that uses ODP.NET, Managed Driver has some or all of the following subsections nested within a <version> subsection under <oracle.manageddataaccess.client> section. Note the tag names are case sensitive, while the attribute names are case insensitive.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess" />
</configSections>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
...
...
</dataSources>
<settings>
...
...
</settings>
<implicitRefCursor>
...
...
</implicitRefCursor>
<edmMappings>
...
...
<edmMappings>
</version>
<version number="4.112.3.60">
<dataSources>
...
...
</dataSources>
<settings>
...
...
</settings>
<implicitRefCursor>
...
...
</implicitRefCursor>
<edmMappings>
...
...
<edmMappings>
</version>
</oracle.manageddataaccess.client>
</configuration>
The ODP.NET, Managed Driver configuration and settings are described in the following sections. Many of the attributes are the same as ODP.NET, Unmanaged Driver.
dataSources Section
This section can appear only under a <version> section. The mapping between the different data source aliases and corresponding data descriptors should appear in this section. The following is an example.
<dataSources>
<dataSource alias="inst1" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)......)))"/>
<dataSource alias="inst2" descriptor="(DESCRIPTION= ......)))"/>
</dataSources>
The following precedence order is followed to resolve the data source alias specified in the Data Source attribute in the connection string.
-
data source alias in the dataSources section under <oracle.manageddataaccess.client> section in the .NET config file.
-
data source alias in the tnsnames.ora file at the location specified by TNS_ADMIN in the .NET config file.
-
data source alias in the tnsnames.ora file present in the same directory as the .exe.
settings section
This section can appear only under a <version> section. Any ODP.NET, Managed Driver specific settings should appear in this section. The following is an example of a settings section:
<settings>
<setting name="TraceLevel" value="7" />
<setting name="TraceOption" value="1"/>
<setting name="TNS_ADMIN" value="C:\oracle\work"/>
</settings>
ODP.NET, Managed Driver configuration settings that are supported:
-
DbNotificationPort
-
DemandOraclePermission
-
FetchSize
-
MaxStatementCacheSize
-
MetaDataXml
-
NAMES.DIRECTORY_PATH: The default search order is TNSNAMES and EZCONNECT. TNSNAMES, LDAP, and EZCONNECT are the only name resolution methods supported, but their precedence order can be modified.
-
NAMES.LDAP_AUTHENTICATE_BIND
-
NAMES.LDAP_CONN_TIMEOUT
-
NODELAY
-
ORACLE_SID
-
PerformanceCounters
-
SelfTuning
-
SQLNET.AUTHENTICATION_SERVICES : Only supported values are NTS and null, empty, or not-specified.
-
StatementCacheSize
-
SSL_VERSION
-
TNS_ADMIN : Location where either one or more of tnsnames.ora, ldap.ora, and sqlnet.ora are located.
-
TraceFileLocation : Trace file destination location. This is different from ODP.NET, Unmanaged Driver, which supports TraceFileName.
-
TraceLevel : 1 = public APIs; 2 = private APIs; 4 = network APIs/data. These values can be ORed. To enable everything, set TraceLevel to 7. Errors will always be traced.
-
TraceOption
-
TCP.CONNECT_TIMEOUT
-
WALLET_LOCATION : Microsoft Certificate Store (MCS) and file system wallets are supported