Materialised views Syntax

Materialised views Syntax
============================

— Create the tale first. This could be populated
— using an export/import.
CREATE TABLE emp_mv AS
SELECT * FROM emp@db1.world;

— Build the materialized view using the existing table segment.
CREATE MATERIALIZED VIEW emp_mv
REFRESH FORCE
ON DEMAND
ON PREBUILT TABLE
AS
SELECT * FROM emp@db1.world;

============================

Remember to gather stats after building the materialized view.
————————————————————————–

BEGIN
DBMS_STATS.gather_table_stats(
ownname => ‘SCOTT’,
tabname => ‘EMP_MV’);
END;
/

==============================================

Create Materialized View Logs
====================================

CONNECT scott/tiger@db1

CREATE MATERIALIZED VIEW LOG ON scott.emp
TABLESPACE users
WITH PRIMARY KEY
INCLUDING NEW VALUES;


Betting site http://cbetting.co.uk more info for Coral Offers

Support Us?

Our only Source of Income via clicking Ads.Click our Web Ads to help our Community!




Like us in Facebook!

Love Our Articles?

Follow us in Facebook to find our Latest Stuff!

Powered by WordPress Popup