ORA-12052: cannot fast refresh materialized view
SQL> execute dbms_mview.refresh ('TX_FAIL_LOG_DAY_MV', 'f');
BEGIN DBMS_MVIEW.REFRESH ('TX_FAIL_LOG_DAY_MV', 'f'); END;
*
ERROR at line 1:
ORA-12052: cannot fast refresh materialized view BIDATA.TX_FAIL_LOG_DAY_MV
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2563
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2776
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2745
ORA-06512: at line 1
Solution:
The Oracle provided DBMS_MVIEW.explain_mview procedure was used to analyze each of the existing materialized views FAST REFRESH capabilities and write the results to the MV_CAPABILITIES_TABLE. Now using DBMS_MVIEW.explain_mview procedure I will analysis the possible reason why the materialized view cannot fast refresh.
SQL> EXEC dbms_mview.explain_mview('TX_FAIL_LOG_DAY_MV');
PL/SQL procedure successfully completed.
SQL> SELECT capability_name,
possible,
substr(msgtxt,1,60) AS msgtxt
FROM mv_capabilities_table
WHERE capability_name like '%FAST%';
CAPABILITY_NAME |
POSSIBLE |
MSGTXT |
REFRESH_FAST |
Y |
|
REFRESH_FAST_AFTER_INSERT |
N |
mv log does not have all necessary columns |
REFRESH_FAST_AFTER_ONETAB_DML |
N |
see the reason why REFRESH_FAST_AFTER_INSERT is disabled |
REFRESH_FAST_AFTER_ANY_DML |
N |
mv log does not have sequence # |
REFRESH_FAST_AFTER_ANY_DML |
N |
see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled |
REFRESH_FAST_PCT |
Y |
So you can see from the analysis that the log table does not have all the necessary columns. I have added the missing column.
SQL> ALTER MATERIALIZED VIEW LOG ON BIDATA.TX_FAIL_LOG_HOUR_MV ADD(CONTENTPROVIDERSERVICEID);
SQL> execute dbms_mview.refresh ('TX_FAIL_LOG_DAY_MV', 'f');
BEGIN DBMS_MVIEW.REFRESH ('TX_FAIL_LOG_DAY_MV', 'f'); END;
*
ERROR at line 1:
ORA-12052: cannot fast refresh materialized view BIDATA.TX_FAIL_LOG_DAY_MV
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2563
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2776
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2745
ORA-06512: at line 1
Still we are getting the error because first we require a complete refresh. After the complete refresh fast refresh will work.
SQL> execute dbms_mview.refresh ('TX_FAIL_LOG_DAY_MV', 'c');
PL/SQL procedure successfully completed.
Elapsed: 02:27:28.10
SQL> execute dbms_mview.refresh ('TX_FAIL_LOG_DAY_MV', 'f');
PL/SQL procedure successfully completed.
Elapsed: 00:01:38.61
ORA-12052: cannot fast refresh materialized view的更多相关文章
- PGSQL数据库里物化视图【materialized view】
1.普通视图 数据库中的视图(view)是从一张或多张数据库表查询导出的虚拟表,反映基础表中数据的变化,且本身不存储数据. 2.物化视图[materialized view] 2.1.概念: ...
- PostgreSQL rule view materialized view examples
warehouse_db=# create table tab_view(emp_id int not null,emp_name varchar(10),emp_city varchar(10)); ...
- PostgreSQL物化视图(materialized view)
1.创建视图 CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name [ (column_name [, ...] ) ] [ WITH ( sto ...
- Postgresql - MATERIALIZED VIEW
MATERIALIZED VIEWPG 9.3 版本之后开始支持物化视图.View 视图:虚拟,不存在实际的数据,在查询视图的时候其实是对视图内的表进行查询操作. 物化视图:实际存在,将数据存成一张表 ...
- [terry笔记]物化视图 materialized view基础学习
一.物化视图定义摘录: 物化视图是包括一个查询结果的数据库对像(由系统实现定期刷新数据),物化视图不是在使用时才读取,而是预先计算并保存表连接或聚集等耗时较多的操作结果,这样在查询时大大提高了 ...
- MATERIALIZED VIEW
Oracle的实体化视图提供了强大的功能,可以用在不同的环境中,实体化视图和表一样可以直接进行查询.实体化视图可以基于分区表,实体化视图本身也可以分区. 主要用于预先计算并保存表连接或聚集等耗时较多的 ...
- Advanced Replication同步复制实验(基于Trigger&基于Materialized View)
1. 高级复制和流复制介绍 1.1 高级复制(Advanced Replication) 高级复制也称为对称复制,分为多主体站点复制(Multiple Master Rplication).物化视图站 ...
- Materialized View in Oracle - Concepts and Architecture
List all of MV inoracle: select owner, query, query_len from dba_mviews See content of aMV: select * ...
- Oracle数据库零散知识07 -- Materialized view(转)
物化视图是一种特殊的物理表,“物化”(Materialized)视图是相对普通视图而言的.普通视图是虚拟表,应用的局限性大,任何对视图的查询,Oracle都实际上转换为视图SQL语句的查询.这样对整体 ...
随机推荐
- 密码登录源码(jsp+java+数据库)
jsp界面: <%@ page language="java" contentType="text/html; charset=utf-8" pageEn ...
- CentOS6.5安装zookeeper-3.4.5(单机)
1.下载 下载链接:http://archive.apache.org/dist/zookeeper/ 本文下载版本:zookeeper-3.4.5.tar.gz 2.安装 安装目录:/usr/loc ...
- Tensorflow检验GPU是否安装成功 及 使用GPU训练注意事项
1. 已经安装cuda但是tensorflow仍然使用cpu加速的问题 电脑上同时安装了GPU和CPU版本的TensorFlow,本来想用下面代码测试一下GPU程序,但无奈老是没有调用GPU. imp ...
- css3--单行、多行文本溢出
<style> .div1 { width: 200px; height: 200px; background: red url(img/user.png) no-repeat; text ...
- Mysql删除重复记录,保留id最小的一条
mysql 查询重复字段,及删除重复记录的方法MySQL, 数据库, 数据库, 字段, 服务器数据库中有个大表,需要查找其中的名字有重复的记录id,以便比较.如果仅仅是查找数据库中name不重复的字段 ...
- php实现记住密码下次自动登陆
这篇博客里面还写到 实现“记住我的登录状态”的功能方法,简言之,就是对首先对session进行用户信息赋值,检测session,失效后,利用cookie对其赋值: 在实现过程中,根据网上一些代码贴,整 ...
- 000-js判断电脑或手机登录
<script type="text/javascript"> try{ if(/Android|webOS|iPhone|iPod|BlackBerry/i.test ...
- LeetCode167.两数之和II-输入有序数组
给定一个已按照升序排列 的有序数组,找到两个数使得它们相加之和等于目标数. 函数应该返回这两个下标值 index1 和 index2,其中 index1 必须小于 index2. 说明: 返回的下标值 ...
- jdk8新特性-亮瞎眼的lambda表达式
jdk8之前,尤其是在写GUI程序的事件监听的时候,各种的匿名内部类,大把大把拖沓的代码,程序毫无美感可言!既然Java中一切皆为对象,那么,就类似于某些动态语言一样,函数也可以当成是对象啊!代码块也 ...
- [转]js刷新父窗体
浮层内嵌iframe及frame集合窗口,刷新父页面的多种方法 <script language=JavaScript> parent.location.reload(); ...