Materialized View - Point in time refresh

I have a MV group which refreshes from a bunch of master tables. The master tables are constantly getting updated from an OLTP application. In this scenario, I want all the MVs to hold data which was available at the time the refresh started and not the changes after that.
Eg:
Master tables are T1, T2 ... T20 refresh to MVs T1_MV, T2_MV ...T20_MV
All the MVs T1_MV to T20_MV are in a refresh group.
At 3 PM: Execute an explicit refresh for the MV refresh group
At 3:05 PM: OLTP application inserts a record into table T5 & commits
At 3:06 PM (rather any time after 3:05 PM): Refresh of T5_MV happens. Will the latest insert get captured in T5_MV? I actually don't want this to happen for my requirement, because I want the data captured as of 3 PM into the MVs.
The Oracle Advanced Replication guide says the following about Materialized Views -
+"A materialized view is a replica of a target master from a single point in time."+
From the above line, it looks like by default this will not be captured in the MV. Can someone please confirm my understanding ?

MVs in a Refresh Group when refreshed as a Refresh Group are refreshed as of the same point in time.
So if the Refresh Group begins at 3:00pm and ends at 3:25pm, all the MVs in that group reflect the data as in the source tables as of 3:00pm, ignoring any updates to source tables after 3:00pm (i.e. while the Group is being refreshed).
However, if you refresh MVs individually, then each MV is refreshed at it's relative point in time -- so individual Refreshs of MVs would not be to the same point in time.
How have you defined the Refresh Group ?
How do you execute the Refresh for the whole Group ? What PLSQL procedure do you use ? What parameters do you use ?
Ensure that you do not execute an individual MV Refresh.
Hemant K Chitale
http://hemantoracledba.blogspot.com

