
适用范围:
SQL Serversql server和oracle,包括 Linux
Azure SQL
Azure SQL 数据仓库
并行数据仓库 APPLIES TO:
SQL Server, including on Linux
Azure SQL Database
Azure SQL Data Warehouse
Parallel Data Warehouse
本主题介绍怎么从 SQL Server 导入和导出向导的“选择数据源”或“选择目标”页连接到 Oracle 数据源 。This topic shows you how to connect to an Oracle data source from the Choose a Data Source or Choose a Destination page of the SQL Server Import and Export Wizard. 有多种数据提供程序可用来连接 Oracle。There are several data providers that you can use to connect to Oracle.
重要
此 Microsoft 文章不包括 Oracle 连接相关具体规定和先决条件。The detailed requirements and prerequisites for connecting to an Oracle database are beyond the scope of this Microsoft article. 本文假定已安装 Oracle 客户端软件,并且可以顺利连接目标 Oracle 。This article assumes that you already have Oracle client software installed and that you can already connect successfully to the target Oracle database. 有关详细信息,请咨询 Oracle 管理员或参阅 Oracle 文档。For more info, consult your Oracle database administrator or the Oracle documentation.
在向导的“选择数据源”页或“选择目标”页上选择用于 Oracle 的 .NET Framework 数据提供程序期间,页面显示用于提供程序的选项的分组列表 。After you select .NET Framework Data Provider for Oracle on the Choose a Data Source or Choose a Destination page of the wizard, the page presents a grouped list of options for the provider. 其中许多是不友好名称和不熟悉的设定。Many of these are unfriendly names and unfamiliar settings. 幸运的是,只需提供两条或三条信息。Fortunately, you only have to provide two or three pieces of information. 可以忽视其它设定的默认值。You can ignore the default values for the other settings.
备注
无论 Oracle 是源而是目标,此数据提供程序的连接选项都同样。The connection options for this data provider are the same whether Oracle is your source or your destination. 也就是说,在向导的“选择数据源”页和“选择目标”页上发现的选项是同样的 。That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

必填信息Required info用于 Oracle 的 .Net Framework 数据提供程序属性.Net Framework Data Provider for Oracle property
服务器名称Server name
身份验证(登录)信息Authentication (login) info
“用户 ID”和“密码”或“集成安全性” User ID and Password; or, Integrated Security
无须在列表的“ConnectionString”字段中键入连接字符串 。You don't have to enter the connection string in the ConnectionString field of the list. 为 Oracle 服务器名称(“数据源”)输入单个值和注册信息后,向导会按照单个属性以及值组合出连接字符串 。After you enter individual values for the Oracle server name (Data Source) and login info, the wizard assembles the connection string from the individual properties and their values.

ODBC 驱动程序不在数据源的下拉列表中列举。ODBC drivers aren't listed in the drop-down list of data sources. 要使用 ODBC 驱动程序连接,请首先在“选择数据源”页或“选择目标”页上选择“用于ODBC 的 .NET Framework 数据提供程序”作为数据源 。To connect with an ODBC driver, start by selecting the .NET Framework Data Provider for ODBC as the data source on the Choose a Data Source or Choose a Destination page. 此提供程序充当 ODBC 驱动程序的包装器。This provider acts as a wrapper around the ODBC driver.

下面是选用用于 ODBC 的 .NET Framework 数据提供程序后立即显示的常规屏幕。Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.

备注
无论 Oracle 是源而是目的地,此数据提供程序和 ODBC 驱动程序的连接选项是同样的。The connection options for this data provider and ODBC driver are the same whether Oracle is your source or your destination. 也就是说,在向导的“选择数据源”页和“选择目标”页上发现的选项是同样的 。That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.
若要使用用于 Oracle 的 ODBC 驱动程序连接到 Oracle,请组合出一条包含下列设定以及值的连接字符串。To connect to Oracle with the ODBC Driver for Oracle, assemble a connection string that includes the following settings and their values. 完整连接字符串的格式紧跟在修改列表以后。The format of a complete connection string immediately follows the list of settings.
提示
获取有关组合出恰当连接字符串的帮助。Get help assembling a connection string that's just right. 或提供现有 DSN(数据源名称)或新建一个,而不是提供连接字符串。Or, instead of providing a connection string, provide an existing DSN (data source name) or create a new one. 有关这些选项的详尽信息sql server和oracle,请参看连接到 ODBC 数据源。For more info about these options, see Connect to an ODBC Data Source.

驱动程序 Driver
用于 Oracle 的 Microsoft ODBC 驱动程序的名称。The name of the ODBC driver, Microsoft ODBC for Oracle.
ServerServer
Oracle 服务器的名称。The name of the Oracle server.
Uid 和 Pwd Uid and Pwd
要连接的用户 ID 和密码。The user id and password to connect.
以下是典型连接字符串的格式。Here's the format of a typical connection string.

```
Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;Pwd=myPassword;
```
在“选择数据源”页或“选择目标”页上的“ConnectionString”字段中键入连接字符串,或在“Dsn”字段中键入 DSN 名称。Enter the connection string in the ConnectionString field, or enter the DSN name in the Dsn field, on the Choose a Data Source or Choose a Destination page. 输入连接字符串后,向导会预测该字符串,并在列表中显示各个属性以及值。After you enter the connection string, the wizard parses the string and displays the individual properties and their values in the list.
下面是输入连接字符串后出现的屏幕。Here's the screen that you see after entering the connection string.

运行下面查询之一以获得 Oracle 服务器名称。Run one of the following queries to get the name of your Oracle server.
SELECT host_name FROM v$instance
或多个or
SELECT sys_context('USERENV','SERVER_HOST') FROM dual
有关如何使用这里未列举的数据提供程序连接到 Oracle 的详尽信息,请参看 Oracle 连接字符串。For info about how to connect to Oracle with a data provider that's not listed here, see Oracle connection strings. 此第三方网站还包括有关此页介绍的数据提供程序和连接参数的具体信息。This third-party site also contains more info about the data providers and the connection parameters described on this page.
选择数据源Choose a Data Source
选择目标Choose a Destination
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-124458-1.html
所有的朋友们一起都来
太他妈丑了
再来击沉