Oracle 物化视图与同一数据库服务器上的复制
我们需要在一天中的预定时间运行报告。 该应用程序 24*7 运行,因此不存在“非高峰”时间。
因此,运行报告不应给系统增加过度的负载。
该应用程序运行在WebSphere v6.1上,数据库是Oracle 10g R2。
我可以使用以下方法
- 一组旨在报告的非规范化表格。
- 创建物化视图并将其用于报告。 我们可以每天更新一次视图。
- 我们可以创建另一个模式并使用 Oracle 的 Data Guard 实时复制表。
由于我们有某些内部限制,(1)是不可行的。
我需要知道,从性能的角度来看,(2)或(3)哪个更好?
我从许多人那里听说物化视图最初工作得很好,但随着数据量的增加, 性能很差。
任何人都有在同一数据库服务器中复制表的经验(但差异实例或模式)。
We need to run reports at a scheduled time of the day.
The application runs 24*7 and so there is not "off-peak" time as such.
Therefore, running the reports should not add undue load on the system.
The application runs on WebSphere v6.1 and the database is Oracle 10g R2.
I have the following approaches at my disposal
- A set of de-normalized tables aimed at reporting.
- Creating Materialized views and using them for reports. We can update the views once a day.
- We can create another schema and replicate the tables realtime using Oracle's Data Guard.
(1) is not feasible due to certain internal constraints we have.
I need to know, from a performance point of view, which is better, (2) or (3) ?
I hear from many ppl that Materialized views initially work well but as data volumes increase, the
performance is very poor.
Anyone has experience with Replication of tables within the same DB server (but diff instances or schemas).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在某种程度上,物化视图是非规范化的表 - 非规范化是您可以在 SELECT 语句中定义的任何内容,例如联接、聚合和分析函数。 在 MV 的原始定义之后,您可以向基础 MV 表添加获得所需性能所需的任何索引。
话虽如此,我认为您的选择是:
To some degree, materialized views are denormalized tables - the denormalization is whatever you can define in a SELECT statement, e.g. joins, aggregations, and analytic functions. After the original definition of the MV, you can add whatever indexes to the underlying MV table that are necessary to gain the performance you need.
Having said that, I think your options are:
最好的选择是在另一台计算机上使用另一个Data Guard实例(不是模式,它没有意义)。 在这种情况下,您可以拥有最新的数据库,而不会干扰生产应用程序。
如果刷新不会产生大量资源使用,那么使用物化视图是很好的选择。 而且如果针对物化视图的查询也不会浪费太多资源。
您没有谈论的第三个选项是使用 Oracle Resource Manager 它允许您通过多种可能性控制资源使用。
无论如何,我更喜欢第一个(Data Guard),因为您同时拥有“报告数据库”和“实时备份”。
The best option is to use another Data Guard instance (not schema, it have no sense) on another machine. In this case you can have an up-to-date database an no disturb the production application.
About using materialized views is good if the refresh does not produce a lot of resources usage. And if the queries against materialized views also doesn't waste too many resources.
A third option you don't talk about is to use Oracle Resource Manager which allows you to control the resources usage with a lot of possibilities.
Anyway, I prefer the first one (Data Guard) because you have a "Report dabatase" a "live- backup" on the same time.