暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 基准汇总处理技术

ASKTOM 2020-01-14
163

问题描述

我有一个包,负责处理来自明细表的数据。All query logic and other parameters that is used to process data is stored inside a table,它充当配置表 (在LiveSQL中提供了配置表的示例)。

当包执行时,它将
1。从配置表中提取SQL字符串和其他config参数
2。修改SQL字符串中的参数
3。使用运行SQLExecute Immediate
4。 Log execution & exception
5。 Loop again from step 1 using next record in config table

The reason this method of storing SQL logic and other parameters inside a table is adopted, was to gain easy control of incremental loading and data re-processing when data warehouse tables are out of sync with production tables。

我的问题是:
1。 Would this configuration table method of data processing be conventional and acceptable to use in production ?。
2。 What are some pros and cons
2。 What would be some suggestions and industry standard methods for summary data processing? (Can i get a reference or link that demonstrates some data processing techniques ?)。


专家解答

虽然我通常是数据驱动应用程序的粉丝,但对我来说,这是一个太远的步骤。它使它易于执行最常见的攻击之一:

SQL Injection

您的执行SQL保存在一个表中。因此,任何对表具有写访问权限的人都可以输入自己的语句!

这很糟糕。真的很糟糕。

即使您进行了检查以降低这种风险,我仍然不是粉丝。

我看到你的例子中有删除。您将如何确保这些删除正确的行?

不小心/邮寄地输入错误的where子句太容易了。清除大量数据。

所以我会避免这种方法。

What would be some suggestions and industry standard methods for summary data processing?

我不知道你在问什么。但是,如果您可以编写生成摘要的SQL查询,您希望Oracle数据库有一个很好的方法来优化这些:

物化视图

存储您的查询结果。如果将数百万行汇总到几行 (例如周/月/年总计),则可以使过程更快。


文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论