Database Administrators Asked by User1973 on December 23, 2020
I’ve created a materialized view between a primary system (Oracle 18c) and an external system (Oracle 19c):
create materialized view primary_system.workorder_mv
build immediate
refresh force
on demand
start with sysdate next sysdate + (30/(60*60*24))
as
select
cast(workorderid as number(38,0)) as objectid,
wonum,
status,
--other fields
longitudex,
latitudey
from
external_system.workorder_vw@gistomax --view in external system that is served up by dblink (gistomax)
--the view looks like this: select * from workorder where isgis=1
create materialized view log on external_system.workorder with rowid;
The docs say materialized views are supposed to purge automatically:
Oracle automatically tracks which rows in a materialized view log have
been used during the refreshes of materialized views, and purges these
rows from the log so that the log does not grow endlessly. Because
multiple simple materialized views can use the same materialized view
log, rows already used to refresh one materialized view might still be
needed to refresh another materialized view. Oracle does not delete
rows from the log until all materialized views have used them.
all_registered_mviews
looks like.Question:
So far, the MV log data doesn’t seem to be purging automatically:
Why aren’t’ the MV logs automatically purging once the records are synced?
Try basing your MV directly on the source table and not on an intermediate view. Include your "isgis=1" condition in the MV query.
create materialized view primary_system.workorder_mv
build immediate
refresh force
on demand
start with sysdate next sysdate + (30/(60*60*24))
as
select
cast(workorderid as number(38,0)) as objectid,
wonum,
status,
--other fields
longitudex,
latitudey
from
external_system.workorder@gistomax
where isgis=1
Correct answer by pmdba on December 23, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP