readme.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. Release Notes
  2. =============
  3. Oracle Data Provider for .NET, Managed Driver
  4. Oracle Data Provider for .NET, Managed Driver for Entity Framework
  5. Release 12.1.0.2.1 for ODAC 12c Release 3 Production
  6. January 2015
  7. Copyright (c) Oracle Corporation 2015
  8. This document provides information that supplements the Oracle Data Provider for .NET (ODP.NET) documentation.
  9. You have downloaded Oracle Data Provider for .NET from Oracle, the license agreement to which is available at
  10. http://www.oracle.com/technetwork/licenses/distribution-license-152002.html
  11. TABLE OF CONTENTS
  12. *Installation and Configuration Steps
  13. *Installation Changes
  14. *Documentation Corrections and Additions
  15. *ODP.NET, Managed Driver Tips, Limitations, and Known Issues
  16. *Entity Framework Tips, Limitations, and Known Issues
  17. Note: The 32-bit "Oracle Developer Tools for Visual Studio" download from http://otn.oracle.com/dotnet is
  18. required for Entity Framework design-time features and for other Visual Studio designers such as the
  19. TableAdapter Wizard. This NuGet download does not enable design-time tools; it only provides run-time support.
  20. This version of ODP.NET supports Oracle Database version 10.2 and higher.
  21. Installation and Configuration Steps
  22. ====================================
  23. The downloads are NuGet packages that can be installed with the NuGet Package Manager. These instructions apply
  24. to install ODP.NET, Managed Driver.
  25. 1. Un-GAC any existing ODP.NET 12.1.0.2 versions you have installed. For example, if you plan to use only the
  26. ODP.NET, Managed Driver, only un-GAC existing managed ODP.NET 12.1.0.2 versions then.
  27. 2. In Visual Studio 2010, 2012, or 2013, open NuGet Package Manager from an existing Visual Studio project.
  28. NOTE: NuGet package for Oracle Data Provider for .NET, Managed Driver for Entity Framework requires Visual Studio
  29. 2012 or higher.
  30. 3. Install the NuGet package from an OTN-downloaded local package source or from nuget.org.
  31. From Local Package Source
  32. -------------------------
  33. A. Click on the Settings button in the lower left of the dialog box.
  34. B. Click the "+" button to add a package source. In the Source field, enter in the directory location where the
  35. NuGet package(s) were downloaded to. Click the Update button, then the Ok button.
  36. C. On the left side, under the Online root node, select the package source you just created. The ODP.NET NuGet
  37. packages will appear.
  38. From Nuget.org
  39. --------------
  40. A. In the Search box in the upper right, search for the packages with id, "Oracle.ManagedDataAccess" and/or
  41. "Oracle.ManagedDataAccess.EntityFramework". Verify that the packages use these unique IDs to ensure they are the
  42. offical Oracle Data Provider for .NET, Managed Driver downloads.
  43. B. Select the package you wish to install.
  44. 4. Click on the Install button to select the desired NuGet package(s) to include with the project. Accept the
  45. license agreement and Visual Studio will continue the setup.
  46. 5. Open the app/web.config file to configure the ODP.NET connection string and local naming parameters
  47. (i.e. tnsnames.ora). Below is an example of configuring the local naming parameters:
  48. <oracle.manageddataaccess.client>
  49. <version number="*">
  50. <dataSources>
  51. <!-- Customize these connection alias settings to connect to Oracle DB -->
  52. <dataSource alias="MyDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
  53. </dataSources>
  54. </version>
  55. </oracle.manageddataaccess.client>
  56. After following these instructions, ODP.NET is now configured and ready to use.
  57. NOTE: ODP.NET, Managed Driver comes with two platform specific assemblies:
  58. i. Oracle.ManagedDataAccessDTC.dll (for Distributed Transaction Support)
  59. ii. Oracle.ManagedDataAccessIOP.dll (for Kerberos Support)
  60. The Oracle.ManagedDataAccessDTC.dll assembly is ONLY needed if you are using Distributed Trasactions and the
  61. .NET Framework being used is 4.5.1 or lower. If you are using .NET Framework 4.5.2 or higher, this assembly does
  62. not need to be referenced by your application.
  63. The Oracle.ManagedDataAccessIOP.dll assembly is ONLY needed if you are using Kerberos. Kerberos users will need
  64. to download MIT Kerberos for Windows 4.0.1 or higher from
  65. http://web.mit.edu/kerberos/dist/
  66. to utilize ODP.NET, Managed Driver's support of Kerberos.
  67. These asssemblies are located under
  68. packages\Oracle.ManagedDataAccess.12.1.021\bin\x64
  69. and
  70. packages\Oracle.ManagedDataAccess.12.1.021\bin\x86
  71. depending on the platform.
  72. If these assemblies are required by your application, your Visual Studio project requires additional changes.
  73. Use the following steps for your application to use the 64-bit version of Oracle.ManagedDataAccessDTC.dll:
  74. 1. Right click on the Visual Studio project.
  75. 2. Select Add -> New Folder
  76. 3. Name the folder x64.
  77. 4. Right click on the newly created x64 folder
  78. 5. Select Add -> Existing Item
  79. 6. Browse to packages\Oracle.ManagedDataAccess.12.1.021\bin\x64 under your project solution directory.
  80. 7. Choose Oracle.ManagedDataAccessDTC.dll
  81. 8. Click the 'Add' button
  82. 9. Left click the newly added Oracle.ManagedDataAccessDTC.dll in the x64 folder
  83. 10. In the properties window, set 'Copy To Output Directory' to 'Copy Always'.
  84. For x86 targeted applications, name the folder x86 and add assemblies from the
  85. packages\Oracle.ManagedDataAccess.12.1.021\bin\x86 folder.
  86. Use the same steps for adding Oracle.ManagedDataAccessIOP.dll.
  87. To make your application platform independent even if it depends on Oracle.ManagedDataAccessDTC.dll and/or
  88. Oracle.ManagedDataAccessIOP.dll, create both x64 and x86 folders with the necessary assemblies added to them.
  89. Installation Changes
  90. ====================
  91. The following app/web.config entries are added by including the "ODP.NET, Managed Driver - Official" NuGet package
  92. to your application:
  93. 1) Configuration Section Handler
  94. The following entry is added to the app/web.config to enable applications to add an <oracle.manageddataaccess.client>
  95. section for ODP.NET, Managed Driver-specific configuration:
  96. <configuration>
  97. <configSections>
  98. <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  99. </configSections>
  100. </configuration>
  101. Note: If your application is a web application and the above entry was added to a web.config and the same config
  102. section handler for "oracle.manageddataaccess.client" also exists in machine.config but the "Version" attribute values
  103. are different, an error message of "There is a duplicate 'oracle.manageddataaccess.client' section defined." may be
  104. observed at runtime. If so, the config section handler entry in the machine.config for
  105. "oracle.manageddataaccess.client" has to be removed from the machine.config for the web application to not encounter
  106. this error. But given that there may be other applications on the machine that depended on this entry in the
  107. machine.config, this config section handler entry may need to be moved to all of the application's .NET config file on
  108. that machine that depend on it.
  109. 2) DbProviderFactories
  110. The following entry is added for applications that use DbProviderFactories and DbProviderFactory classes. Also, any
  111. DbProviderFactories entry for "Oracle.ManagedDataAccess.Client" in the machine.config will be ignored with the following
  112. entry:
  113. <configuration>
  114. <system.data>
  115. <DbProviderFactories>
  116. <remove invariant="Oracle.ManagedDataAccess.Client" />
  117. <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  118. </DbProviderFactories>
  119. </system.data>
  120. </configuration>
  121. 3) Dependent Assembly
  122. The following entry is created to ignore policy DLLs for Oracle.ManagedDataAccess.dll and always use the
  123. Oracle.ManagedDataAccess.dll version that is specified by the newVersion attribute in the <bindingRedirect> element.
  124. The newVersion attribute corresponds to the Oracle.ManagedDataAccess.dll version which came with the NuGet package
  125. associated with the application.
  126. <configuration>
  127. <runtime>
  128. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  129. <dependentAssembly>
  130. <publisherPolicy apply="no" />
  131. <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
  132. <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0" />
  133. </dependentAssembly>
  134. </assemblyBinding>
  135. </runtime>
  136. </configuration>
  137. 4) Data Sources
  138. The following entry is added to provide a template on how a data source can be configured in the app/web.config.
  139. Simply rename "MyDataSource" to an alias of your liking and modify the PROTOCOL, HOST, PORT, SERVICE_NAME as required
  140. and un-comment the <dataSource> element. Once that is done, the alias can be used as the "data source" attribute in
  141. your connection string when connecting to an Oracle Database through ODP.NET, Managed Driver.
  142. <configuration>
  143. <oracle.manageddataaccess.client>
  144. <version number="*">
  145. <dataSources>
  146. <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
  147. </dataSources>
  148. </version>
  149. </oracle.manageddataaccess.client>
  150. </configuration>
  151. The following app/web.config entries are added by including the "ODP.NET, Managed Entity Framework Driver - Official"
  152. NuGet package to your application.
  153. 1) Entity Framework
  154. The following entry is added to enable Entity Framework to use Oracle.ManagedDataAccess.dll for executing Entity
  155. Framework related-operations, such as Entity Framework Code First and Entity Framework Code First Migrations against
  156. the Oracle Database.
  157. <configuration>
  158. <entityFramework>
  159. <providers>
  160. <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  161. </providers>
  162. </entityFramework>
  163. </configuration>
  164. 2) Connection String
  165. The following entry is added to enable the classes that are derived from DbContext to be associated with a connection
  166. string instead to associating the derived class with a connection string programmatically by passing it via its
  167. constructor. The name of "OracleDbContext" should be changed to the class name of your class that derives from DbContext.
  168. In addition, the connectionString attribute should be modified properly to set the "User Id", "Password", and
  169. "Data Source" appropriately with valid values.
  170. <configuration>
  171. <connectionStrings>
  172. <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=oracle_user;Password=oracle_user_password;Data Source=oracle" />
  173. </connectionStrings>
  174. </configuration>
  175. Documentation Corrections and Additions
  176. =======================================
  177. This section contains information that corrects or adds to existing ODP.NET documentation, which can be found here:
  178. http://docs.oracle.com/cd/E56485_01/index.htm
  179. Custom Entity Data Model (EDM) Type Mapping Not Applied to Generated Complex Types
  180. ---
  181. When using the EDM wizard to create a complex type from a function import, any custom EDM type mappings specified will
  182. not be applied. The EDM wizard uses the default type mappings and the only known workaround is to manually edit the
  183. resulting complex type. After the complex type is generated any type declaration (field, property, constructor parameter,
  184. etc.) in the complex object which has an undesired type (such as Decimal rather than Boolean) should be manually edited
  185. to be of the desired type.
  186. ODP.NET, Managed Driver Support for Oracle Database 12c Implicit Ref Cursor
  187. ---
  188. ODP.NET, Managed Driver introduces support for the new Oracle Database 12c Implicit Ref Cursor. Configuration occurs
  189. using the <implicitrefcursor> .NET configuration section. When using database implicit ref cursors, the bindInfo element
  190. should be specified with a mode of "Implicit":
  191. <bindinfo mode="Implicit" />
  192. For additional information refer to the implicitRefCursor section in Chapter 2 of the Oracle Data Provider for .NET
  193. Developer's Guide.
  194. Entity Framework Code First: Code-Based Migrations With No Supporting Code Migration File
  195. ---
  196. When using code-based migrations with the Entity Framework provider, the migration history table may be dropped if no
  197. supporting code migration file existed prior to updating the database.
  198. Workaround: Ensure the supporting code migration file has been added prior to updating the database.
  199. The following steps can remove the migration history table:
  200. 1. Execute application to create database objects
  201. 2. Enable-Migrations
  202. 3. Make code change to POCO
  203. 4. Update-Database
  204. The workaround is to ensure code file is created:
  205. 1. Execute application to create database objects
  206. 2. Enable-Migrations
  207. 3. Make code change to POCO
  208. 4. Add-Migration (This step will create the necessary code migration file).
  209. 5. Update-Database
  210. Session Time Zone Hour Offset in ODP.NET Managed and Unmanaged Drivers
  211. ---
  212. ODP.NET managed and unmanaged drivers set the default session time zone differently. While the session time zone for
  213. unmanaged ODP.NET uses an hour offset, managed ODP.NET uses the region identifier for setting its session time zone.
  214. As a result, managed ODP.NET is sensitive to daylight savings in scenarios where the timestamp LTZ values have to be
  215. converted from/to the session time zone.
  216. There are two methods to resolve this difference if needed. For ODP.NET, Unmanaged Driver, the application explicitly
  217. sets the region identifier with the environment variable 'ORA_SDTZ' (e.g. 'set ORA_SDTZ = <Region ID>'). If ORA_SDTZ
  218. variable is set, Oracle Client considers this value as the session time zone. The second method is to execute an alter
  219. session command to set the session time zone property to the region identifier.
  220. ODP.NET, Managed Driver with NTS Authentication
  221. ---
  222. ODP.NET, Managed Driver supports NTS authentication to the database, except when the Windows domain is constrained to
  223. only support Kerberos-based domain authentication.
  224. ODP.NET, Managed Driver SSL Connections with Firewalls
  225. ---
  226. ODP.NET, Managed Driver SSL connections require a redirect to a dynamic port on the database server side. If a firewall
  227. exists between the database client and server, then all firewall ports must be enabled or the dynamic firewall port
  228. Oracle chooses must be enabled at run-time.
  229. ODP.NET, Managed Driver Tips, Limitations, and Known Issues
  230. ===========================================================
  231. This section contains information that is specific to ODP.NET, Managed Driver.
  232. 1. OracleConnection object's OpenWithNewPassword() method invocation will result in an ORA-1017 error with 11.2.0.3.0
  233. and earlier versions of the database. [Bug 12876992]
  234. 2. Stored functions/procedures in a PDB cannot be added to a .NET Entity Framework model. [Bug 17344899]
  235. Entity Framework Tips, Limitations, and Known Issues
  236. ====================================================
  237. This section contains Entity Framework related information that pertains to both ODP.NET, Managed Driver and ODP.NET,
  238. Unmanaged Driver.
  239. 1. Interval Day to Second and Interval Year to Month column values cannot be compared to literals in a WHERE clause of
  240. a LINQ to Entities or an Entity SQL query.
  241. 2. LINQ to Entities and Entity SQL (ESQL) queries that require the usage of SQL APPLY in the generated queries will
  242. cause SQL syntax error(s) if the Oracle Database being used does not support APPLY. In such cases, the inner exception
  243. message will indicate that APPLY is not supported by the database.
  244. 3. ODP.NET does not currently support wildcards that accept character ranges for the LIKE operator in Entity SQL
  245. (i.e. [] and [^]). [Bug 11683837]
  246. 4. Executing LINQ or ESQL query against tables with one or more column names that are close to or equal to the maximum
  247. length of identifiers (30 bytes) may encounter "ORA-00972: identifier is too long" error, due to the usage of alias
  248. identifier(s) in the generated SQL that exceed the limit.
  249. 5. An "ORA-00932: inconsistent datatypes: expected - got NCLOB" error will be encountered when trying to bind a string
  250. that is equal to or greater than 2,000 characters in length to an XMLType column or parameter. [Bug 12630958]
  251. 6. An "ORA-00932 : inconsistent datatypes" error can be encountered if a string of 2,000 or more characters, or a byte
  252. array with 4,000 bytes or more in length, is bound in a WHERE clause of a LINQ/ESQL query. The same error can be
  253. encountered if an entity property that maps to a BLOB, CLOB, NCLOB, LONG, LONG RAW, XMLTYPE column is used in a WHERE
  254. clause of a LINQ/ESQL query.
  255. 7. An "Arithmetic operation resulted in an overflow" exception can be encountered when fetching numeric values that
  256. have more precision than what the .NET type can support. In such cases, the LINQ or ESQL query can "cast" the value
  257. to a particular .NET or EDM type to limit the precision and avoid the exception. This approach can be useful if the
  258. LINQ/ESQL query has computed/calculated columns which will store up to 38 precision in Oracle, which cannot be
  259. represented as .NET decimal unless the value is casted.
  260. 8. Oracle Database treats NULLs and empty strings the same. When executing string related operations on NULLS or empty
  261. strings, the result will be NULL. When comparing strings with NULLs, use the equals operator (i.e. "x == NULL") in the
  262. LINQ query, which will in turn use the "IS NULL" condition in the generated SQL that will appropriately detect NULL-ness.
  263. 9. If an exception message of "The store provider factory type 'Oracle.ManagedDataAccess.Client.OracleClientFactory'
  264. does not implement the IServiceProvider interface." is encountered when executing an Entity Framework application with
  265. ODP.NET, the machine.config requires and entry for ODP.NET under the <DbProviderFactories> section. To resolve this
  266. issue by adding an entry in the machine.config, reinstall ODAC.
  267. 10. Creating a second instance of the context that derives from DbContext within an application and executing methods
  268. within the scope of that context that result in an interaction with the database may result in unexpected recreation of
  269. the database objects if the DropCreateDatabaseAlways database initializer is used.
  270. More Informations: https://entityframework.codeplex.com/workitem/2362
  271. Known Workarounds:
  272. - Use a different database initializer,
  273. - Use an operating system authenticated user for the connection, or
  274. - Include "Persist Security Info=true" in the connection string (Warning: Turning on "Persist Security Info" will cause
  275. the password to remain as part of the connection string).