对连接管理器的AcquireConnection方法调用失败,错误代码为0xC001A004

时间:2017-03-16 02:38:39

标签: sql-server ssis sql-server-2014 snapshot isolation-level

我在Visual Studio 2013中使用SQL Server 2014和SSIS。 我需要在一个OLTP数据库(这里是我的目标数据库)中使用我的一个SSIS包在一些表中进行一些更改,有时需要花费大量时间来执行,并且在此期间它会锁定OLTP数据库中的一些表我不能再使用与OLTP数据库兼容的may应用程序了。

在我的包装运行一天之前,它是在午夜,但现在我们决定每隔30分钟运行一次这个包裹。

我需要在OLTP数据库中使用快照隔离级别,以确保SSIS包不会长时间锁定表。

首先,我想使用IsolationLevel等于快照,但它不起作用。 enter image description here

然后我发现我应该在ControlFlow中手动处理Isolation leve以使用隔离快照。

我创建了一个示例,因为我真正的SSIS包非常庞大。

我创建了一个数据库然后,我已将Allow snapshot isolation设置为true。

enter image description here

之后我创建了一个SSIS包,其中包含以下变量:

enter image description here

然后我创建了一个像这样的控制流:

enter image description here

在第一个SQL执行任务中,我运行了这个命令:

SET TRANSACTION ISOLATION LEVEL SNAPSHOT

然后在第二个SQL执行任务中,我启动了一个事务:

BEGIN TRANSACTION

然后我添加了一个Dataflow任务。在我的DataFlow任务中有两个OLE DB。一个是源,另一个是目的地。

enter image description here

源和目标都位于同一服务器和不同的数据库中。

然后我改变了Connection Manager的属性,如下所示:

enter image description here

然后我在我的电脑上安装并配置了MSDTC。 (Source和Destination都在同一台服务器上,而ssis包在同一台服务器上运行)。

enter image description here

然后我按照这样配置我的服务:

enter image description here

然后在我的防火墙中,我可以像这样访问MSDTC:

enter image description here

然后我配置了防火墙的高级配置:

enter image description here

enter image description here

我的SSIS包中的所有任务都具有IsolationLevel和TransactionOption的这些配置:

enter image description here

我的控制流程具有以下配置:

enter image description here

当我运行包时,我在OLE DB目的地中收到此错误。

enter image description here

[OLE DB Destination [2]] Error: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  
The AcquireConnection method call to the connection manager 
".<ServerName>.<DatabaseName>" failed with error code 0xC001A004.  
There may be error messages posted before 
this with more information on why the AcquireConnection method call failed.

[SSIS.Pipeline] Error: 
OLE DB Destination failed validation and returned error code 0xC020801C.

如果能够将事务和隔离级别手动设置为SSIS包中的快照,我该怎么办?

0 个答案:

没有答案
相关问题