Database
Windows
Downloads
Installation Guide, Quick Start, and Release Notes
Release 11.2.0.3.50 Beta
This document provides information that supplements the Oracle Data Provider for .NET (ODP.NET) Production documentation.
// C#
using System;
using Oracle.ManagedDataAccess.Client;
using Oracle.ManagedDataAccess.Types;
namespace Connect
{
class Program
{
static void Main(string[] args)
{
try
{
// Please replace the connection string attribute settings
string constr = "user id=scott;password=tiger;data source=oracle";
OracleConnection con = new OracleConnection(constr);
con.Open();
Console.WriteLine("Connected to Oracle Database {0}", con.ServerVersion);
con.Dispose();
Console.WriteLine("Press RETURN to exit.");
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Error : {0}", ex);
}
}
}
}
<configuration>
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<setting name="TNS_ADMIN" value="C:\oracle\network\admin"/>
</settings>
</version>
</oracle.manageddataaccess.client>
</configuration>
To make this a machine-wide setting, the machine.config file can be configured.
ODP.NET, Managed Driver requires the following:
ODP.NET, Managed Driver is built with AnyCPU. It runs on either 32-bit or 64-bit (x64) Windows.
The zip file contains the following files:
| File | Description |
|---|---|
| Oracle.ManagedDataAccess.dll | Platform-independent (AnyCPU), fully-managed ADO.NET provider |
| x64\Oracle.ManagedDataAccessDTC.dll | Platform-dependent (x64 only), Managed Assembly for Distributed Transaction support. |
| x86\Oracle.ManagedDataAccessDTC.dll | Platform-dependent (x86 only), Managed Assembly for Distributed Transaction support. |
| x64\OraProvCfg.exe | Platform-dependent (x64 only) utility to configure/unconfigure ODP.NET, Managed and Unmanaged Drivers on x64 platforms |
| x86\OraProvCfg.exe | Platform-dependent (x86 only) utility to configure/unconfigure ODP.NET, Managed and Unmanaged Drivers on x86 platforms and on WOW (Windows on Windows) |
| configure64.bat | Batch file to place ODP.NET, Managed Driver into the GAC and add configuration entries into the machine.config on 64-bit OS. [XCopy install only] |
| configure32.bat | Batch file to place ODP.NET, Managed Driver into the GAC and add configuration entries into the machine.config on 32-bit OS and on WOW. [XCopy install only] |
| unconfigure64.bat | Batch file to remove ODP.NET, Managed Driver from the GAC and remove configuration entries from machine.config on 64-bit OS. [XCopy install only] |
| unconfigure32.bat | Batch file to remove ODP.NET, Managed Driver from the GAC and remove configuration entries from machine.config on 32-bit OS and on WOW. [XCopy install only] |
| tnsnames.ora | A sample configuration file that defines data source aliases. [XCopy install only] |
| sqlnet.ora | A sample configuration file that configures network related settings. [XCopy install only] |
| Oracle.ManagedDataAccess.Client.Configuration.Section.xsd | An XML schema file that defines the |
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
...
...
</dataSources>
<settings>
...
...
</settings>
<implicitRefCursor>
...
...
</implicitRefCursor>
<edmMappings>
...
...
<edmMappings>
</version>
<version number="4.112.3.50">
<dataSources>
...
...
</dataSources>
<settings>
...
...
</settings>
<implicitRefCursor>
...
...
</implicitRefCursor>
<edmMappings>
...
...
<edmMappings>
</version>
</oracle.manageddataaccess.client>
</configuration>
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<setting name="TraceOption" value="1"/>
<setting name="PerformanceCounters" value="0" />
</settings>
</version>
<version number="4.112.3.50">
<settings>
<setting name="PerformanceCounters" value="4095" />
</settings>
</version>
</oracle.manageddataaccess.client>
An application referencing ODP.NET, Managed Driver 4.112.3.50 has the following values set:<dataSources> <dataSource alias="inst1" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)......)))"/> <dataSource alias="inst2" descriptor="(DESCRIPTION= ......)))"/> </dataSources>
<settings> <setting name="TraceLevel" value="7" /> <setting name="TraceOption" value="1"/> <setting name="TNS_ADMIN" value="C:\oracle\network\admin"/> </settings>Below is a list of ODP.NET, Managed Driver configuration settings that are supported:
<implicitRefCursor>
<storedProcedure schema="USERREFCUR" name="TestProc1">
<refCursor name="Param3">
<bindInfo mode="Output"/>
<metadata columnOrdinal="0" columnName="DEPTNO" baseColumnName="DEPTNO" baseSchemaName="USERREFCUR" baseTableName="DEPT" nativeDataType="number" providerType="Int32" dataType="System.Int16" columnSize="2" allowDBNull="true" />
<metadata columnOrdinal="1" columnName="DNAME" baseColumnName="DNAME" baseSchemaName="USERREFCUR" baseTableName="DEPT" nativeDataType="varchar2" providerDBType="String" columnSize="30" />
</refCursor>
<refCursor name="param2">
<bindInfo mode="Output"/>
<metadata columnOrdinal="0" columnName="EMPNO" baseColumnName="EMPNO" baseSchemaName="USERREFCUR" baseTableName="EMP" nativeDataType="number" providerType="Int32" dataType="System.Int16" columnSize="4" allowDBNull="false" />
</refCursor>
</storedProcedure>
<!--Next stored procedure information-->
<storedProcedure name=”TestProc2”>
...
...
</storedProcedure>
</implicitRefCursor>
<distributedTransaction> <setting name="recoveryerviceHost" value="my-pc" /> <setting name="recoveryservicePort" value="2040" /> </distributedTransaction>The RecoveryServiceHost attribute specifies the host machine name that has a running recovery service. The RecoveryServicePort attribute specifies the port that the recovery service is listening on. The port specified in the managed provider section need to match the port configured with the OraMTS Recovery Service. By default, RecoveryServiceHost is set to the name of the local host if none is specified. By default, RecoveryServicePort is set to 2030, if none is specified.
<edmMappings>
<edmMapping dataType="number">
<add name="bool" precision="1"/>
<add name="byte" precision="2" />
<add name="int16" precision="5" />
</edmMapping>
</edmMappings>
| Namespace | Classes / Enumerations / Interfaces | Unsupported Method / Property / Event |
|---|---|---|
| Oracle.ManagedDataAccess.Client | FailoverEvent enumeration | All |
| Oracle.ManagedDataAccess.Client | FailoverReturnCode enumeration | All |
| Oracle.ManagedDataAccess.Client | FailoverType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQAgent class | All |
| Oracle.ManagedDataAccess.Client | OracleAQDequeueuMode enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQDequeueOptions class | All |
| Oracle.ManagedDataAccess.Client | OracleAQEnqueueOptions class | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessage class | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessageAvailableEventArgs class | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessageAvailableEventHandler class | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessageDeliveryMode enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessageState enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQMessageType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQNavigationMode enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQNotificationGroupingType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQNotificationType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleAQQueue class | All |
| Oracle.ManagedDataAccess.Client | OracleAQVisibilityMode | All |
| Oracle.ManagedDataAccess.Client | OracleBulkCopy | All |
| Oracle.ManagedDataAccess.Client | OracleBulkCopyColumnMapping class | All |
| Oracle.ManagedDataAccess.Client | OracleBulkCopyColumnMappingCollection class | All |
| Oracle.ManagedDataAccess.Client | OracleBulkCopyOptions class | All |
| Oracle.ManagedDataAccess.Client | OracleCommand | XmlCommandType property |
| Oracle.ManagedDataAccess.Client | OracleCommand | XmlQueryProperties property |
| Oracle.ManagedDataAccess.Client | OracleCommand | XmlSaveProperties property |
| Oracle.ManagedDataAccess.Client | OracleConnection | FlushCache() method |
| Oracle.ManagedDataAccess.Client | OracleConnection | Failover event |
| Oracle.ManagedDataAccess.Client | OracleConnection | ConnectionType property |
| Oracle.ManagedDataAccess.Client | OracleConnectionType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleDBShutdownMode enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleDBStartupMode enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleDataReader | GetOracleRef() method |
| Oracle.ManagedDataAccess.Client | OracleDataReader | GetOracleBlobForUpdate() method |
| Oracle.ManagedDataAccess.Client | OracleDataReader | GetOracleClobForUpdate() method |
| Oracle.ManagedDataAccess.Client | OracleDataReader | GetOracleXmlType() method |
| Oracle.ManagedDataAccess.Client | OracleDataAdapter | SafeMapping property |
| Oracle.ManagedDataAccess.Client | OracleDatabase | All |
| Oracle.ManagedDataAccess.Client | OracleDbType enumeration | Array |
| Oracle.ManagedDataAccess.Client | OracleDbType enumeration | Object |
| Oracle.ManagedDataAccess.Client | OracleDbType enumeration | Ref |
| Oracle.ManagedDataAccess.Client | OracleFailoverEventArgs class | All |
| Oracle.ManagedDataAccess.Client | OracleFailoverEventHandler class | All |
| Oracle.ManagedDataAccess.Client | OracleGlobalization class | ClientCharacterSet property |
| Oracle.ManagedDataAccess.Client | OracleGlobalization class | GetClientInfo() method |
| Oracle.ManagedDataAccess.Client | OracleGlobalization class | GetThreadInfo() method |
| Oracle.ManagedDataAccess.Client | OracleGlobalization class | SetThreadInfo() method |
| Oracle.ManagedDataAccess.Client | OracleNotificationRequest class | GroupingInterval property |
| Oracle.ManagedDataAccess.Client | OracleNotificationRequest class | GroupingNotificationEnabled property |
| Oracle.ManagedDataAccess.Client | OracleNotificationRequest class | GroupingType property |
| Oracle.ManagedDataAccess.Client | OracleRowsCopiedEventArgs class | All |
| Oracle.ManagedDataAccess.Client | OracleRowsCopiedEventHandler class | All |
| Oracle.ManagedDataAccess.Client | OracleXmlCommandType enumeration | All |
| Oracle.ManagedDataAccess.Client | OracleXmlQueryProperties class | All |
| Oracle.ManagedDataAccess.Client | OracleXmlSaveProperties class | All |
| Oracle.ManagedDataAccess.Types | IOracleArrayTypeFactory interface | All |
| Oracle.ManagedDataAccess.Types | IOracleCustomType interface | All |
| Oracle.ManagedDataAccess.Types | IOracleCustomTypeFactory interface | All |
| Oracle.ManagedDataAccess.Types | OracleArrayMappingAttribute class | All |
| Oracle.ManagedDataAccess.Types | OracleCustomTypeMappingAttribute class | All |
| Oracle.ManagedDataAccess.Types | OracleObjectMappingAttribute class | All |
| Oracle.ManagedDataAccess.Types | OracleRef class | All |
| Oracle.ManagedDataAccess.Types | OracleTimestampTZ struct | OracleTimeStampTZ(DateTime dt, string timeZone) constructor. This constructor is supported but the timeZone must be an hour offset. |
| Oracle.ManagedDataAccess.Types | OracleUdt class | All |
| Oracle.ManagedDataAccess.Types | OracleUdtFetchOption enumeration | All |
| Oracle.ManagedDataAccess.Types | OracleUdtStatus enumeration | All |
| Oracle.ManagedDataAccess.Types | OracleXmlStream class | All |
| Oracle.ManagedDataAccess.Types | OracleXmlType class | All |
| Feature Category | Difference compared to ODP.NET, Unmanaged Driver |
|---|---|
| Configuration | Configuration file format is different. See Configuration File Format section above. |
| Configuration | 'Oracle.ManagedDataAccess.Client.Configuration.Section.xsd' file, shipped with ODP.NET, Managed Driver enables intellisense when modifying/updating .NET configuration file. |
| Configuration | Registry-based confguration is not supported |
| Configuration | HA & RLB notifications Oracle Notification Service (ONS). Thus, to use HA or RLB, configure database and client to use ONS, rather than AQ. Note that change notification will continue to use AQ. |
| Configuration Parameter | Edition is not supported. |
| Configuration Parameter | CheckConStatus is not supported. |
| Configuration Parameter | DllPath is not supported. |
| Configuration Parameter | SatementCacheWithUdts is not supported. |
| Configuration Parameter | ThreadPoolMaxSize is not supported. |
| Configuration Parameter | TraceFileName has been replaced by TraceFileLocation. |
| Configuration Parameter | UdtCacheSize is not supported. |
| Configuration Parameter | UDT Mapping is not supported. |
| Connection String | Context Connection is not supported. |
| Connection String | Enlist=dynamic will behave the same as Enlist=false. |
| Connection String | Promotable Transaction setting will be ignored. It will always be set to "promotable" and always support promotions. |
| Connection String | Statement Cache Purge is not supported. |
| Connectivity | Connection to Oracle Times Ten Database is not supported |
| Performance Monitor | NumberOfStatisConnections performance counter is not supported. |
| Performance Monitor | Performance monitor category name is "ODP.NET, Managed Driver" |
| Provider Types | Provider Types accept (via constructors) and generate (via ToString() methods) only culture-invariant strings |
| Tracing | Trace file name format is: <process_name>_PID_<process_id>_DATE_<date>_TIME_<time>.trc. |
| Tracing | Dyanmic tracing is enabled by changing the TraceLevel setting in the app/web/machine.config. NOTE: For ASP.NET applications, doing so will recycle the appdomain. |
| Tracing | An eventlog entry is generated indicating where the trace file is created or if ODP.NET, Managed Driver had issues creating one. |