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的更多相关文章

  1. PGSQL数据库里物化视图【materialized view】

    1.普通视图 数据库中的视图(view)是从一张或多张数据库表查询导出的虚拟表,反映基础表中数据的变化,且本身不存储数据. 2.物化视图[materialized view]     2.1.概念:  ...

  2. 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)); ...

  3. PostgreSQL物化视图(materialized view)

    1.创建视图 CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name [ (column_name [, ...] ) ] [ WITH ( sto ...

  4. Postgresql - MATERIALIZED VIEW

    MATERIALIZED VIEWPG 9.3 版本之后开始支持物化视图.View 视图:虚拟,不存在实际的数据,在查询视图的时候其实是对视图内的表进行查询操作. 物化视图:实际存在,将数据存成一张表 ...

  5. [terry笔记]物化视图 materialized view基础学习

    一.物化视图定义摘录:     物化视图是包括一个查询结果的数据库对像(由系统实现定期刷新数据),物化视图不是在使用时才读取,而是预先计算并保存表连接或聚集等耗时较多的操作结果,这样在查询时大大提高了 ...

  6. MATERIALIZED VIEW

    Oracle的实体化视图提供了强大的功能,可以用在不同的环境中,实体化视图和表一样可以直接进行查询.实体化视图可以基于分区表,实体化视图本身也可以分区. 主要用于预先计算并保存表连接或聚集等耗时较多的 ...

  7. Advanced Replication同步复制实验(基于Trigger&基于Materialized View)

    1. 高级复制和流复制介绍 1.1 高级复制(Advanced Replication) 高级复制也称为对称复制,分为多主体站点复制(Multiple Master Rplication).物化视图站 ...

  8. 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 * ...

  9. Oracle数据库零散知识07 -- Materialized view(转)

    物化视图是一种特殊的物理表,“物化”(Materialized)视图是相对普通视图而言的.普通视图是虚拟表,应用的局限性大,任何对视图的查询,Oracle都实际上转换为视图SQL语句的查询.这样对整体 ...

随机推荐

  1. 16-Python3 条件控制

    2018-11-20 11:41:15 print('狗狗的年龄兑换*********************************************************') age = ...

  2. [LeetCode] 876. Middle of the Linked List_Easy tag: Linked List ** slow, fast pointers

    Given a non-empty, singly linked list with head node head, return a middle node of linked list. If t ...

  3. 把文本数据转化为json

    awk '{for (i=1 ;i<=NF;i++){ printf "\"" $i; if ( i==NF) {printf "\",&quo ...

  4. Ubuntu下安装eclipse遇到的问题

    今天在Ubuntu中安装eclipse时遇到如下问题: 解决方法: 打开eclipse安装目录下eclipse.ini文件 在文件最开头(注:一定是最开头)加上如下语句(-startup前面两行),第 ...

  5. python 参数解析ArgumentParser

    #!/usr/bin/env python #coding:utf-8 from argparse import ArgumentParser #--------------------------- ...

  6. 图像中的stride含义

    这个不是卷积中的步长stride 是另外一个含义, stride = 每个像素所占字节数 * width input stride为我们正常进行卷积时候设置的stride值,output stride ...

  7. 阿里云云盾服务证书免费CA证书申请与配置 (原)

    申请入口(首页导航产品->安全->CA证书服务->立即购买) 免费版选择步骤一步一步来 1.品牌选 Symantec 2.保护类型选择 一个域名(免费版只能一个好像) 3.证书类型选 ...

  8. Linux shell脚本 批量创建多个用户

    Linux shell脚本 批量创建多个用户 #!/bin/bash groupadd charlesgroup for username in charles1 charles2 charles3 ...

  9. 33网络通信之Epoll模型

    多路复用并发模型  -- epoll 监控事件 events EPOLLIN                  fd可读 EPOLLOUT              fd可写 EPOLLPRI     ...

  10. vs2015 C#打包程序为exe

    说明:将自己写的C#源代码打包后生成exe,直接安装在别人的电脑上运行,就像我们在网上下载别人的软件一样,很高大上,vs2015提供了打包和生成exe功能: 步骤一.打开vs2015(其他版本应该也是 ...