Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Materialized Views - Overall Approach/Steps - for review

Materialized Views - Overall Approach/Steps - for review

From: VIVEK_SHARMA <VIVEK_SHARMA_at_infosys.com>
Date: Fri, 2 Sep 2005 12:43:17 +0530
Message-ID: <B5587533FCBD4344ADB8290B3EDDA12208AF90F9@kecmsg14.ad.infosys.com>


Jared,Tim, Folks  

Following is our overall approach/Steps of transfer of DB from SUN to AIX using MV for your review.  

At Source/Master DB:-



scott_at_ORA9IR1> alter table emp add constraint emp_pk   2 primary key ( empno );  

Table altered.  

(Since Unique indexes already PRE-Exist, above PK creation will be very Fast)  

scott_at_ORA9IR1> create materialized view log on emp;  

Materialized view log created.  

At Target / Slave DB:-



ops$tkyte_at_ORA9IR2> create table emp as select * from emp_at_ora9ir1 where 1=0;  

Table created.  

ops$tkyte_at_ORA9IR2> create materialized view emp   2 on prebuilt table
  3 refresh complete
  4 as
  5 select * from emp_at_ora9ir1;  

Materialized view created.  

ops$tkyte_at_ORA9IR2>
ops$tkyte_at_ORA9IR2> begin

  2     dbms_refresh.make(
  3        name             =>'group1',
  4        list             =>'emp,dept',
  5        next_date        =>sysdate,
  6        interval         =>'sysdate+1/24',
  7        implicit_destroy =>true);

  8 end;
  9 /  

PL/SQL procedure successfully completed.  

ops$tkyte_at_ORA9IR2> exec dbms_refresh.refresh( 'GROUP1' );  

PL/SQL procedure successfully completed.  

ops$tkyte_at_ORA9IR2> alter materialized view emp refresh fast;  

Materialized view altered.  

At Source/Master DB:-



ops$tkyte_at_ORA9IR2> @connect scott/tiger_at_ora9ir1.localdomain  

scott_at_ORA9IR1> update emp set ename = initcap(ename) where rownum = 1;  

1 row updated.  

scott_at_ORA9IR1> commit;  

Commit complete.
(Above done to simulate Production updates on Source DB)  

At Target / Slave DB:-



ops$tkyte_at_ORA9IR2> exec dbms_refresh.refresh( 'GROUP1' );  

PL/SQL procedure successfully completed.  

ops$tkyte_at_ORA9IR2> drop materialized view emp;  

Materialized view dropped.  

ops$tkyte_at_ORA9IR2> select count(*) from emp;  

  COUNT(*)


        14    

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Sep 02 2005 - 02:16:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US