使用SSIS将数据从MySQL传输到SQL Server时出现超时问题
我正在尝试使用 SSIS 将 67,714,854 行从 MySQL 传输到 SQL Server 。传输 14,282,990 行后,包超时。我也将超时属性更改为 0,但这没有帮助。
我该如何解决这个问题?
I am trying to transfer 67,714,854 rows from MySQL to SQL Server using SSIS. The package times out after transferring 14,282,990 rows. I changed the time out property to 0 also, but that didn't help.
How do I resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了一个解决方案。这就是在查询结束时有一个限制。我在使用 ADO .NET 连接连接到 MySQL 时遇到了同样的问题。虽然并不能解决问题。它至少可以完成工作。
SSIS:2208 R2。
MySQL:5.0
I found a hacky solution to it. And that is having a limit at the end of your query. I was facing the same problem with ADO .NET connection to connect to MySQL. Although it doesn't solve the problem. It atleast get the work done.
SSIS: 2208 R2.
MySQL: 5.0
在 OLE DB 目标连接上,您选择了哪种“数据访问模式”。如果您选择了“表或视图 - 快速加载”(这是默认设置),则会指定“最大插入提交大小”。您可以尝试以下两种方法之一:1)将提交大小更改为更大的数字;或 2) 尝试其他数据访问模式“Table 或 vew”。由于您遇到超时错误,我怀疑选项 1 可能没有帮助(因为您已经获得了较小值的超时),因此请尝试选项 2。虽然这可能会导致性能下降,但实际上可能会完成成功地。 (然后您可以尝试@Siva 的方法并将输出拆分到多个目的地以提高性能)。
(注意:我指的是 SQL Server 2008 R2 中可用的内容,如果您使用的是以前的版本,可能会略有不同)
如果上述方法都不起作用,您还可以尝试从头开始创建一个新的 SSIS 包运行 SQL Server 导入向导(在 SQL Server Management Studio 中右键单击数据库并选择“任务/导入数据”。按照向导屏幕进行操作,并在接近尾声时确保选中“保存 SSIS 包”框,然后选择文件位置将其保存到。通常,生成的 SSIS 包将是一个功能包(然后您还可以对其进行任何您喜欢的进一步修改)。
On your OLE DB Destination connection, what "Data access mode" have you selected. If you have selected "Table or view - fast load" (this is the default), then there will be a "Maximum insert commit size" specified. You can try one of two things: 1) change the commit size to a larger number; or 2) try the other data access mode "Table or vew". Since you're getting a timeout error, I suspect that option 1 may not help (since you're already getting a timeout with a smaller value), so try option 2. Although that will likely result in slower performance, it may actually complete successfully. (You could then try @Siva's approach and split the output across multiple destinations to improve performance).
(Note: I'm referring to what's available in SQL Server 2008 R2, if you're using previous versions, it may be slightly different)
If none of the above work, you could also try to create a new SSIS package from scratch by running the SQL Server Import Wizard (right-click on your database in SQL Server Management Studio and select Tasks/Import Data. Follow the wizard screens and near the end make sure you check the box to Save the SSIS package, and choose a file location to save it to. Typically, the resulting SSIS package will be a functional package (and then you can also make whatever further modifications you like to it).
MySQL 是否给您提供了错误,或者您是否使用 PHP(或其他语言)来传输数据并且该超时?对于后者,在 PHP 中,您可以使用以下方法将脚本超时设置为无限:
无论哪种方式,根据给出的信息,我不确定它是什么类型的数据库,但通常我会设置一个 cron 脚本逐位传输数据,以将负载保持在可接受的水平。请提供更多信息...
Does MySQL give you the error or are you using PHP (or another language) to transfer the data and does that timeout? In the case of the latter, in PHP you can set the script timeout to infinite using this:
Either way, based on the information given, I'm not sure what type of database it is, but typically I would set up a cron script to transfer the data bit by bit in order to keep the load at an acceptable level. Please give more information...