SSIS 事务 - 大型记录集

发布于 2024-07-22 08:14:44 字数 342 浏览 2 评论 0原文

我想知道SSIS如何处理大数据集的事务。 我有一个大约 150,000 行的“大型”数据集,每行都需要根据业务规则进行验证,作为从临时数据库到实时数据库的 ETL 的一部分。

如果任何记录不符合其业务规则,则任何记录都不应出现在实时数据库中(即回滚事务)。

我的问题是 SSIS 如何处理大型事务——或者可以吗? 如果最后一条记录不符合其空闲规则,它是否会处理输入 149,999 条记录,然后回滚全部记录? 或者是否有更好的最佳实践来执行此类大数据传输操作?

我当前的想法是在控制流级别处理序列容器内的每条记录,并在容器上启用事务设置。 所有验证都将在序列容器中完成,插入也将在此容器中完成。

I am wondering how SSIS deals with transactions with large data sets. I have a 'large' data set of about 150,000 rows, each of which needs to be validated against business rules as part of an ETL from a staging database to the live database.

If any of the records fail their business rules, no records should end up in the live database (i.e. rollback the transaction).

My question is how SSIS handles large transactions - or can it? Will it handle entering 149,999 records then roll the whole lot back if the last record fails its busiless rules? Or is there a better best-practice for performing this type of large data transfer operation?

My current thinking is to process each record within a sequence container at the control flow level, with the transcation settings enabled on the container. All validations will be done within the sequence container, and the insert will also be done in this container.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

今天小雨转甜 2024-07-29 08:14:44

SSIS 可以很好地处理事务。 它失败的地方是使用 MSDTC 对多个数据库或服务器进行事务(仍然有效,但有一些警告)。

您可以将数据流任务上的 TransactionOption 设置为“必需”。 这将强制 SSIS 将其注册到事务中。 同样,您可以将其他任务的TransactionOption设置为NotSupported(例如如果失败则更新状态表失败)。

您实际上无法处理序列容器中的每个记录(除非您多次循环数据流任务,这可能不是最好的方法)。 相反,我会将数据流置于所需的事务选项中,然后如果数据流中的任何记录失败并回滚整个事务,则任务应该失败。

SSIS can handle transactions reasonably well. Where it falls down is having transactions against multiple DBs or servers using MSDTC (still works, but there's some caveats).

You can set the TransactionOption on the Data Flow task to be Required. This will force SSIS to enroll it into a transaction. Likewise, you can put the TransactionOption of other tasks to be NotSupported (e.g. update status table to fail if it fails).

You can't actually process each record within a sequence container (unless you loop over a data flow task multiple times which probably not the best way). Instead, I'd put the Data Flow to transactionoption required, and then it should fail the task if any records fail in your data flow and rollback the whole transaction.

脱离于你 2024-07-29 08:14:44

我同意 Dane 的观点,只要有适当的基础设施来支持,SSIS 和 SQL Server 处理如此数量的事务应该没有问题。

I agree with Dane, SSIS and SQL server should have no problems with this amount of transactions provided there is appropriate infrastructure to support this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文