Similar Messages

  • How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS

    Hi @ all,
    i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
    It works fine with a simple Request in the MATERIALIZED VIEW:
    CREATE MATERIALIZED VIEW MV_ZOTD43_P
    TABLESPACE GDII
    BUILD IMMEDIATE
    REFRESH FORCE AS
    SELECT * FROM ZOTD43_P;
    COMMIT;
    CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
    TABLESPACE "GDII"
    WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
    call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
    But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
    CREATE MATERIALIZED VIEW MV_TEST
    TABLESPACE GDII
    BUILD IMMEDIATE
    REFRESH FORCE AS
    SELECT lptd04_p.sst_nr AS sst_nr,
    lptd03_p.aaaa AS aaaa,
    lptd04_geom.geom as geom
    FROM lptd04_p lptd04_p
    JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
    JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
    JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
    COMMIT;
    CREATE MATERIALIZED VIEW LOG ON LPTD04_P
    TABLESPACE "GDII"
    WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
    call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
    Error report:
    SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
    ORA-06512: in Zeile 1
    12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
    *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.
    Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
    Regards,
    Greq

    Thanks for the link Alessandro ,
    the error seems something to do with the Column-Type SDO_GEOMETRY, so
    i create a new thread in the Spatial Discussion forum:
    FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
    Regards,
    Greq

  • Materialized view and starting time

    Hi,
    There is already this materialized view in the database that starts at Three A.M.:
    CREATE MATERIALIZED VIEW ovm_position_det
    BUILD IMMEDIATE
    REFRESH FORCE
    NEXT TRUNC(SYSDATE) + 1 + 3/24
    WITH PRIMARY KEY
    I have to create a second one, I wonder if I can write
    NEXT TRUNC(SYSDATE) + 1 + 3.5/24
    To start it at 3:30 A.M.
    (Both take about 10 minutes query time on the production database).
    Many thanks for your help

    Jean
    Yes you can. It's just simple date arithmetic.
    <date> + <number> means <number> days after the date.
    DATE goes down to seconds - so if you want it tomorrow at 3.30 and 20 seconds you can say
    TRUNC(SYSDATE) + 1 + 3/24 + 30/(60*24) + 20/(60*60*24)
    or generally:
    TRUNC(SYSDATE) + days + (hours + (minutes + seconds/60)/60)/24
    HTH
    Regards Nigel

  • Materialized view taking long time to refresh

    I want to understand why materialized view refresh takes more time than running the sql for the materialized view.
    For example say I have a materialized view test_mv which is created as below; When I run just the select statement i get the result within 34 secs whereas if I try to refresh it using
    BEGIN
    DBMS_MVIEW.refresh ('wi_mv7_monthly','C',ATOMIC_REFRESH=>false);
    end;
    /This takes around 74 secs
    MV creation
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    create materialized view TEST_MV
      COLUMN_NAME_1,
      OBJECT_NAME,
      COLUMN_ID,
      "SUM(C.DATA_LENGTH)"
    ) organization heap
    partition by list (COLUMN_ID) (
    PARTITION "first_10_col" VALUES
        1, 2, 3, 4, 5, 6, 7, 8, 9, 10
       PARTITION "After_10_col" VALUES
        11,12, 13, 14, 15, 16, 17, 18, 19, 20
       PARTITION "NONE" VALUES (DEFAULT)
    BUILD IMMEDIATE USING INDEX REFRESH COMPLETE ON DEMAND USING DEFAULT LOCAL ROLLBACK SEGMENT USING ENFORCED CONSTRAINTS
    as
    select  /*+ parallel(o,8) parallel(c,2) */
    C.COLUMN_NAME as COLUMN_NAME_1,O.OBJECT_NAME,C.COLUMN_ID,SUM(C.DATA_LENGTH) from ALL_OBJECTS O
    join ALL_tab_columns c on c.table_name=o.object_name
    group by
    C.COLUMN_NAME,O.OBJECT_NAME,C.COLUMN_IDEdited by: user627047 on Sep 6, 2012 6:56 AM

    I want to understand why materialized view refresh takes more time than running the sql for the materialized view.Mview has to save the data as well .

  • Materialized view takes long to refresh

    On Oracle 11g2, I created a materialized view fast refresh on commit CREATE MATERIALIZED VIEW mv_case
    PARALLEL BUILD IMMEDIATE REFRESH FAST ON COMMIT ENABLE QUERY REWRITE AS
    SELECT p.jperson_id,offense_id,CASE_SENTENCE_DATE,court_ref,CASE_COURT_ORI,
      c.CASE_VERDICT_DATE,CASE_DOCKET,c.CASE_EXPUNGED,c.jcase_id,cc.CYCLEID_ID,
      p.rowid p_rowid,xc.rowid xc_rowid,c.rowid c_rowid,cxo.rowid cxo_rowid,cc.rowid cc_row_id
    FROM jperson p,jperson_x_jcase xc,jcase c,jcase_x_offense cxo,jcase_x_cycleid cc
    where p.jperson_id = xc.jperson_id(+) and xc.jcase_id = c.jcase_id(+)
      and c.jcase_id = cxo.jcase_id(+) and c.jcase_id=cc.jcase_id;
    create index idx_mv_case_pid on mv_case(jperson_id);
    ALTER TABLE mv_case ADD (CONSTRAINT PK_MV_CASE PRIMARY KEY(jcase_id,offense_id)) ;
    create index idx_mv_case_p_rowid on mv_case(p_rowid);
    create index idx_mv_case_xc_rowid on mv_case(xc_rowid);
    create index idx_mv_case_c_rowid on mv_case(c_rowid);
    create index idx_mv_case_cxo_rowid on mv_case(cxo_rowid);
    create index idx_mv_case_cc_rowid on mv_case(cc_row_id); I inserted one single row into one of the master table
    insert into jcase_x_offense (offense_id,jcase_id) values ('test_row3','test_row3');
    commit; The commit tooks a quite long. I looked into the trace file and the actual insert took 0.01 seconds but one of the internel DML took most of time. I copy the relevant TKPROF output for the internal DML belowINSERT INTO QAPF.MV_CASE SELECT /*+ NO_MERGE(JV$) */
      MAS$4.JPERSON_ID,JV$.OFFENSE_ID,MAS$2.CASE_SENTENCE_DATE,
      MAS$2.COURT_REF,MAS$2.CASE_COURT_ORI,MAS$2.CASE_VERDICT_DATE,
      MAS$2.CASE_DOCKET,MAS$2.CASE_EXPUNGED,MAS$2.JCASE_ID,
      MAS$0.CYCLEID_ID,MAS$4.ROWID,MAS$3.ROWID,MAS$2.ROWID,JV$.RID$,
      MAS$0.ROWID
      FROM ( SELECT MAS$.ROWID RID$  ,  MAS$.*  FROM  QAPF.JCASE_X_OFFENSE MAS$ WHERE ROWID IN
              (SELECT  /*+ HASH_SJ */ CHARTOROWID(MAS$.M_ROW$$) RID$
               FROM QAPF.MLOG$_JCASE_X_OFFENSE MAS$ WHERE MAS$.XID$$ = :1 )) JV$,
      JCASE_X_CYCLEID AS OF SNAPSHOT(:B_SCN)  MAS$0, JCASE AS OF SNAPSHOT(:B_SCN)  MAS$2,
      JPERSON_X_JCASE AS OF SNAPSHOT(:B_SCN)  MAS$3, JPERSON AS OF SNAPSHOT(:B_SCN)  MAS$4
      WHERE (MAS$4.JPERSON_ID=MAS$3.JPERSON_ID(+)
      AND MAS$3.JCASE_ID=MAS$2.JCASE_ID(+)
      AND MAS$2.JCASE_ID=JV$.JCASE_ID(+)
      AND MAS$2.JCASE_ID=MAS$0.JCASE_ID)
      AND NOT EXISTS (
        SELECT 1 FROM QAPF.MV_CASE SNA2$
        WHERE (SNA2$.P_ROWID = MAS$4.ROWID)
        AND (SNA2$.XC_ROWID = MAS$3.ROWID OR MAS$3.ROWID IS NULL )
        AND (SNA2$.C_ROWID = MAS$2.ROWID OR MAS$2.ROWID IS NULL )
        AND (SNA2$.CC_ROW_ID = MAS$0.ROWID OR MAS$0.ROWID IS NULL )
        AND JV$.RID$ IS NULL)
      AND NOT EXISTS (
        SELECT 1  FROM JCASE_X_OFFENSE MAS_INNER$, JCASE AS OF SNAPSHOT(:B_SCN)  MAS_OUTER$
        WHERE MAS$2.ROWID = MAS_OUTER$.ROWID AND JV$.RID$ IS NULL
        AND MAS_OUTER$.JCASE_ID=MAS_INNER$.JCASE_ID)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1     99.51     364.87     377012   17412972          1           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2     99.51     364.87     377012   17412972          1           0
    Rows     Row Source Operation
          0  LOAD TABLE CONVENTIONAL  (cr=17412968 pr=377012 pw=120527 time=0 us)
          0   FILTER  (cr=17412968 pr=377012 pw=120527 time=0 us)
    3363837    HASH JOIN RIGHT OUTER (cr=264914 pr=280254 pw=120527 time=35845080 us cost=299444 size=1029332286 card=3363831)
          1     VIEW  (cr=112490 pr=180864 pw=119722 time=0 us cost=30743 size=78 card=1)
          1      HASH JOIN SEMI (cr=112490 pr=180864 pw=119722 time=0 us cost=72627 size=208 card=1)
    11354346       TABLE ACCESS FULL JCASE_X_OFFENSE (cr=112488 pr=112447 pw=0 time=4814838 us cost=30703 size=749386770 card=11354345)
          1       TABLE ACCESS BY INDEX ROWID MLOG$_JCASE_X_OFFENSE (cr=2 pr=0 pw=0 time=0 us cost=1 size=142 card=1)
          1        INDEX RANGE SCAN IDX_MLOG$_XID_JCASE_X_OFFENSE (cr=1 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 98375)
    3363837     HASH JOIN  (cr=152424 pr=99390 pw=805 time=29973970 us cost=268690 size=766953468 card=3363831)
    2994042      INDEX FAST FULL SCAN JPERSON_I0 (cr=18134 pr=0 pw=0 time=772990 us cost=17450 size=134731845 card=2994041)(object id 83738)
    3363837      HASH JOIN  (cr=134290 pr=99390 pw=805 time=25292580 us cost=212128 size=615581073 card=3363831)
    3363837       HASH JOIN  (cr=69008 pr=34127 pw=805 time=4750330 us cost=101637 size=393568929 card=3363837)
    3363837        TABLE ACCESS FULL JCASE_X_CYCLEID (cr=33337 pr=33322 pw=0 time=2942460 us cost=33569 size=222013242 card=3363837)
    6586646        TABLE ACCESS FULL JCASE (cr=35671 pr=0 pw=0 time=1584102 us cost=35988 size=335918895 card=6586645)
    6586635       TABLE ACCESS FULL JPERSON_X_JCASE (cr=65282 pr=65263 pw=0 time=5446686 us cost=65632 size=434717844 card=6586634)
    3363837    FILTER  (cr=17148054 pr=96758 pw=0 time=0 us)
    3363837     MAT_VIEW ACCESS BY INDEX ROWID MV_CASE (cr=17148054 pr=96758 pw=0 time=0 us cost=7 size=40 card=1)
    32464070      INDEX RANGE SCAN IDX_MV_CASE_P_ROWID (cr=4489770 pr=15250 pw=0 time=19576798 us cost=3 size=0 card=7)(object id 98467)
          0    FILTER  (cr=0 pr=0 pw=0 time=0 us)
          0     NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us cost=4 size=78 card=1)
          0      TABLE ACCESS BY USER ROWID JCASE (cr=0 pr=0 pw=0 time=0 us cost=1 size=45 card=1)
          0      INDEX RANGE SCAN JCASE_X_OFFENSE_I0 (cr=0 pr=0 pw=0 time=0 us cost=3 size=33 card=1)(object id 83623)Questions:
    1) what are the objects like JCASE AS OF SNAPSHOT(:B_SCN) ? Can I index them? I tried access it but got error
    select * from JCASE AS OF SNAPSHOT(:B_SCN) ;
    ORA-08187: snapshot expression not allowed here
    08187. 00000 - "snapshot expression not allowed here"
    *Cause:    A snapshot expression using AS OF was specified when not allowed.
    *Action:   Do not use the AS OF clause
    2) In the inline view following the firs FROM, it used ROWID in where clause. I tried create an index on ROWID, and error
    create index idx_jcase_offense_rid on JCASE_X_OFFENSE(rowid)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    Note: I checked that I have indexes all fields in all where clauses in the DML except rowid.
    Thanks for help.

    sybrand_b wrote:
    1 Apparently Oracle is using Flashback technology when no materialized view logs have been set up
    As your MV is a complex MV it is not a candidate for FAST REFRESH ON COMMIT.
    I haven't looked closely at how 11.2 has changed the "fast refresh on commit" - but I would have expected it to raise an Oracle error when the OP tried to create the materialized view with that option if it were not possible.
    I think your first comment is probably the more important one - if the user sets up suitable materialized view logs on all the tables in the outer join then it's possible that the fast refresh could work properly.
    This is pure speculation, of course, based on the absence of an error message.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
    +"Science is more than a body of knowledge; it is a way of thinking"+
    +Carl Sagan+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Materialized view (creating and complete refresh)

    Good day.
    I have a huge query that is used to create a materialized view. The query consist of 9 joins, a lot of aggregations, some subqueries, so we can say it is rather huge. The query itself executes for about 30 seconds and returns about 200 rows. The materialized view creates and refreshes for more than 30 minutes. Can someone please explain me the mechanism of materialized view creation which causes such bad performance.
    We use Oracle Database 9.2.0.4.
    Thank you in advance.

    I've fount the solution. May be it will be useful for someone not regarding that 9.2 database is less used today than 10.2.
    I studied carefully the plan of the query and the plan of insert statement that is used when creating materialized view and found the cause of trouble. Insert statements generates VIEW PUSHED PREDICATE and BITMAP CONVERSION FROM ROWIDS when parsing. Bitmap conversion can be removed by setting environment parameter btree_bitmap_plans to false (a well-known issue), but I decided not ot change the production environment. The pushed predicate can be removed by using hint NO_PUSH_PRED to each subquery used in a materialized view. This step reduced the time of materialized view creation and execution to about a minute.
    Thank everyone who tried to help.

  • MATERIALIZED VIEW BECOMES INVALID AFTER REFRESH

    Hello All,
    I have wierd problem ,
    In my enviroinment we have a MATERIALIZED VIEW ,which is refreshed by a sheduled DBMS_SNAPSHOT.REFRESH Job post the refresh it becomes invalid and every time we have to compile it manually ,Could anybody help with a solution .Thanks a lot in Advance .
    DETAILS :
    ======
    VERSION:Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    HOST: IBM AIX

    Is the MV part of a refresh group?
    Post the command and parameters used by the scheduled job to do the refresh as well as the parameters you use when you do it manually.

  • Materialized view long transaction time

    I am using Oracle DB 11g R2 and created a materialized view log WITH SEQUENCE. I need to find out the exact date/time the transaction was made. I see that my MV log has the 'XID$$' column (NUMBER 22), but not sure how to determine the date/time from that. Is there another view/table I can join to get me that info? I see some have 'XID' column but they are RAW(8).
    Thanks
    Edited by: bobmagan on Feb 27, 2013 11:57 AM

    - CDC is at least as performant as materialized view logs. If you do asynchronous CDC, it performs better since you're not burdening the source transactions with the overhead of synchronously maintaining the materialized view logs.
    - CDC is at least as effective as materialized view logs. Since CDC is designed to publish changes to custom consumers where materialized view logs are designed to be used by Oracle to refresh a materialized view, it strikes me as a much safer solution. If someone comes along and creates a materialized view that starts using your materialized view log, for example, a solution that involves custom code to manipulate the materialized view is almost certainly going to fail.
    - CDC isn't an extra cost option so there shouldn't be a cost difference
    That leaves the question of simplicity. I'll certainly grant you that a materialized view log solution may appear simpler. But a lot of that simplicity advantage disappears over time. The fact that we're talking about doing things like querying relatively obscure data dictionary tables like all_summap, for example, is added complexity that a CDC-based solution doesn't need. But over time, I'd much rather maintain a CDC-based solution rather than hooking in to materialized view logs. If someone wants to build a materialized view and Oracle happens to be able to use the materialized view log you've created for your own CDC, the custom solution will stop working. Over time, Oracle introduces more and more functionality that allows the ROWID of a row to change (shrinking a table, flashback, etc.). If you're using CDC, Oracle will take care of making sure that all those things are presented to you correctly. If you're rolling your own solution, you have to test and ensure that your code handles all those cases correctly. When Oracle makes a change in some future release that you hadn't considered, you've got to notice the potential problem, code the fix, and test it. Most places are probably going to miss something and only discover that there is a problem when they do something like shrink a table and then find that their custom solution doesn't handle that gracefully.
    Justin

  • Materialized view logs for Fast refreshes

    Hi,
    I created MV and MV logs on the base table/main table. I set the base table in NOLOGGING MODE. so ofcourse redo is not gonna generate during DML but i wanted to know that:
    Will NOLOGGING effect the MV logs for fast refreshes?
    I came up on conclusion that MV logs are nothing to do with Redo Logs and would have no impact on MV logs for fast refresh since i have set my all base table in NOLOGGING MODE.
    Looking forward for expert opinion.
    REGARDS,

    Though I'm not an expert...
    SQL> alter table emp nologging;
    Table altered.
    SQL> create materialized view log on emp;
    Materialized view log created.
    SQL> select * from tab;
    TNAME TABTYPE CLUSTERID
    EMP TABLE
    BONUS TABLE
    SALGRADE TABLE
    RUPD$_EMP TABLE
    MLOG$_EMP TABLE
    SQL> insert into emp values(1000,'Matt','Test',100,sysdate,1000,1000,10,11,11);
    1 row created.
    SQL> select *From mlog$_emp;
    EMPNO SNAPTIME$ D O
    CHANGE_VECTOR$$
    1000 01-JAN-00 I N
    FEFF

  • Create materialized view is failing when refresh fast is used

    version 10.2.0.4 on solaris
    This statement is working fine
    CREATE MATERIALIZED VIEW MVIEW1
    TABLESPACE MIS_CURD01
    BUILD IMMEDIATE
    as
    SELECT ACTIVITY_ID "ACTIVITY_ID",
    ASSOC_ID "ASSOC_ID",
    PIT_ROLE_CODE "PIT_ROLE_CODE",
    PIT_BANK_CODE "PIT_BANK_CODE",
    PIT_COST_CENTER "PIT_COST_CENTER",
    RESP_ASSOC_IND "RESP_ASSOC_IND"
    FROM TABLE1@DBLINK;
    The statement with fast refresh is failing with this error message
    ERROR at line 18:
    ORA-12018: following error encountered during code generation for
    "TABLE1"
    ORA-00942: table or view does not exist
    Here is the statement
    CREATE MATERIALIZED VIEW MVIEW1
    TABLESPACE MIS_CURD01
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    USING INDEX TABLESPACE MIS_CURI01
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    AS
    SELECT ACTIVITY_ID "ACTIVITY_ID",
    ASSOC_ID "ASSOC_ID",
    PIT_ROLE_CODE "PIT_ROLE_CODE",
    PIT_BANK_CODE "PIT_BANK_CODE",
    PIT_COST_CENTER "PIT_COST_CENTER",
    RESP_ASSOC_IND "RESP_ASSOC_IND"
    FROM TABLE1@DBLINK;
    Any idea what's going wrong here. Thanks for your help in advance.
    Edited by: user11319873 on Jun 30, 2010 4:17 PM

    Refresh FAST requires that
    a. An MV Log (Snapshot Log) be created on the source table
    b. The user doing the refresh (i.e. the account that the DBLink uses) has SELECT privilege on the MV Log.
    Hemant K Chitale

  • Oracle Materialized view tables not getting refreshed automatically.

    At Destination:--
    CREATE MATERIALIZED VIEW PROG_MEDIA
    TABLESPACE ONA_TS1
    BUILD IMMEDIATE
    REFRESH FAST with rowid
    START WITH SYSDATE
    NEXT SYSDATE+1/96
    AS (select /*+ PARALLEL(a,6) */ * from PROG_MEDIA@onair a);
    exec dbms_mview.refresh('PROG_MEDIA','C');
    At Source:--
    CREATE MATERIALIZED VIEW LOG ON ONAIR.PROG_MEDIA
    TABLESPACE MVLOG
    WITH ROWID;
    Fired manually:--
    13:00:43 SQL> exec dbms_mview.refresh('PROG_MEDIA','C');
    PL/SQL procedure successfully completed.
    At source:--
    13:18:35 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
    PROG_MEDIA_ID
    PROG_MEDIA_NAME
    102226
    test
    At Destination:--
    14:03:28 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
    PROG_MEDIA_ID PROG_MEDIA_NAME
    102226 UTSAV-5-162077
    JOB LOG_USER THIS_DATE LAST_DATE_TIME NEXT_DATE_TIME INTERVAL FAILURES WHAT
    242 ONAIR 17-05-11 14:17:24 SYSDATE+1/96 7 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
    A"');
    242 ONAIR 17-05-11 14:32:25 SYSDATE+1/96 8 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
    A"');
    1> I have scheduled this refresh job for every 15mins, but its not getting executed. Also my job_queue_process is '20'. Whenever i execute it manually it get's refresh.
    2> I can schedule a cron for the same for every 15mins but i really dont want to do it.
    Kindly help me out.

    Hi,
    I have created MV_CAPABILITIES_TABLE & executed below commands:--
    17:56:54 SQL> EXECUTE DBMS_MVIEW.EXPLAIN_MVIEW ('"ONAIR"."PROG_MEDIA"');
    PL/SQL procedure successfully completed.
    17:57:26 SQL> SELECT capability_name, possible, SUBSTR(related_text,1,8)
    17:57:27 2 AS rel_text, SUBSTR(msgtxt,1,60) AS msgtxt
    17:57:27 3 FROM MV_CAPABILITIES_TABLE
    17:57:27 4 ORDER BY seq;
    CAPABILITY_NAME P REL_TEXT MSGTXT
    PCT N
    PCT N
    REFRESH_COMPLETE Y
    REFRESH_COMPLETE Y
    REFRESH_FAST Y
    REFRESH_FAST Y
    REWRITE N
    REWRITE N
    PCT_TABLE N PROG_MED relation is not a partitioned table
    PCT_TABLE N PROG_MED relation is not a partitioned table
    REFRESH_FAST_AFTER_INSERT Y
    REFRESH_FAST_AFTER_INSERT Y
    REFRESH_FAST_AFTER_ONETAB_DML Y
    REFRESH_FAST_AFTER_ONETAB_DML Y
    REFRESH_FAST_AFTER_ANY_DML Y
    REFRESH_FAST_AFTER_ANY_DML Y
    REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
    REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
    REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
    REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
    REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
    REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
    REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
    REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
    REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
    REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
    REWRITE_GENERAL N materialized view cannot support any type of query rewrite
    REWRITE_GENERAL N materialized view cannot support any type of query rewrite
    REWRITE_GENERAL N query rewrite is disabled on the materialized view
    REWRITE_GENERAL N query rewrite is disabled on the materialized view
    REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
    REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
    PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
    PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
    34 rows selected.
    Elapsed: 00:00:00.09
    What to be done next?
    Also i fired the job manually by:--
    17:38:02 SQL> set serveroutput on
    17:39:45 SQL> EXEC DBMS_JOB.RUN(242);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.48

  • Create materialized view as part of refresh group

    Hello,
    When I create a materialized view in 11g it automatically creates its own refresh group. How can I create the materialized group as part of an existing refresh group? (I know I can drop the individual refresh group and add the mview to the main refresh group but that is a pain).
    Thank you,

    >
    How can I create the materialized group as part of an existing refresh group?
    >
    You can't - you need to add the MV to the existing refresh group.
    See the Add Procedure of the DBMS_REFRESH package
    http://docs.oracle.com/cd/B28359_01/server.111/b28327/rarrefreshpac.htm

  • Materialized View - creation and schedule (To automate Refresh)

    Hi All,
    I have one table based on SQL Query (multiple tables) and loading data every day through procedure.
    When I execute the procedure is taking lot of time to load data. That’s why I am planning to create Materialized view to refresh the data in a table every day at some point of time (ex:-9.00 am).
    Exclude procedure and materialized view are there any ways to refresh the data?
    Can you and all please help me to create materialized view and schedule (Automate refresh).
    begin
    insert into CLAIMS_PRODUCT_TAB
    select
    substr(at.ATN_VOUCHER_NUMBER,1,6) as BRANCH,
    t.MONTH_NAME as MONTH,t.FISCAL_YEAR as YEAR,
    bb.ACC_ACCOUNT_TYPE as TYPE,
    aa.ACC_DEPARTMENT_CODE as DEPT,
    pr.PRODUCT_NAME as PRODUCT,
    case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end as HEAD,
    case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end as DEPT_NAME,
    count(distinct at.CLAIM_ID) as CLAIMS,
    --count( distinct at.POLICY_ID) as POLICIES,  
    sum(atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT) as totals
    from
    ACCOUNTING_TRN_DETAIL atd,time t,
    ACCOUNT bb,
    ACCOUNT aa,claim c, policy p,product pr,
    accounting_transaction at
    where bb.ACC_ACCOUNT_ID = aa.ACC_ACC_ACCOUNT_ID
    and at.CLAIM_ID = c.CLAIM_ID
    and c.POLICY_ID = p.POLICY_ID
    and p.PRODUCT_ID = pr.PRODUCT_ID
    and aa.ACC_ACCOUNT_ID = atd.ACC_ACCOUNT_ID
    and atd.ATN_ACCOUNTING_TRANSACTION_ID = at.ATN_ACCOUNTING_TRANSACTION_ID
    and trunc(at.ATN_TRANSACTION_DATE) = t.CAL_DATE
    and (bb.ACC_ACCOUNT_TYPE in ('1301','5383'))
    group by substr(at.ATN_VOUCHER_NUMBER,1,6)
    ,t.MONTH_NAME
    ,t.FISCAL_YEAR,bb.ACC_ACCOUNT_TYPE
    ,aa.ACC_DEPARTMENT_CODE
    ,pr.PRODUCT_NAME
    , case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end
    ,case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end );
    end;
    Thanks and Regards
    Venkat

    Is the MV and the source tables on the same database? If this is a remote MV, then check the source site if there are any issues (TEMP, UNDO space issues).

  • Fast refresh on MATERIALIZED VIEW

    Oracle 10 g R2 (10.2.0.5)
    CREATE MATERIALIZED VIEW scott.mv_test
    TABLESPACE users
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH FORCE ON DEMAND
    WITH PRIMARY KEY
    AS
    Select ....
    I have this MV, when I do the FAST refersh as follows , I am getting error
    SQL> execute DBMS_MVIEW.REFRESH( 'MV_TEST','f');
    BEGIN DBMS_MVIEW.REFRESH( 'MV_TEST','f'); END;
    ERROR at line 1:
    ORA-12004: REFRESH FAST cannot be used for materialized view "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's working with Complete refresh.
    Is that expecte, any help would be appreciated.
    Thanks,

    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/

  • Creation of fast refresh materialized view

    Hi,
    I am creating fast refreshable materialized view.At that time i am getting error message
    ORA-12052: cannot fast refresh materialized view OPS$QDW.EMP_DEPT_MV
    I created log's also on that tables(emp,dept)
    Please Help me any body.
    I am using oracle 8.1.7.4.0
    below the scripts i created
    CREATE MATERIALIZED VIEW LOG ON emp
    tablesspace vijay_test
    WITH ROWID
    INCLUDING NEW VALUES
    CREATE MATERIALIZED VIEW LOG ON DEPT
    tablesspace vijay_test
    WITH ROWID
    INCLUDING NEW VALUES
    CREATE MATERIALIZED VIEW emp_dept_mv
    TABLESPACE vijay_test
    BUILD IMMEDIATE
    REFRESH FAST
    ENABLE QUERY REWRITE
    as
    select e.ename,e.empno,e.deptno,d.loc from emp e, dept d
    where e.deptno=d.deptno

    It will be possible to create a Materialised view with up to 20 tables, but you have to understand the restrictions on complex Materialised views with regards to fast refresh.
    To help your understanding, refer to Materialized View Concepts and Architecture
    <br>
    Oracle Database FAQs
    </br>

Maybe you are looking for