我正在运行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可以解决问题...我确信这会对性能产生负面影响。
答案 0 :(得分:0)
确定哪个行导致错误的快速方法是从默认的“失败组件”到“重定向行”的错误行为,然后将错误输出通过管道传输到平面文件。
对于您的特定错误,关键信息是:
“错误:用于编码的无效字节序列”UTF8“:0x96
谷歌这个字符串会带来一些点击指示字符串编码问题。来自google-results的Here's a link返回stackoverflow。
您可以尝试使用数据转换任务在数据流任务中指定正确的编码,或者您可以在目标系统上进行调整(但我对Postgres并不熟悉,所以无法帮助您)