SSMA无法找到指定的提供者

时间:2019-01-03 10:18:49

标签: oracle odac sql-server-migration-assi

我已经安装了完整的oracle客户端12.2.0,并且我尝试使用SSMA将一些数据库从oracle迁移到sql服务器,但是当我尝试连接到oracle时,出现以下错误:

Unable to find specified provider.
Compatible Oracle Data Access Connectivity libraries were not found on the machine.

我已经设置了环境变量HOME_ORACLE,并且在安装过程中默认设置了PATH,所以我排除了问题所在。 我还搜索了有关ODAC的信息,所有提示都使我想起了oracle istant提供程序,但是由于我使用管理员安装(完整)安装了客户端,因此我认为该安装也将涵盖它们。 有什么建议吗?

编辑:我尝试使用标准模式和tnsnames模式登录,但结果相同

1 个答案:

答案 0 :(得分:1)

看起来Oracle Universal Installer 12.2中有一个错误,它没有注册ODP.NET组件。您可以在下面运行脚本(根据系统修改文件夹名称)以正确配置它们。

set Oracle_x64=c:\oracle\product\12.1\Client_x64\odp.net
set OraProvCfg_x64=%Oracle_x64%\bin\4\OraProvCfg.exe

set Oracle_x86=c:\oracle\product\12.1\Client_x86\odp.net
set OraProvCfg_x86=%Oracle_x86%\bin\4\OraProvCfg.exe

set TNS_ADMIN=C:\oracle\network\admin



IF EXIST "%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll
IF EXIST "%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.121.Oracle.ManagedDataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.121.Oracle.ManagedDataAccess.dll
IF EXIST "%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.122.Oracle.ManagedDataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.122.Oracle.ManagedDataAccess.dll

IF EXIST "%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll" "%OraProvCfg_x64%" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%
IF EXIST "%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll" "%OraProvCfg_x86%" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%

rem Oracle.ManagedDataAccessDTC was used in earlier versions, not used anymore
"%OraProvCfg_x64%" /action:ungac /providerpath:Oracle.ManagedDataAccessDTC

IF EXIST "%Oracle_x64%\bin\2.x\Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\bin\2.x\Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\2.x\Policy.2.102.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\2.x\Policy.2.102.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\2.x\Policy.2.111.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\2.x\Policy.2.111.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\2.x\Policy.2.112.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\2.x\Policy.2.112.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\2.x\Policy.2.121.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\2.x\Policy.2.121.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\2.x\Policy.2.122.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\2.x\Policy.2.122.Oracle.DataAccess.dll

IF EXIST "%Oracle_x64%\bin\4\Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\bin\4\Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\4\Policy.4.112.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\4\Policy.4.112.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\4\Policy.4.121.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\4\Policy.4.121.Oracle.DataAccess.dll
IF EXIST "%Oracle_x64%\PublisherPolicy\4\Policy.4.122.Oracle.DataAccess.dll" "%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\PublisherPolicy\4\Policy.4.122.Oracle.DataAccess.dll

IF EXIST "%Oracle_x86%\bin\2.x\Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\bin\2.x\Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\2.x\Policy.2.102.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\2.x\Policy.2.102.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\2.x\Policy.2.111.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\2.x\Policy.2.111.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\2.x\Policy.2.112.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\2.x\Policy.2.112.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\2.x\Policy.2.121.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\2.x\Policy.2.121.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\2.x\Policy.2.122.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\2.x\Policy.2.122.Oracle.DataAccess.dll

IF EXIST "%Oracle_x86%\bin\4\Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\bin\4\Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\4\Policy.4.112.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\4\Policy.4.112.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\4\Policy.4.121.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\4\Policy.4.121.Oracle.DataAccess.dll
IF EXIST "%Oracle_x86%\PublisherPolicy\4\Policy.4.122.Oracle.DataAccess.dll" "%OraProvCfg_x86%" /action:gac /providerpath:%Oracle_x86%\PublisherPolicy\4\Policy.4.122.Oracle.DataAccess.dll

更新

根据Oracle Doc ID 2272241.1,这似乎是出于故意:

  

适用于:
  适用于.NET的Oracle数据提供程序-版本12.1.0.2及更高版本
  Microsoft Windows x64(64位)
  Microsoft Windows(32位)

     

症状
  在安装12.2 Oracle Data Provider for .Net时,该提供程序   不会自动在全局程序集缓存(GAC)中注册。

     

更改
  移至Oracle Provider for .Net的12.2版

     

原因
  这是预期的行为。由于使用了许多环境   从12.2开始,ODP.Net的多个版本并排   安装程序不会在以下位置自动注册ODP.Net提供程序:   默认情况下为GAC。

     

解决方案
  如Doc ID中所述将dll手动注册到GAC中   1169890.1:HOWTO:使用OraProvCfg.exe从全局程序集缓存中添加/删除Oracle程序集的示例使用

但是,我认为这是一个错误。并行运行ODP.Net的多个版本是非常困难的,因为Oracle.DataAccess.dll的版本必须完全匹配Oracle Client的版本。安装多个Oracle客户端(即,对于64位和32位,每个客户端都安装多个)通常会导致很多问题,而且很少见。