Materialized view conducive to fast refresh method

In AWM when I select refresh FASTER method and select the materialized view, get the error below:
"Quick Refresh method requires the materialized view logs and a complete refresh previously run the MV cube." I need this fast a cube materialized view refresh, so that it performs an incremental refresh and re-aggregation of only the changed lines in the source table.
can someone help me on this?

Remember to choose the 'Force' that runs fast if possible update, as otherwise it performs a complete refresh. You can also specify Complete as the Refresh method in the dialog box Assistant Maintenance first, you keep the cube.

You'll need create materialized on all the base tables, view logs if you have not already done so, otherwise the cube will be able to do a fast refresh (differential).

Tags: Business Intelligence

Similar Questions

  • Materialized view does not quickly refresh with sysdate in where clause

    Hi all

    I am trying to create a view, materialized with sysdate in where clause. This makes the complex query, and so I can't create a quick refreshment mview.

    I tried to create with rowid too, but it does not create a quick refreshment.

    I was wondering if someone can advise me, how can I accomplish this task, which would be really appreciated.

    The query is:

    create a materialized view PS_MEETING

    build the DEFERRED payment

    Refresh quickly with rowid

    as

    SELECT *.

    MEETING M

    WHERE state_desc = 'VIC '.

    OR Meet_date < TRUNC (SYSDATE);

    the behavior is documented: http://docs.oracle.com/cd/E11882_01/server.112/e25554/basicmv.htm#DWHSG8201

    General restrictions on update quickly

    The definition of the materialized view query is limited as follows:

    • The materialized view must not contain references to non-repetitive phrases such as SYSDATE and ROWNUM .

    So I guess that you would need a more static than sysdate condition - or another strategy update.

  • Pivot can be used in fast refresh materialized view?

    Hi, I have a question about materialized view nested mode fast refresh on Oracle 11 g (It support function of pivot, but oracle 10 g doesn't support).

    When I created, he throws "ORA-12015: cannot create a view fast refresh materialized by a complex query.
    Then I used dbms_mview.explain_mview to see reason, and it tell me the following
    REFRESH_FAST_AFTER_INSERT ' view inline or subquery in LIST not supported for this type of MV.

    Can someone help me, any suggestions will be appreciated
    create table empX as select * from scott.emp;
    alter table empX add constraint PK_empX_empno primary key (empno);
    
    --drop  MATERIALIZED VIEW LOG ON empX;
    CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno);
    
    --drop MATERIALIZED VIEW mv_empX;
    CREATE MATERIALIZED VIEW mv_empX
    REFRESH FAST START WITH SYSDATE
    NEXT  SYSDATE + 1/1440
    AS   
      select * from
      (
       select rowid emp_rowid, deptno, job, sal from empX
      )
      PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3));
     
    --select * from mv_capabilities_table
    declare
      lv_sqltext varchar2(4000);
    begin
      execute immediate 'truncate table mv_capabilities_table';
      lv_sqltext := 'select * from
      (
       select deptno, job, sal from empX
      )
      PIVOT( max(sal) for job IN (''ANALYST'' job1, ''CLERK'' job2, ''MANAGER'' job3))
      ';  
      dbms_mview.explain_mview(lv_sqltext,'nested=>TRUE');
      commit;
    end;
    /

    Let me help you...
    I have done following and it run/view updated because I just replaced quickly with a complete word, because there are limitations for quickly updatable views:

    SQL> show user;
    USER is "SCOTT"
    SQL> create table empX as select * from scott.emp;
    
    Table created.
    
    SQL> alter table empX add constraint PK_empX_empno primary key (empno);
    
    Table altered.
    
    SQL>
    SQL> --drop  MATERIALIZED VIEW LOG ON empX;
    SQL> CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno);
    
    Materialized view log created.
    
    SQL>
    SQL> --drop MATERIALIZED VIEW mv_empX;
    SQL> CREATE MATERIALIZED VIEW mv_empX
      2  REFRESH COMPLETE WITH rowid
      3  START WITH sysdate
      4  NEXT  SYSDATE + 1/1440
      5  AS
      6    select * from
      7    (
      8     select rowid emp_rowid, deptno, job, sal from empX
      9    )
     10    PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3));
    
    Materialized view created.
    
    SQL> select * from mv_empx;
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAN         10                  1300
    AAAShcAAEAAAATTAAE         30
    AAAShcAAEAAAATTAAJ         30
    AAAShcAAEAAAATTAAC         30
    AAAShcAAEAAAATTAAA         20                   800
    AAAShcAAEAAAATTAAK         20                  1100
    AAAShcAAEAAAATTAAM         20       3000
    AAAShcAAEAAAATTAAD         20                             2975
    AAAShcAAEAAAATTAAB         30
    AAAShcAAEAAAATTAAI         10
    AAAShcAAEAAAATTAAL         30                   950
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAF         30                             2850
    AAAShcAAEAAAATTAAG         10                             2450
    AAAShcAAEAAAATTAAH         20       3000
    
    14 rows selected.
    
    SQL> begin
      2  dbms_mview.refresh('SCOTT.mv_empx');
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from mv_empx;
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAN         10                  1300
    AAAShcAAEAAAATTAAE         30
    AAAShcAAEAAAATTAAJ         30
    AAAShcAAEAAAATTAAC         30
    AAAShcAAEAAAATTAAA         20                   800
    AAAShcAAEAAAATTAAK         20                  1100
    AAAShcAAEAAAATTAAM         20       3000
    AAAShcAAEAAAATTAAD         20                             2975
    AAAShcAAEAAAATTAAB         30
    AAAShcAAEAAAATTAAI         10
    AAAShcAAEAAAATTAAL         30                   950
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAF         30                             2850
    AAAShcAAEAAAATTAAG         10                             2450
    AAAShcAAEAAAATTAAH         20       3000
    
    14 rows selected.
    
    SQL>
    

    So, the answer is Yes, we can use Pivot with Materialized view but:
    1 MV must be full refresh.
    2 oracle version should be 11 g; of course the pivot is available in Oracle 11 g.

    If this answers your question, please close the message, otherwise continue.

    These links may also be of interest:
    http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007028
    http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007007

    http://rwijk.blogspot.in/2009/06/fast-refreshable-MATERIALIZED-view.html

    And:

    Please see if (Note: 179466.1 - view to fast refresh materialized diagnose ORA-12015 / complex queries) help.

    Concerning
    Girish Sharma

  • Trigger on the materialized view

    Hello

    I have the scenario based (Database 11 g):

    There is a view materialized (PERSON), which contains the ID and NAME fields. This MV is update daily with a fast refresh.

    I have a second array (NAMES), with ID and NORM_NAME. This table contains the name of the person, without special characters.

    For example, for recording / * 1 BJORN * / in the PERSON table

    I would check * 1 BJORN * / in table NAMES.


    Problem is how to fill the NAME table after the filling of the materialized view.

    I used a trigger AFTER INSERT or update, as described below, but even if I update the master table (for this purpose, update the MV), I have only to trigger inserts.


    Is there a way to implement a trigger "after update" on a materialized view, or do I need another approach?


    /*


    create or replace TRIGGER TRG_TESTE_MV

    AFTER INSERT OR UPDATE ON THE PERSON

    REFERENCING OLD AS OLD AGAIN AS NEW

    FOR EACH LINE

    BEGIN

    IF THE INSERTION

    INSERT THE NAMES

    VALUES

    (: NEW.id,:NEW.NAME);

    END IF;

    IF THE UPDATE CAN

    UPDATE OF NAMES

    SET NAME =: NEW.NAME WHERE ID =: NEW.id;

    END IF;

    END;

    */

    Thanks for any help

    Your trigger fires, but I doubted that you will be satisfied with the results. You really need to understand how to refresh process works before you begin creating triggers of MV:

    SQL > create table emp1 in select * from EMP
    2.

    Table created.

    SQL > create materialized view emp1 with rowid journal
    2.

    Materialized view log that is created.

    SQL > create materialized view emp1_mv
    2 fast refresh
    3 on request
    4 with rowid
    5 as
    6 select * from emp1
    7.

    Materialized view created.

    SQL > create or replace
    trigger 2 emp1_mv_biudr
    3 before inserting
    4 or update
    5 or delete
    6 on emp1_mv
    7 for each line
    Start 8
    9 insert then dbms_output.put_line ('INSERT' |: new.ename); end if;
    10 if the deletion then dbms_output.put_line ('REMOVE' |: old.ename); end if;
    11 end;
    12.

    Trigger created.

    SQL > insert
    2 in emp1 (empno, ename, sal)
    3 values(1,'X',1000)
    4.

    1 line of creation.

    SQL > validation
    2.

    Validation complete.

    SQL > set serveroutput on
    SQL > exec dbms_mview.refresh ('emp1_mv', 'f');
    INSERTION OF X

    PL/SQL procedure successfully completed.

    SQL > update emp1
    2 set sal = sal + 1
    3 where ename ('King', 'JONES')
    4.

    2 lines to date.

    SQL > validation
    2.

    Validation complete.

    SQL > set serveroutput on
    SQL > exec dbms_mview.refresh ('emp1_mv', 'f');
    INSERTION OF JONES
    INSERTION OF KING

    PL/SQL procedure successfully completed.

    SQL > delete emp1
    2 where in ename ('ALLEN', 'SMITH')
    3.

    2 deleted rows.

    SQL > validation
    2.

    Validation complete.

    SQL > set serveroutput on
    SQL > exec dbms_mview.refresh ('emp1_mv', 'f');

    PL/SQL procedure successfully completed.

    SQL >

    As you can see, refresh MV updates ever. Results update underlying table to remove/insert in MV. That's why your trigger will not give the results that you expected.

    SY.

  • fast refresh on MATERIALIZED VIEW

    Oracle 10 g R2 (10.2.0.5)

    Scott.mv_test CREATE MATERIALIZED VIEW
    Users TABLESPACE
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    IMMEDIATE CONSTRUCTION
    REFRESH THE STRENGTH TO DEMAND
    WITH THE PRIMARY KEY
    AS
    Select...

    I this MV, when I do the QUICK refersh as follows, I get the error message

    SQL > execute DBMS_MVIEW. REFRESH ('MV_TEST', 'f');
    DBMS_MVIEW BEGIN. REFRESH ('MV_TEST', 'f'); END;

    *
    ERROR on line 1:
    ORA-12004: QUICK COOLING can be used to view materialized "SCOTT." "" MV_TEST ".
    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2251
    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2457
    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2426
    ORA-06512: at line 1

    But it works with full refresh.

    Is this planned, any help would be appreciated.

    Thank you
    ORA-12004: REFRESH FAST cannot be used for materialized view "string"."string"
    Cause:      The materialized view log does not exist or cannot be used. PCT refresh is also not enabled on the materialized view
    Action:      Use just REFRESH, which will reinstantiate the entire table. If a materialized view log exists and the form of the materialized view allows the use of a materialized view log or PCT refresh is possible after a given set of changes, REFRESH FAST will be available starting the next time the materialized view is refreshed.
    

    http://ORA-12004.ora-code.com/

  • materialized wiev fast refresh every minute

    Hello, I need create mv and this mv need auto fast refresh every minute.

    I first create the table 3

    first:

    CREATE TABLE 'HR '. "' EMPLOYEES '.

    (NUMBER (6.0) "EMPLOYE_ID",)

    VARCHAR2 (20 BYTE) "FIRST NAME",

    VARCHAR2 (25 BYTE) "NAME."

    VARCHAR2 (25 BYTE) "E-MAIL."

    "PHONE_NUMBER" VARCHAR2 (20 BYTE),

    'HIRE_DATE' DATE,

    "JOB_ID' VARCHAR2 (10 BYTE),

    "SALARY" NUMBER (8,2).

    NUMBER (2.2) "COMMISSION_PCT."

    NUMBER (6.0) "MANAGER_ID."

    "DEPARTMENT_ID" NUMBER (4.0)

    )

    Second:

    CREATE TABLE 'HR '. "" DEPARTMENTS. "

    ("DEPARTMENT_ID" NUMBER (4,0),)

    VARCHAR2 (30 BYTE) "DEPARTMENT_NAME."

    NUMBER (6.0) "MANAGER_ID."

    NUMBER (4,0) 'LOCATION_ID '.

    )

    Thirdly:

    CREATE TABLE 'HR '. "' LOCATIONS '.

    (NUMBER (4,0) 'LOCATION_ID',)

    'ADRESSE_RUE' VARCHAR2 (40 BYTE),

    "ZIP_CODE" VARCHAR2 (12-BYTE),

    VARCHAR2 (30 BYTE) 'CITY ',.

    VARCHAR2 (25 BYTE) "STATE_PROVINCE"

    'COUNTRY_ID' TANK (2 BYTES)

    )

    can I create mv newspaper with rowid, become I refresh mv with quick setting

    create log view materialized on EMPLOYEES with rowid.

    create log view materialized on departments with rowid.

    create log view materialized on the premises with rowid.

    Finally, I create mv with fast refresh method

    CREATE THE TEST_MV_1 MATERIALIZED VIEW

    REFRESH QUICKLY START WITH sysdate + 0 NEXT (sysdate + 1/1440)

    AS

    Select EMPLOYEES. EMPLOYEE_id

    departments.department_id

    locations.location_id

    EMPLOYEES.rowid EMPLOYEES

    departments.rowid departments

    locations.rowid locations

    EMPLOYEES

    ministries

    places

    where departments.manager_id (+) = EMPLOYEES. EMPLOYEE_ID

    and departments.location_id = locations.location_id (+);

    now I have my mv and I'm seeing or my mv running

    SELECT

    table_name,

    TO_CHAR (LAST_REFRESH,'yyyy-MM-DD HH24:MI:SS) LAST_REFRESH

    , to_char (sysdate,'yyyy-MM-DD HH24:MI:SS) sys_date

    -Count (Name)

    Of all_snapshots

    where table_name = 'TEST_MV_1 '.

    I get:

    TABLE-NAME LAST_REFRESH SYS_DATE

    ------------------------------ ------------------- -------------------

    TEST_MV_1 2015-09-01 17:56:10-2015-09-01 17:57:02

    After 2 min

    SELECT

    table_name,

    TO_CHAR (LAST_REFRESH,'yyyy-MM-DD HH24:MI:SS) LAST_REFRESH

    , to_char (sysdate,'yyyy-MM-DD HH24:MI:SS) sys_date

    -Count (Name)

    Of all_snapshots

    where table_name = 'TEST_MV_1 '.

    TABLE-NAME LAST_REFRESH SYS_DATE

    ------------------------------ ------------------- -------------------

    TEST_MV_1 2015-09-01 17:58:10 2015-09-01 17:59:05

    then I insert the new record in the table

    Insert employees

    (EMPLOYE_ID,

    FIRST NAME,

    LAST_NAME,

    E-mail

    PHONE_NUMBER,

    HIRE_DATE,

    JOB_ID,

    SALARY,

    COMMISSION_PCT,

    MANAGER_ID,

    DEPARTMENT_ID)

    values

    (515, 'Jennifer', 'Whalen', 'JWHALEN', '515.123.4444', to_date('1987.09.17','yyyy.mm.dd'), 'AD_ASST', null, 101, 10, 24000)

    /

    Commit

    /

    1 row inserted.

    Validation complete.

    and check again my last_refresh mv

    SELECT

    table_name,

    TO_CHAR (LAST_REFRESH,'yyyy-MM-DD HH24:MI:SS) LAST_REFRESH

    , to_char (sysdate,'yyyy-MM-DD HH24:MI:SS) sys_date

    -Count (Name)

    Of all_snapshots

    where table_name = 'TEST_MV_1 '.

    TABLE-NAME LAST_REFRESH SYS_DATE

    ------------------------------ ------------------- -------------------

    TEST_MV_1 2015-09-01 17:59:10 -2015-09-01 17:59:30

    affter 2 min

    TABLE-NAME LAST_REFRESH SYS_DATE

    ------------------------------ ------------------- -------------------

    TEST_MV_1 2015-09-01 17:59:10 -2015-09-01 18:02:12

    and when I go to data mv I don't see my new data

    Select * from TEST_MV_1

    where EMPLOYEE_ID = 515

    no selected line

    Maybe someone can help me? I'm two weeks try fix it and lost all hope


    I find:

    My mv refreshed, but when I insert new data he collapsed

    I ' am am ansver: when I try to refresh the MV with fuction

    DBMS_REFRESH. Refresh (the "HO".) "TEST_MV_1" ');

    I get the error

    ORA-12008: error path refresh materialized view

    ORA-00942: table or view does not exist

    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2563

    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2776

    ORA-06512: at "SYS." DBMS_IREFRESH', line 685

    ORA-06512: at "SYS." DBMS_REFRESH", line 195

    ORA-06512: at line 2

    00000 - "error in the path of refresh materialized view.

    * Cause: Table SNAP$ _ reads lines of sight

    MVIEW$ _, which is a view of the main table

    (the master can be on a remote site).  Any

    error in this way will cause this error when updating.

    For updates of the Rapids, the table. MLOG$ _

    is also referenced.

    * Action: Examine the other messages on the stack to find the problem.

    See if SNAP objects $ _, MVIEW$ _,.

    . @, . MLOG$ _@.

    There is always.

    so I think that I can not select the HR data. MLOG$ _EMPLOYEES and another newspaper in the HR schema table

    When I try to select * HR. MLOG$ _EMPLOYEES I get table emty (schema HO)

    so I don't understand how I can not update quick MV when I log empty.

    I therefore ask my db admin for more privileges to select the MV journal table

    I do not know what admin Preobrajensky give to my diet, but it's a job.

    dude thanks for the help

  • Reg: Package code to refresh materialized views

    I'm new to pl/sql packages and procedures.i want it running for execution of informatica mappings that takes 0 and 1 gives when it is run successfully

    create or replace the BODY of PACKAGE as pkg_refresh_mv
    procedure prc_mv (p_mv_name varchar2) is
    Start
    dbms_mview. Refresh (p_mv_name);
    end prc_mv;

    procedure refresh_all_mv (proc_response IN OUT number) is


    Start
    dbms_mview. Refresh ("' materialized view", "C");
    dbms_mview. Refresh ("' materialized view", "C");

    proc_response: = 1;
    exception
    while others then
    proc_response: = 0;
    end refresh_all_mv;
    end pkg_refresh_mv;

    When I run this code I get the following errors


    PLS-00201: identifier 'PKG_REFRESH_MV' must be declared.
    PLS-00304: impossible to compile 'PKG_REFRESH_MV' body without its specification

    what needs to be changed


    Thank you

    try this one:

    CREATE OR REPLACE PACKAGE pkg_refresh_mv
    AS
       PROCEDURE prc_mv (p_mv_name VARCHAR2);
       PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER);
    END pkg_refresh_mv;
    /
    
    CREATE OR REPLACE PACKAGE BODY pkg_refresh_mv
    AS
       PROCEDURE prc_mv (p_mv_name VARCHAR2)
       IS
       BEGIN
          dbms_mview.refresh (p_mv_name);
       END prc_mv;
    
       PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER)
       IS
       BEGIN
          dbms_mview.refresh ('materialized view', 'C');
          dbms_mview.refresh ('materialized view', 'C');
    
          proc_response := 1;
       EXCEPTION
          WHEN OTHERS
          THEN
             proc_response := 0;
       END refresh_all_mv;
    END pkg_refresh_mv;
    /
    
  • create materialized view log on the table without a primary key

    Hi all
    CREATE TABLE client_months 
    (
      SUBJ_CODE         NUMBER(4),
      SERV_CODE         NUMBER(4),
      DEBIT_CODE        NUMBER(4),
      PERIOD_NUM        NUMBER(2),
      PERIOD_NAME       VARCHAR2(40 CHAR),
      FIRST_MON_DAY     DATE,
      LAST_MON_DAY      DATE,
      VALUE_MON_DAY     DATE,
      MONTHES           NUMBER(4,2),
      GARDENING_WEIGHT  NUMBER(5,4),
      REASON_CODE       NUMBER(5),
      STAMP_ACTION      VARCHAR2(1 CHAR),
      STAMP_CDATE       DATE                        DEFAULT SYSDATE,
      STAMP_DATE        DATE,
      STAMP_USER        VARCHAR2(15 CHAR),
      REGION_CODE       NUMBER(9)
    )
    table created.
    
    CREATE UNIQUE INDEX client_months_UK  ON client_months 
    (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
    index created.
    
    CREATE MATERIALIZED VIEW LOG ON client_months with rowid;
    
    CREATE MATERIALIZED VIEW client_months_mv 
    BUILD immediate 
    REFRESH FAST ON COMMIT 
    AS 
    SELECT * FROM client_months;
    
    ORA-12014: table 'CLIENT_MONTHS' does not contain a primary key constraint
    I don't want to refresh the mview when validation is performed on the base table.
    And I don't want to change the base table by adding a primary key.

    is it possible to create the mview journal using the unique index? or another solution?
    Please help
    Thanks in advance
    Naama

    Naamas wrote:
    No,
    I already read this post!

    Then you read wrong:

    SQL> CREATE TABLE client_months
      2  (
      3    SUBJ_CODE         NUMBER(4),
      4    SERV_CODE         NUMBER(4),
      5    DEBIT_CODE        NUMBER(4),
      6    PERIOD_NUM        NUMBER(2),
      7    PERIOD_NAME       VARCHAR2(40 CHAR),
      8    FIRST_MON_DAY     DATE,
      9    LAST_MON_DAY      DATE,
     10    VALUE_MON_DAY     DATE,
     11    MONTHES           NUMBER(4,2),
     12    GARDENING_WEIGHT  NUMBER(5,4),
     13    REASON_CODE       NUMBER(5),
     14    STAMP_ACTION      VARCHAR2(1 CHAR),
     15    STAMP_CDATE       DATE                        DEFAULT SYSDATE,
     16    STAMP_DATE        DATE,
     17    STAMP_USER        VARCHAR2(15 CHAR),
     18    REGION_CODE       NUMBER(9)
     19  )
     20  /
    
    Table created.
    
    SQL> CREATE UNIQUE INDEX client_months_UK  ON client_months
      2  (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
      3  /
    
    Index created.
    
    SQL> CREATE MATERIALIZED VIEW LOG ON client_months with rowid
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW client_months_mv
      2  BUILD immediate
      3  REFRESH FAST WITH ROWID ON COMMIT -- pay attention to WITH ROWID
      4  AS
      5  SELECT * FROM client_months
      6  /
    
    Materialized view created.
    
    SQL>
    

    SY.

  • Commit performance on table with Fast Refresh MV

    Hello world

    Try to wrap your head around fast refresh performance and why I see (what I consider) high disk numbers / query associated with the update of the MV_LOG in a TKPROF.

    The installation program.
    (Oracle 10.2.0.4.0)

    Database table:
    SQL> desc action;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     PK_ACTION_ID                              NOT NULL NUMBER(10)
     CATEGORY                                           VARCHAR2(20)
     INT_DESCRIPTION                                    VARCHAR2(4000)
     EXT_DESCRIPTION                                    VARCHAR2(4000)
     ACTION_TITLE                              NOT NULL VARCHAR2(400)
     CALL_DURATION                                      VARCHAR2(6)
     DATE_OPENED                               NOT NULL DATE
     CONTRACT                                           VARCHAR2(100)
     SOFTWARE_SUMMARY                                   VARCHAR2(2000)
     MACHINE_NAME                                       VARCHAR2(25)
     BILLING_STATUS                                     VARCHAR2(15)
     ACTION_NUMBER                                      NUMBER(3)
     THIRD_PARTY_NAME                                   VARCHAR2(25)
     MAILED_TO                                          VARCHAR2(400)
     FK_CONTACT_ID                                      NUMBER(10)
     FK_EMPLOYEE_ID                            NOT NULL NUMBER(10)
     FK_ISSUE_ID                               NOT NULL NUMBER(10)
     STATUS                                             VARCHAR2(80)
     PRIORITY                                           NUMBER(1)
     EMAILED_CUSTOMER                                   TIMESTAMP(6) WITH LOCAL TIME
                                                         ZONE
    
    
    SQL> select count(*) from action;
    
      COUNT(*)
    ----------
       1388780
    MV was created
    create materialized view log on action with sequence, rowid
    (pk_action_id, fk_issue_id, date_opened) 
    including new values;
    
    -- Create materialized view
    create materialized view issue_open_mv
    build immediate
    refresh fast on commit
    enable query rewrite as 
    select  fk_issue_id issue_id,
         count(*) cnt,
         min(date_opened) issue_open,
         max(date_opened) last_action_date,
         min(pk_action_id) first_action_id,
         max(pk_action_id) last_action_id,
         count(pk_action_id) num_actions
    from    action
    group by fk_issue_id;
    
    exec dbms_stats.gather_table_stats('tg','issue_open_mv')
    
    SQL> select table_name, last_analyzed from dba_tables where table_name = 'ISSUE_OPEN_MV';
    
    TABLE_NAME                     LAST_ANAL
    ------------------------------ ---------
    ISSUE_OPEN_MV                  15-NOV-10
    
    *note: table was created a couple of days ago *
    
    SQL> exec dbms_mview.explain_mview('TG.ISSUE_OPEN_MV');
    
    CAPABILITY_NAME                P REL_TEXT MSGTXT
    ------------------------------ - -------- ------------------------------------------------------------
    PCT                            N
    REFRESH_COMPLETE               Y
    REFRESH_FAST                   Y
    REWRITE                        Y
    PCT_TABLE                      N ACTION   relation is not a partitioned table
    REFRESH_FAST_AFTER_INSERT      Y
    REFRESH_FAST_AFTER_ANY_DML     Y
    REFRESH_FAST_PCT               N          PCT is not possible on any of the detail tables in the mater
    REWRITE_FULL_TEXT_MATCH        Y
    REWRITE_PARTIAL_TEXT_MATCH     Y
    REWRITE_GENERAL                Y
    REWRITE_PCT                    N          general rewrite is not possible or PCT is not possible on an
    PCT_TABLE_REWRITE              N ACTION   relation is not a partitioned table
    
    13 rows selected.
    Fast refresh works fine. And the newspaper is kept small enough.
    SQL> select count(*) from mlog$_action;
    
      COUNT(*)
    ----------
             0
    When I update a row in the base table:
    var in_action_id number;
    
    exec :in_action_id := 398385;
    
    UPDATE action
    SET emailed_customer = SYSTIMESTAMP
    WHERE pk_action_id = :in_action_id
    AND DECODE(emailed_customer, NULL, 0, 1) = 0
    /
    
    commit;
    What follows, I get via tkprof.
    ********************************************************************************
    
    INSERT /*+ IDX(0) */ INTO "TG"."MLOG$_ACTION" (dmltype$$,old_new$$,snaptime$$,
      change_vector$$,sequence$$,m_row$$,"PK_ACTION_ID","DATE_OPENED",
      "FK_ISSUE_ID")
    VALUES
     (:d,:o,to_date('4000-01-01:00:00:00','YYYY-MM-DD:HH24:MI:SS'),:c,
      sys.cdc_rsid_seq$.nextval,:m,:1,:2,:3)
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.01          0          0          0           0
    Execute      2      0.00       0.03          4          4          4           2
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        3      0.00       0.04          4          4          4           2
    
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          2  SEQUENCE  CDC_RSID_SEQ$ (cr=0 pr=0 pw=0 time=28 us)
    
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                         4        0.01          0.01
    ********************************************************************************
    
    ********************************************************************************
    
    update "TG"."MLOG$_ACTION" set snaptime$$ = :1
    where
     snaptime$$ > to_date('2100-01-01:00:00:00','YYYY-MM-DD:HH24:MI:SS')
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.01          0          0          0           0
    Execute      1      0.94       5.36      55996      56012          1           2
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        2      0.94       5.38      55996      56012          1           2
    
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          0  UPDATE  MLOG$_ACTION (cr=56012 pr=55996 pw=0 time=5364554 us)
          2   TABLE ACCESS FULL MLOG$_ACTION (cr=56012 pr=55996 pw=0 time=46756 us)
    
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file scattered read                       3529        0.02          4.91
    ********************************************************************************
    
    select dmltype$$, max(snaptime$$)
    from
     "TG"."MLOG$_ACTION"  where snaptime$$ <= :1  group by dmltype$$
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.70       0.68      55996      56012          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.70       0.68      55996      56012          0           1
    
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          1  SORT GROUP BY (cr=56012 pr=55996 pw=0 time=685671 us)
          2   TABLE ACCESS FULL MLOG$_ACTION (cr=56012 pr=55996 pw=0 time=1851 us)
    
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file scattered read                       3529        0.00          0.38
    ********************************************************************************
    
    delete from "TG"."MLOG$_ACTION"
    where
     snaptime$$ <= :1
    
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.71       0.70      55946      56012          3           2
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        2      0.71       0.70      55946      56012          3           2
    
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS   (recursive depth: 1)
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          0  DELETE  MLOG$_ACTION (cr=56012 pr=55946 pw=0 time=702813 us)
          2   TABLE ACCESS FULL MLOG$_ACTION (cr=56012 pr=55946 pw=0 time=1814 us)
    
    
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file scattered read                       3530        0.00          0.39
      db file sequential read                        33        0.00          0.00
    ********************************************************************************
    Could someone explain why the the SELECT/UPDATE/DELETE on MLOG$ _ACTION if 'expensive' when it should be only 2 rows (the old value and the new value) in this newspaper after an update? I could do to improve the performance of the update?

    Let me know if you need more info... would be happy to provide.

    My guess would be that you were once a very large transaction that inserted a large number of rows in this table. So the table segment is big enough now and the high watermark is average at the end of this segment, causing a full scan table to analyze a large number of empty blocks and retrieve the two lines.

    You can issue a truncation on this table of $ MLOG: which would free up the empty blocks and brings back the high-watermark in the first block.

  • is missing a closing parenthesis in create materialized view statement

    Hi, I am using oracle 10g R2 and try to create a view of materalized with the following statement:
    CREATE MATERIALIZED VIEW MVT_DEC_TAB USING INDEX REFRESH FAST ON COMMIT AS 
    select i.rowid as ind_rowid,c.rowid as indc_rowid,r.rowid as r_rowid,b.rowid as b_rowid,brk.rowid as brk_rowid,
    i.name,i.sname,i.address,i.tel,i.fax,i.email,
    DECODE(c.BRKNO,null,0,1) AS DEC_BRK,
    TO_TIMESTAMP(NVL(VEKDOV,'2001/01/01')||' 12:00:00','YYYY/MM/DD HH:MI:SS'),
    DECODE(c.brkno,null,DECODE(c.ncmpcode,null,c.vekdov,b.bcarddov),brk.validitydov)
    from indiv i,indivcoding c
    LEFT OUTER JOIN BROKER brk ON brk.brkno = c.brkno
    LEFT OUTER JOIN CORPORAT r
    ON c.ncmpcode=r.cmpcode INNER JOIN BCARD b ON b.bcardno=r.bcardno
    where c.typeact=2  
    and c.natcode=i.natcode
    and c.brkno is not null or c.ncmpcode is not null or c.nnatcode is not null
    but I get an error message:
    where c.typeact = 2
    ERROR on line 11:
    ORA-00907: lack of right parenthesis

    which makes no sense because if I run the sql code of the materialized view, it runs normally.
    I need to know what the causing this can someone help?

    Do not use the "LEFT OUTER JOIN" ANSI syntax in your CREATE MATERIALIZED VIEW definition.
    Specify

    FROM indiv i,indivcoding c, broker brk, corporat r
    WHERE brk.brkno(+) = c.brkno
    AND c.ncmpcode(+) = r.cmpcode
    

    OR

    FROM indiv i,indivcoding c, broker brk, corporat r
    WHERE c.brkno = brk.brkno(+)
    AND r.ncmpcode = c.cmpcode(+)
    

    (I find it more readable).

    Hemant K Collette

  • feature not enabled: rewrite of materialized view

    Greetings,
    I created materialized views of XE by using the following code:
    CREATE materialized VIEW log ON airplane_type_list
    WITH
      rowid
      (max_seat
      ) including NEW VALUES;
    
    CREATE materialized VIEW log ON airplane
    WITH
      rowid
      (airplane_type, number_seat_booked
      ) including NEW VALUES;
    
    CREATE materialized VIEW airport_mv build immediate refresh fast ON COMMIT enable query rewrite
    AS
      SELECT 
        a.rowid "airplane_type_list_rowid",
        b.rowid "airplane_rowid",
        a.max_seat,
        b.number_seat_booked 
      FROM airplane_type_list a,
        airplane b
      WHERE b.airplane_type  = a.airplane_type
      AND b.number_seat_booked<=a.max_seat
    When I run the script, I got the following error:
    Error starting at line 11 in command:
    CREATE materialized VIEW airport_mv build immediate refresh fast ON COMMIT enable query rewrite
    AS
      SELECT a.rowid,b.rowid,
      a.max_seat,
        b.number_seat_booked 
      FROM airplane_type_list a,
        airplane b
      WHERE b.airplane_type  = a.airplane_type
      AND b.number_seat_booked<=a.max_seat
    Error at Command Line:16 Column:7
    Error report:
    SQL Error: ORA-00439: feature not enabled: Materialized view rewrite
    00439. 00000 -  "feature not enabled: %s"
    *Cause:    The specified feature is not enabled.
    *Action:   Do not attempt to use this feature.
    But when I delete "activate the rewrite of the query", the script works fine.
    Is it because I can't use the rewrite of the query to the XE?

    Kind regards
    Valerie

    Is it because I can't use the rewrite of the query to the XE?

    That is right.

    * Cause: The specified feature is not enabled.
    * Action: Try not to use this feature.

  • What is 'Table of container' in materialized views

    Hello

    What is meant by ' Container Table ' in materialized views?

    "Materialized view" (MV) is, in fact, a table, rather than a view.

    The term MV is used of the 9i database. In the 7 and 8 databases is the term 'snapshot' (to make things more complicated, the MV concept appeared in the 8i database, but in the context of the data warehouse).

    When you create a MV, for example. using the:

    Create materialized view emp_mv

    full refresh on demand

    as select empno, ename from EMP

    /

    you have, in fact, have created two objects in the data dictionary:

    Select object_name, object_type

    from user_objects

    where object_name = 'EMP_MV. '

    order by 1, 2;

    OBJECT_NAME OBJECT_TYPE

    --------------------- -------------------

    MATERIALIZED VIEW EMP_MV

    EMP_MV TABLE

    You can remove MV and a table of container:

    drop materialized view emp_mv;

    or you can delete only MV, preserving a table containing:

    Let fall the materialized view emp_mv maintain the table;

    Kind regards

    Zlatko

  • How to get a materialized view can freshen up after the job is 'broken '.

    We have created a materialized view some time ago with the following statement:

    create a materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M

    full refresh on demand

    Start with to_date (August 30, 2009 04:00 ',' dd-mm-yyyy hh24:mi:ss') next trunc (sysdate) + (28/24)

    as

    Select sxv_emp_cert_all.*

    of sxv_employee_certification_all sxv_emp_cert_all;

    This week, we found that it had not been updated for about a month

    In dba_jobs the broken column was 'Y', next_date time something like 01-01-4000 and failures 16

    When I ran it manually by running

    DBMS_MVIEW BEGIN. REFRESH ("SXV_PUB_EMPLOYEE_CERT_ALL_M", "C"); END;

    I found that one of the columns was too small (probably one of the underlying tables columns had been extended since the creation of the materialized view)

    After the correction of what I ussied yesterday (29/08/2013) education:

    change the SXV_PUB_EMPLOYEE_CERT_ALL_M materialized view

    full refresh on demand

    Start with to_date (August 30, 2009 04:00 ',' dd-mm-yyyy hh24:mi:ss') next trunc (sysdate) + (28/24)

    After that the table dba_jobs showed me the 04:00 08/30/2013 as the date of the next

    I expected to run that night at 04:00, but there is no

    last_date column value was still of a month ago, the broken column still shows 'Y '.

    and the next date 08/30/2013 04:00 (whereas it would have been set to the 01:00 08/31/2013

    Freezes

    DBMS_MVIEW BEGIN. REFRESH ("SXV_PUB_EMPLOYEE_CERT_ALL_M", "C"); END;

    has given no mistake this time

    and in User_Mview_Analysis, the last_refresh_date column showed the time that I had run

    No idea how to do the job "unbroken" again for the view refreshes every night?

    the database is Oracle Database 10g Release 10.2.0.4.0

    Kind regards

    Remco

    Thanks for all your useful and accurate answers. but finally I found it myself

    exec dbms_job.broken (, false);

  • materialized view ora-00907, although sql query works well

    Hello

    It seems to be a bug with db oracle 10.2.0.1 and his prod. env, I can't apply the patch quickly, can anyone give me a tip

    CREATE THE MV_TEN MATERIALIZED VIEW
    BUILDING THE INDEX REFRESH IMMEDIATE TO COMPLETE ON DEMAND HELP
    AS
    SELECT ten.tcy_refno AS TENANCY_REF,
    Rev.rac_accno AS REV_ACC_NO,
    Rev.rac_last_aba_date AS LAST_ABA_DATE,
    Rev.rac_last_aba_balance AS LAST_ABA_BALANCE,
    AAA.aca_status AS ARREARS_STATUS,
    AAA.aca_ara_code AS ARREARS_ACTION_CODE,
    AAA.aca_effective_date AS EFFECTIVE_DATE,
    AAA.aca_balance AS ACCOUNT_BALANCE,
    ARA.ara_description AS ARREARS_DESCRIPTION,
    NPA.nop_text
    OF REVENUE@remotedb rev.
    Ten TENANCT@remotedb.
    ACCOUNT_ARREARS_ACTIONS@remotedb aaa
    LEFT OUTER JOIN ARREARS_ACTIONS@remotedb ara
    ON aaa.aca_ara_code = ara.ara_code
    LEFT OUTER JOIN NOTEPADS@remotedb IR
    ON aaa.aca_reusable_refno = npa.nop_reusable_refno
    WHERE ten.tcy_refno = rev.rac_tcy_refno
    AND rev.rac_end_date IS NULL
    AND rev.rac_accno = aaa.aca_rac_accno
    AND aaa.aca_status! = "DEL".
    AND npa.nop_current_ind = 'Y ';

    ORA-00907: missing just paraenthesis


    Thank you

    See

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:4226402560732847:P11_QUESTION_ID:6585774577187

  • A Clause WITH usable in Materialized View SQL

    Hello

    We can use SQL WITH clause Materialized View.

    Thank you

    Hello

    Here is an example

    CREATE MATERIALIZED VIEW MV_TEST
    BUILD IMMEDIATE
    REFRESH FORCE ON DEMAND
    AS
    WITH t AS (SELECT owner, object_type, COUNT ( * )
               FROM my_objects
               GROUP BY object_type, owner)
    SELECT *
    FROM t
    WHERE owner IN ('SYS', 'SYSTEM');
    

    Concerning

Maybe you are looking for

  • X200s &amp; external 24 "ability to portrait

    I am about to buy a x200s, but need to know if it with Intel 4500MHD can drive an external monitor 24 '' swivels into portrait mode. Anyone? Thank you

  • Problem with app painted super-simple paper setting

    I have a simple application, where I'm putting the wallpaper. It was based on the example of Web-works on Github, but instead of using a user supplied photo I use one that is packed in the app. Simple I have a button that when clicked calls the follo

  • Cannot open a file because the file is not found

    I can't open Photoshop because zero files could not be found

  • ALienware Alpha - controller question

    I just got my Alienware Alpha from Friday, rather than go through the console mode with the controller provided instead, I plugged a mouse & keyboard & entered into mode of office since the beginning. Now my 360 controller acts as a mouse & controlle

  • How do I roll back first Pro CC 2014.0.1 to 2014.0.0?

    2014.0.1 destroys my ability to download large files on YouTube that I need to be able to do. The feature was beautiful before the nouveau.01 that went online Thursday 7/25.Technical support advised me to uninstall and then stop the re - install 90%.