使用 Oracle 的物化视图 [英] Materialized view with Oracle

查看:81
本文介绍了使用 Oracle 的物化视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在脚本中有以下行,但我不明白使用"部分的用途.
我在谷歌上找不到任何东西.有人熟悉吗?
非常感谢!!

I have the following line in a script and I don't understand what the "using" part is used for.
I couldn't find anything on google. Anybody familiar with that ?
Thanks a lot !!

CREATE MATERIALIZED VIEW "PVTRNDM"."DM_MVW_DAILY_CAL" 
 USING ("DM_MVW_DAILY_CAL", 
        (8, 'PLANVP.XXXX.INT', 1, 0, 0, "PVTRN", "DAILY_CAL", '2009-10-15 16:12:25', 8, 45073, '2009-10-15 16:12:25', '', 1, '0E', 6548400, 0, NULL), 
        2101313, 8, ('1950-01-01 12:00:00', 111, 0, 0, 6548400, 0, 2054, 2, NULL, NULL)) 
 REFRESH FORCE AS 
 select day_date, cal , sum(NVL(daily_du, 0)) AS daily_du FROM PVPROD.daily_cal GROUP BY day_date, cal ;

推荐答案

我想我已经想通了(或者至少有一个建议).我从具有 REFRESH ON DEMAND 物化视图的用户导出,然后尝试将其导入具有 CREATE TABLE 但没有 CREATE MATERIALIZED VIEW 权限的用户.

I think I've figured it out (or at least have a suggestion). I did an export from a user that had a REFRESH ON DEMAND materialized view, then I tried importing that into a user that had CREATE TABLE, but not CREATE MATERIALIZED VIEW privileges.

它创建了一个具有该名称的表,但在物化视图中出错.我的猜测是,在进行导出时,它将 MV 中的数据导出为表格.CREATE MATERIALIZED VIEW 的这种奇怪的语法将该表变成了 MV.我猜这些日期与上次在源数据库上刷新 MV 的时间有关(如果有可用于下次刷新的 MV 日志,这可能是相关的).

It created a table of that name, but errored out on the materialized view. My guess is that when doing an export, it exports the data in the MV as a table. This odd syntax for CREATE MATERIALIZED VIEW turns that table into an MV. I'd guess the dates are to do with when the MV was last refreshed on the source database (which may be relevant if there MV logs that can be applied for the next refresh).

这篇关于使用 Oracle 的物化视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