Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create materialized view on view

user590978Apr 18 2013 — edited Apr 18 2013
Hi, I am trying to create a materialized view on view from different schema but i cannot create it with REFRESH FAST command as i need to refresh the materialized view only when any insert/update/delete happened.

I am able to create MV with refresh on demand or refresh complete. but i want data instantly whenever DML performed on base tables of view.

Can you please advice how i can achieve this ?

Thanks in advance!..

Here are the scripts.
View scripts:

select md.id_card_number as membership_number,
       md.person_code,
       mmtt.mem_trans_id as attempt_id,
       dl.proposal_doc_id,
       dt.description,
       ud.file_name,
       ud.file_location,
       ud.given_name,
       ud.org_user_id as org_user_id,
       ud.org_date_timestamp as org_date_timestamp
  from s_proposal_history         dl,
       frk_file_upload_details ud,
       s_map_members_to_trans  mmtt,
       s_member_details        md,
       s_document_types        dt
 where ud.doc_id = dl.proposal_doc_id
   --and dl.status_flag = 'A'
   and mmtt.mem_trans_id = dl.MEM_TRANS_ID
   and md.member_id=mmtt.member_id
   and dt.doc_type_id=54
   and id_card_number is not null
   and mmtt.mem_cov_status_id='1402'
union all
select md.id_card_number as membership_number,
       md.person_code,
       mmtl.source_id as attempt_id,
       mmtl.filename as proposal_doc_id,
       lm.description,
       mmtl.filename as file_name,
       null as file_location,
       mmtl.filename as given_name,
       mmtl.org_user_id as org_user_id,
       mmtl.org_date_timestamp as org_date_timestamp
from s_map_members_to_letters mmtl,
     s_letter_master lm,
     s_member_details md ,
     s_map_members_to_trans mmtt
where lm.letter_id = mmtl.letter_id
  and mmtl.status_flag = 'A'
  and trunc(mmtl.org_date_timestamp)>sysdate-10
  and md.member_id=mmtl.member_id
  and md.id_card_number is not null
  and mmtt.mem_cov_status_id=1402
  and md.member_id=mmtt.member_id;

MV script :

 CREATE materialized view mv_DOCUMENT_MAPPER 
  refresh  
  fast 
  next sysdate+1/1440
  AS SELECT *
  FROM [view];
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2013
Added on Apr 18 2013
5 comments
423 views