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语句的查询.这样对整体 ...
随机推荐
- Fiddler 手机抓包设置
IOS 为例 1. Fiddler -> Tools -> Options ->Connection 2. 手机 Settings -> WIFI ->设置当前连接的网络 ...
- python使用cx_Oracle在Linux和Windows下的一点差异
1. 主要是线程方面的差异. Windows下,把cx_Oracle.connect(connectedId)得到的handle传给定时器线程,主线程和和定时器可以用同一个handle. 但Linux ...
- WebActivatorEx—动态注册httpmodle
源代码:https://github.com/davidebbo/WebActivator/tree/master/WebActivator unity使用演示 WebActivator类库提供了3种 ...
- React对比Vue(01 数据的定义,使用,组件的写法,目录结构等)
1.脚手架对比 两个都需要安装node node自带npm 然后安装cnpm yarn(有时候 npm会丢包,所以) npm install -g cnpm --registry=https://re ...
- 实验验证sys和system用户全库导出的区别
我们在做逻辑数据泵全库导出的时候,有两种流行的写法,一种是sys用户导出,一种是使用system用户导出. 现在想知道二者之间有什么区别?实验验证之前不妨先思考一下: sys和system用户的权限区 ...
- html5-css边框img
div{ width: 500px; height: 300px; background: rgb(122,30,60); border:15px solid black; ...
- 20165305 苏振龙《Java程序设计》第八周课上测试补做
1. 下载附件中的world.sql.zip, 参考http://www.cnblogs.com/rocedu/p/6371315.html#SECDB,导入world.sql,提交导入成功截图 2. ...
- 转:【专题十一】实现一个基于FTP协议的程序——文件上传下载器
引言: 在这个专题将为大家揭开下FTP这个协议的面纱,其实学习知识和生活中的例子都是很相通的,就拿这个专题来说,要了解FTP协议然后根据FTP协议实现一个文件下载器,就和和追MM是差不多的过程的,相信 ...
- Fiddler4入门--手机抓包工具安装和使用说明
Fiddler4入门--手机抓包工具安装和使用说明.电脑最好是笔记本连同一个wifi,这样能和手机保持统一局域网内. 很多区块链dapp项目方风控做的很差,利用fiddler抓包分析找一些漏洞,然后利 ...
- eos中BM与有BM特色的去中心化。区块链世界,白皮书为共识,代码为法律。
比特币挖矿是谁算力高,谁更容易挖到新的比特币,而BM认为这太浪费资源了,于是设计了DPoS:在DPoS系统里,大家不再挖矿.而是指定几个人负责记账,不叫矿工,而叫见证人.比特股里开始是101人,EOS ...