我试图在任何源表上更新后完成物化视图刷新。物化视图DDL如下所示:
CREATE MATERIALIZED VIEW EMPLOYEES_GROUPS_FLAT
CACHE AS
SELECT UNIQUE end_groups AS group_id,employee_id
FROM (
SELECT group_id AS end_group,CONNECT_BY_ROOT group_id AS root_group
FROM privilege_groups
START WITH group_id IN (SELECT group_id FROM employees_groups)
CONNECT BY PRIOR parent_group_id=group_id
)
RIGHT JOIN employees_groups ON (root_group=group_id)
我尝试使用ON COMMIT
重建,但似乎它不支持嵌套选择。通常,此查询对于提交时的快速更新看起来非常复杂。我也尝试过触发器,但它们似乎并没有包括最近增加的价值。我没有数据库权限来使用作业调度。还有什么我可以做的吗?