Skip to content
January 29, 2016 / doganay

CREATING AN EMPTY MATERIALIZED VIEW

CREATE MATERIALIZED VIEW mv1
--TABLESPACE tbs1
parallel 32
--this is the part that creates mv empty
BUILD deferred
USING INDEX
REFRESH FORCE
--refresh fast
--refresh full
START WITH sysdate+1/24
NEXT sysdate+1/24
WITH PRIMARY KEY
--WITH ROWID
AS
--it is important not to use *
--the are a few bugs on this
--so, only use columns you need:
SELECT col1 from t1;



--You must full refresh your mv afterwards:
exec dbms_mview.refresh('mv1','C');

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: