使用 Visual Studio 和 Visual Studio Code 构建 .NET 应用程序

Oracle Autonomous AI Database on Dedicated Exadata Infrastructure 支持与 Microsoft .NET Framework、.NET Core、Visual Studio 和 Visual Studio Code 的连接。

Oracle Data Provider for .NET (ODP.NET) 提供对自治 AI 数据库的运行时 ADO.NET 数据访问。ODP.NET 具有以下驱动程序类型:

Oracle Developer Tools for Visual Studio 在 Visual Studio 中提供数据库应用程序设计时支持,包括用于在 Oracle Cloud 中管理自治 AI 数据库的工具。

Oracle Developer Tools for VS Code 在 Visual Studio Code 中提供数据库应用程序设计时支持。

这些软件组件可从以下站点免费下载:

Oracle 建议将新的提供商和工具版本与自治 AI 数据库结合使用。

设置指令

有关如何下载、安装和配置这些组件以与专用 Exadata 基础结构上的 Oracle Autonomous AI Database 一起使用的说明,请参阅为 Oracle Autonomous AI Database 开发 .NET Applications

请注意,这些说明显示了如何建立与数据库的 TCPS(使用 SSL 的 TCP)连接,这需要使用 wallet。对于专用基础结构上的数据库,您可以改为与数据库建立 TCP 连接,而数据库不需要使用 wallet。

要了解有关在专用 Exadata 基础结构和 .NET 上使用 Oracle Autonomous AI Database 的更多信息,请尝试免费的 .NET Development with Oracle Autonomous AI Database Quick Start 。本练习将引导您完成在 Oracle Cloud Infrastructure 上设置连接到自治 AI 数据库的 .NET Web 服务器。接下来,该实验室将指导开发和部署使用所有这些组件的简单 ASP.NET Core Web 应用程序。到最后,您将在互联网上有一个实时的工作网站。

配置以实现高可用性和高性能

在最新的 ODP.NET 版本中,通过连接字符串默认设置自动启用快速连接故障转移 (Fast Connection Failover,FCF) 和连接运行时负载平衡 (Connection Runtime Load Balancing,ROB)。FCF 需要连接字符串设置,Pooling (true) 和 HA Events (true)。RLB 需要设置,Pooling (true) 和 Load Balancing (true)。

应用程序连续性当前仅在非托管 ODP.NET 中可用。默认情况下,它通过连接池设置 "Application Continuity"(应用程序连续性)(true) 启用。

将 TCP 用于 ONS 连接时,无需进行其他配置。

ONS TCPS 需要根据所使用的提供程序进行一些配置和代码更改:

OracleConfiguration.OnsWalletLocation = @"<wallet-directory>";
<oracle.manageddataaccess.client>
  <version number="*">
    <onsConfig mode="remote">
      <settings>
        <setting name="Protocol" value="TCPS" />
        <setting name="WALLET_LOCATION" value="***<wallet-directory>***" />
      </settings>
      <ons database="***<database-name>***">
        <add name="nodeList" value="slcai611:6205,slcai610:6205,slcai612:6205" />
      </ons>
    </onsConfig>
    <settings>
      <setting name="WALLET_LOCATION" value="***<wallet-directory>***" />
    </settings>
  </version>
</oracle.manageddataaccess.client>
<oracle.unmanageddataaccess.client>
  <version number="*">
    <onsConfig mode="remote">
      <settings>
        <setting name="Protocol" value="TCPS" />
        <setting name="WALLET_LOCATION" value="***<wallet-directory>***" />
      </settings>
      <ons database="***<database-name>***">
        <add name="nodeList" value="slcai611:6205,slcai610:6205,slcai612:6205" />
      </ons>
    </onsConfig>
    <settings>
      <setting name="WALLET_LOCATION" value="***<wallet-directory>***" />
    </settings>
  </version>
</oracle.unmanageddataaccess.client>

相关内容