记录 MySQL DELETE 语句

发布于 2024-07-27 21:26:41 字数 406 浏览 6 评论 0原文

我们有一个使用 Informatica 的 MySQL->Oracle ETL,它适用于除 DELETE 之外的所有语句。 不幸的是,DELETE 会使记录消失,这样 Informatica 就再也看不到它,从而在 Oracle 中将其删除/过期。

人们如何记录 MySQL DELETE 语句?

这些表是 InnoDB(符合 ACID),所有记录上都有唯一的主键(auto_increment)。 我们在 Windows 上使用开源 MySQL。

出于性能原因,我们不希望使用通用查询日志。 我们还希望保留现有的 MySQL 二进制文件,而不是重新编译我们自己的特殊 DELETE 语句。

We have a MySQL->Oracle ETL using Informatica that works great for all statements except DELETE. Unfortunately, the DELETE makes the record go away such that Informatica never sees it again to remove/expire it in Oracle.

How have people gone about recording MySQL DELETE statements?

The tables are InnoDB (ACID-compliant) with unique primary keys on all records (auto_increment). We're using the open-source MySQL on Windows.

We'd prefer not to use a general query log for performance reasons. We'd also prefer to keep the stock MySQL binary and not recompile our own special DELETE statement.

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

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

发布评论

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

评论(1

高速公鹿 2024-08-03 21:26:41

一个可能的解决方案是永远不要从数据库中删除任何内容。 我避免从数据库中删除,因为这样信息就会永远丢失。 我更喜欢通过向表中添加适当的列来将信息标记为无效或过时。

另一个类似的解决方案是使用 trigger 插入记录您想要删除到审核表中,然后删除该信息。 使用 Informatica 的插入在 Oracle 端执行相同的操作。

A possible solution is to never delete anything from your database. I avoid deleting from the database because then the information is lost forever. I prefer to mark information as invalid or obsolete by adding an appropriate column to the table.

Another similar solution is to use a trigger to insert the record you want to delete into an audit table and then delete the information. Use the insert with Informatica to do the same thing on the Oracle side.

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