物化的变化

发布于 2024-10-02 17:12:43 字数 285 浏览 10 评论 0原文

我在一台服务器上有一个由数据库链接创建的物化视图。 该 Mview 上正在运行一项作业。 (之前使用 dbms_refresh.make 创建)。

现在我在原始表中创建了 3 个新字段。 我的疑问是。

1)我是否需要再次删除并创建Mview,如果是,我是否需要在主服务器上再次创建Mview日志 2)在 Mview 上运行的作业会发生什么情况,我需要重新创建它吗?

还有在Mview上创建的视图,所以 --如果我运行创建或替换视图查询,会产生任何问题吗?

请指导。

谢谢!

I have one Materialized view on one server which is created by DB link.
There is one job running on that Mview. (created with dbms_refresh.make earlier).

Now I have created 3 new fields in original table.
My queries are.

1) Do I need to drop and create Mview again, if yes, do i need to create Mview log on main server again
2) What happens to job running on Mview , do i need to create it agin?

Also there are views created on Mview ,so
--If i run create or replace view query , will it create any problem?

Please guide.

Thanks!

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

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

发布评论

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

评论(2

陪你到最终 2024-10-09 17:12:43

如果您需要在物化视图中包含新列,那么您需要重新创建物化视图。您必须显式删除视图,因为没有“创建或替换物化视图”语句。

DROP MATERIALIZED VIEW blah;
CREATE MATERIALIZED VIEW blah...

删除/重新创建物化视图应该重新创建刷新作业。不能 100% 确定,但您可能也应该重新创建日志。

而且,如果您不需要在视图中包含新列,那么您实际上不需要执行任何操作......

If you need to include the new columns in your materialized view then yes you need to re-create the materialized view. You must explicitly drop the view as there is no "create or replace materialized view" statement.

DROP MATERIALIZED VIEW blah;
CREATE MATERIALIZED VIEW blah...

Dropping/recreating the materialized view should re-create the refresh job. Not 100% certain, but you should probably recreate the log as well.

And, if you don't need to include the new columns in your view, you really don't need to do anything...

风尘浪孓 2024-10-09 17:12:43

删除/创建物化视图后,您应该重新编译其他视图,因为它们可能已变得无效。

来检查是否发生了这种情况

select * 
from user_objects
where status = 'INVALID';

您可以通过重新编译视图

alter view the_view compile;

,或者

exec dbms_utility.compile_schema(user);

这只是重新编译架构中的所有内容。执行此操作时请确保没有正在运行的作业!

After dropping/creating the materialized view, you should recompile the other views afterwards, because they may have become invalid.

You can check if that happened with

select * 
from user_objects
where status = 'INVALID';

Recompile a view can be done with

alter view the_view compile;

or

exec dbms_utility.compile_schema(user);

This simply recompiles everything in your schema. Be sure to have no running jobs while doing this!

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