2

我正在运行一个 DTSX 包,使用 PGOLEDB Native Postgres 驱动程序将数据从 SQL 移动到 Postgres,我收到一个错误(如下)。如何阅读此错误并确定导致问题的行/列?

我收到以下错误(PGNP-SE-1.4.3076):

OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".

OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".

OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.

OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.

更新: 我认为编码错误是一个红鲱鱼。当我运行它时,它在第 1000 行失败(成功写入 999 行)。如果我将源更改为将结果限制为少于 1000 行(例如 500 行)的视图,它会成功(但显然并非所有数据都被移动)。如果我将目标连接字符串更改为 BULK_INSERT=500...它将在第 500 行失败,如果我将视图更改为小于 500,它将成功。

更新 2: 将 BULK_INSERT 设置为 0 可以解决问题……我确信这会对性能产生负面影响。

4

1 回答 1

2

确定哪些行对错误负责的一种快速方法是将错误行为从默认的“失败组件”更改为“重定向行”,然后将错误输出通过管道传输到平面文件。

在此处输入图像描述

对于您的特定错误,关键信息是:

“错误:编码“UTF8”的字节序列无效:0x96

谷歌搜索这个字符串会带回一些命中,表明存在字符串编码问题。 这是从 google-results 返回到 stackoverflow 的链接。

您可以尝试使用数据转换任务在数据流任务中指定正确的编码,或者您可以在目标系统上进行调整(但我对 Postgres 不太熟悉,因此无法帮助您

于 2012-10-07T19:32:23.693 回答