Skip to content
August 15, 2016 / doganay

ORA-32318: CANNOT RENAME A MATERIALIZED VIEW


Problem

SQL> alter MATERIALIZED VIEW mv1 rename to mv2
 alter MATERIALIZED VIEW mv1 rename to mv2
*
ERROR at line 1:
ORA-32318: cannot rename a materialized view


Solution

exec dbms_mview.refresh('MV1', 'C', atomic_refresh=>false);

create table mv2 as select * from mv1;

CREATE MATERIALIZED VIEW mv2
ON PREBUILT TABLE
REFRESH COMPLETE ON DEMAND
AS
select ...

drop MATERIALIZED VIEW mv1;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: