本文共 2240 字,大约阅读时间需要 7 分钟。
begin
DBMS_MVIEW.EXPLAIN_MVIEW('select vcard.username,vcard.nick_name,vcard.pcode,hlrlist.region,vcard.birth_year, vcard.icon, vcard.descr, last.state,vcard.HLR_CITY, vcard.BIRTH_MONTH, vcard.BIRTH_DAY from hlrlist ,last ,vcard where vcard.username = last.username and vcard.hlr_city = hlrlist.hlr_id');END; SELECT CAPABILITY_NAME, POSSIBLE, MSGTXT FROM MV_CAPABILITIES_TABLEWHERE CAPABILITY_NAME LIKE 'REFRESH%';CAPABILITY_NAME P
------------------------------ -MSGTXT--------------------------------------------------------------------------------REFRESH_COMPLETE Y REFRESH_FAST N REFRESH_FAST_AFTER_INSERT Nthe SELECT list does not have the rowids of all the detail tables CAPABILITY_NAME P------------------------------ -MSGTXT--------------------------------------------------------------------------------REFRESH_FAST_AFTER_ONETAB_DML Nsee the reason why REFRESH_FAST_AFTER_INSERT is disabledREFRESH_FAST_AFTER_ANY_DML N
see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabledREFRESH_FAST_PCT N
PCT is not possible on any of the detail tables in the materialized view 发现是因为没有包括各个表的rowid于是改为:
CREATE MATERIALIZED VIEW mv_vcard_last_hlrlist refresh fast as
select hlrlist.rowid arowid,last.rowid browid,vcard.rowid crowid, vcard.username,vcard.nick_name,vcard.pcode,hlrlist.region,vcard.birth_year, vcard.icon, vcard.descr, last.state,vcard.HLR_CITY, vcard.BIRTH_MONTH, vcard.BIRTH_DAYfrom hlrlist ,last ,vcard where vcard.username = last.username and vcard.hlr_city = hlrlist.hlr_id and last.state='Online' ;成功建立该物化视图
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7916042/viewspace-1002789/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7916042/viewspace-1002789/