了解 Oracle 数据库和 ODAC 安装
我想在我的 ASP.NET MVC 项目中使用 Oracle XE DB。我在运行 VS 的同一台机器上安装了 Oracle 11g XE。安装在 C:\oraclexe 中成功完成。一切如预期,我能够使用默认的 .NET oracle 数据访问提供程序通过服务器资源管理器连接到数据库。但我想使用 ODP.NET,所以我在 C:\app 中安装了 ODP.NET + ODT。这是第一个令人困惑的事情。 C:\oraclexe..\server 和 C:\app..\client_1 的目录结构类似。两者都有 Tnsnames.ora 所在的 NETWORK\ADMIN 文件夹。我知道客户端用于连接数据库,但是:
- 哪个 Tnsname.ora 将用于连接数据库?
- Oraclexe 还包含 Oracle.DataAccess.dll 所在的 odp.net 文件夹。如果服务器安装附带 odp.net 为什么我需要安装 ODAC?仅在 ODAC 安装后,VS 中的服务器资源管理器才向我提供用于连接的 ODP.NET 驱动程序。
- ODAC 附带 Oracle Instant Client。何时使用 Oracle 客户端,何时使用 Oracle Instant Client?如果我决定使用 Oracle 客户端,然后安装 ODAC 进行连接,它还会安装作为 ODAC 一部分的 Instant Client 吗?
- 最后安装服务器和客户端后,VS 2010 仍然没有在 ASP.NET 配置中为我提供 Oracle Providers
I want to use Oracle XE DB in my ASP.NET MVC project. I installed Oracle 11g XE on same machine where is VS running. Installation completed succesfully in C:\oraclexe. Everything as expected, i was able to connect to DB via Server Explorer using default .NET oracle data acces provider. But i want to use ODP.NET, so i installed ODP.NET + ODT in C:\app. Here is first confusing thing. Directory structure of C:\oraclexe..\server and C:\app..\client_1 is similar. Both have NETWORK\ADMIN folder where Tnsnames.ora resides. I understand that client is used to connect to database but:
- Which Tnsname.ora will be used to connect to database?
- Oraclexe also contains odp.net folder where Oracle.DataAccess.dll resides. If server installation come with odp.net why i need to install ODAC? Server Explorer in VS offered me ODP.NET drivers for connection only after ODAC install.
- ODAC comes with Oracle Instant Client. When to use Oracle Client and when Oracle Instant Client? If i decide for Oracle Client and then i will install ODAC for connection, will it also install Instant Client which is part of ODAC?
- Finally after installation of server and client, VS 2010 still does not offer me Oracle Providers in ASP.NET Configuration
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Oracle XE 有点特殊,因为您通常将服务器和客户端安装在同一台计算机上。从逻辑上讲,它们是分开的,但这确实使事情变得有点难以理解。因此,我会参考其他专家的意见。
ORAFAQ 的人员拥有有关 TNSNAMES.ORA 文件的信息。 我个人的策略是使我的所有 TNSNAMES.ORA 文件相同,这样就不会有混淆的机会。
ODP.NET 用于...
.NET
使用,而 ODAC 是“本机”(OLE),并且提供了比仅使用 ODP.NET 所能提供的更多工具。使用任何适合您需求的工具。在大多数情况下,您将分发即时客户端。完整客户端对于开发人员来说更有用。请参阅文档和常见问题解答了解详细信息。您可以在一台计算机上拥有多个客户端,因此我不确定问题是什么。
重启机器?您是否已将适当的库添加到您的环境中?
Oracle XE is kinda special in that you typically install the server and client on the same machine. Logically, they are separate, but it does make things a bit harder to understand. For that reason, I will refer to other experts.
The folks at ORAFAQ have information about the TNSNAMES.ORA file. My personal strategy is to make all my TNSNAMES.ORA files the same, so there is no opportinity for confusion.
ODP.NET is for...
.NET
use, while ODAC is "native" (OLE) and provides more tools than you may have with just ODP.NET. Use whatever works for your needs.For most cases, you would distribute the Instant Client. The Full Client is more useful for developers. Refer to the documentation and FAQs for details. You can have multiple clients on one machine, so I'm not sure what the problem is.
Restart the machine? Did you add the appropriate library/libraries to your environment?