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.
I understand it starts something like: ALTER MATERIALIZED VIEW view_name ...
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:
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 view but keep the backing table:
drop materialized view view_name preserve table;
This is obviously more radical. And view_name
will now just be an ordinary table, essentially as if you'd done create table view_name as <view query>
.