
No se refresca vista materializada.
Publicado por Mario (9 intervenciones) el 22/09/2014 15:11:38
Buenos días a todos,
Me gustaría crear una vista materializada la cual almacene los registros de ayer hasta el presente y que se actualice cada vez que vaya a ser consultada. Esta es la vista que he creado pero que no llega a actualizarse y se queda con los datos que se insertaron en su creación:
CREATE MATERIALIZED VIEW "mv_health_rules" ("period", "id_service", "id_event", "total")
TABLESPACE plat_dat
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
AS
select
to_date(concat(to_char("created_at", 'YYYY-MM-DD HH24'),':00:00'),'YYYY-MM-DD HH24:MI:SS') as "period"
, "id_service"
, "id_event"
, count(*) as "total"
from "bill_events"
where "created_at" between trunc(sysdate)-1 and sysdate
group by to_char("created_at", 'YYYY-MM-DD HH24'), "id_service", "id_event"
order by 1;
¿Alguien que pueda decirme el porque no se refresca la MV con los nuevos registros?
Saludos
Mario
Me gustaría crear una vista materializada la cual almacene los registros de ayer hasta el presente y que se actualice cada vez que vaya a ser consultada. Esta es la vista que he creado pero que no llega a actualizarse y se queda con los datos que se insertaron en su creación:
CREATE MATERIALIZED VIEW "mv_health_rules" ("period", "id_service", "id_event", "total")
TABLESPACE plat_dat
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
AS
select
to_date(concat(to_char("created_at", 'YYYY-MM-DD HH24'),':00:00'),'YYYY-MM-DD HH24:MI:SS') as "period"
, "id_service"
, "id_event"
, count(*) as "total"
from "bill_events"
where "created_at" between trunc(sysdate)-1 and sysdate
group by to_char("created_at", 'YYYY-MM-DD HH24'), "id_service", "id_event"
order by 1;
¿Alguien que pueda decirme el porque no se refresca la MV con los nuevos registros?
Saludos
Mario
Valora esta pregunta


0