Oracle 禁用物化视图刷新

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35730056/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:10:39  来源:igfitidea点击:

Oracle Disable Materialized View Refresh

oraclematerialized-views

提问by Jeff

Anyone have the syntax to disable the refresh of a materialized view in Oracle? I struggle with the Oracle documentation and I'm not finding an online example.

任何人都有禁用 Oracle 中物化视图刷新的语法?我在 Oracle 文档中苦苦挣扎,但找不到在线示例。

I understand it starts something like: ALTER MATERIALIZED VIEW view_name ...

我知道它的开头类似于:ALTER MATERIALIZED VIEW view_name ...

回答by Alex Poole

If it is currently set to refresh on commit, you can change it to refresh on demand, which means you need to explcitly refresh it via dbms_mview, with:

如果它当前设置为在提交时刷新,您可以将其更改为按需刷新,这意味着您需要通过 显式刷新它dbms_mview,使用:

alter materialized view view_name refresh on demand;

This seems fairly clear in the documentation.

在文档中似乎相当清楚。

If you really want to permanently disable refresh, even manually, so you're left with the current contents and they can not be updated from the view query, you can drop the materialized viewbut keep the backing table:

如果你真的想永久禁用刷新,即使是手动,所以你只剩下当前内容并且它们不能从视图查询中更新,你可以删除物化视图但保留后备表:

drop materialized view view_name preserve table;

This is obviously more radical. And view_namewill now just be an ordinary table, essentially as if you'd done create table view_name as <view query>.

这显然更为激进。而view_name现在只是一个普通的表,基本上,如果你做这些create table view_name as <view query>