Error on compile the Materialized view refresh

Hello all,
I am getting issue while compile the Materialized view refresh.
ALTER MATERIALIZED VIEW FII_GL_AGRT_SUM_MV COMPILE;--( did successfully)
exec DBMS_MVIEW.REFRESH('APPS.FII_GL_AGRT_SUM_MV','C');
Error:
ORA-12008: error in materialized view refresh path
ORA-01013: user requested cancel of current operation
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
ORA-06512: at line 1
Please tell me what could be the issue
Thanks and Regards,
Muthu

Hello all,
I am using R12.1.3.
While execute the below command, its not completing..
exec DBMS_MVIEW.REFRESH('APPS.FII_GL_AGRT_SUM_MV','C');
I found the reason why its not completing. Because its Refresh In Progress.
SQL> select u.name owner,o.name mview_name, s.obj#,lastrefreshdate
*2 from sys.obj$ o, sys.sum$ s, sys.user$ u*
*3 where u.user# = o.owner# and o.obj# = s.obj# and o.type# = 42 AND bitand(s.mflags, 8) = 8;*
OWNER                          MVIEW_NAME                           OBJ# LASTREFRE
APPS                           FII_GL_AGRT_SUM_MV                 438268 06-MAR-13
SQL> select decode(bitand(s.mflags,8), 8,'Refresh In Progress','Not being refreshed')
*2 from sys.obj$ o, sys.user$ u, sys.sum$ s*
*3 where o.obj# = s.obj# and o.owner# = u.user# and o.type# = 42*
*4 and o.name='FII_GL_AGRT_SUM_MV';*
DECODE(BITAND(S.MFL
Refresh In Progress
How to stop Refreshing or is there any other solution for this issue?
Please clarify me...
Thanks and Regards,
Muthu

Similar Messages

  • ORA-12008: error in materialized view refresh path... Bug?

    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> drop materialized view log on test_tbl;
    Materialized view log dropped.
    SQL> drop materialized view mv_test_tbl;
    Materialized view dropped.
    SQL> drop table test_tbl;
    Table dropped.
    SQL> create table test_tbl(
      2   test_id   number(10)   primary key,
      3   test_name varchar2(10) not null)
      4  ;
    Table created.
    SQL> insert into test_tbl values (1,'bob');
    1 row created.
    SQL> insert into test_tbl values (2,'joe');
    1 row created.
    SQL> insert into test_tbl values (3,'john');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create materialized view log on test_tbl
      2  with primary key , rowid, sequence
      3  (
      4   test_name
      5  )
      6  including new values;
    Materialized view log created.
    SQL> create materialized view mv_test_tbl
      2  refresh fast on commit
      3  as
      4  select test_id,
      5         test_name
      6  from   test_tbl;
    Materialized view created.
    SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
    0 rows updated.
    SQL> commit;
    Commit complete.Ok, so that's all good. Now if I create the materialized view log with the COMMIT SCN option:
    SQL> drop materialized view log on test_tbl;
    Materialized view log dropped.
    SQL> drop materialized view mv_test_tbl;
    Materialized view dropped.
    SQL> create materialized view log on test_tbl
      2  with primary key , rowid, sequence
      3  (
      4   test_name
      5  ),
      6  commit scn
      7  including new values;
    Materialized view log created.
    SQL> create materialized view mv_test_tbl
      2  refresh fast on commit
      3  as
      4  select test_id,
      5         test_name
      6  from   test_tbl;
    Materialized view created.
    SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
    0 rows updated.
    SQL> commit;
    commit
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-01006: bind variable does not exist
    SQL>Committing an update that updates no rows against a master table for a single table fast refreshable materialized view results in the error above when the materialized view log on the master table is created with the COMMIT SCN option. I'm guessing that this isn't how things are supposed to work. Or am I missing something here? Anyone else encountered this before?
    Cheers.
    Edited by: Stain on Jan 25, 2013 1:27 PM

    Query Rewrite is an option for a Materialized View, not a Materialized View Log. Also, query rewrite is used as an optimization technique which "transforms a SQL statement expressed in terms of tables or views into a statement accessing one or more materialized views that are defined on the detail tables". I don't think it plays any role in the refresh path.
    Regardless, it made no difference.
    SQL> create materialized view mv_test_tbl
      2  refresh fast on commit
      3  ENABLE QUERY REWRITE
      4  as
      5  select test_id,
      6         test_name
      7  from   test_tbl
      8  ;
    Materialized view created.
    SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
    0 rows updated.
    SQL> commit;
    commit
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-01006: bind variable does not exist
    SQL>Edited by: Stain on Jan 25, 2013 2:06 PM

  • JOB to refresh the materialized views

    Hi,
    I have created the following job to call a procedure which refreshes all the materialized views but it that job has been running from ages although in the past it seems to work.
    Can u advise me what im missing
    REM : procedure to refresh all the job
    PROCEDURE PROC_REFRESH_MVS AS
    BEGIN
    This procedure will refresh all of the MVs
    DBMS_MVIEW.REFRESH('MV_A','c');
    DBMS_MVIEW.REFRESH('MV_B','c');
    DBMS_MVIEW.REFRESH('MV_Z','c');
    END PROC_REFRESH_MVS;
    REM Job to call the procedure
    BEGIN
    sys.dbms_scheduler.create_job(
    job_name => '"SCHEMAOWNER"."REFRESH_MVS"',
    job_type => 'STORED_PROCEDURE',
    job_action => 'SCHEMAOWNER.PROC_REFRESH_MVS',
    start_date => systimestamp at time zone 'Europe/Lisbon',
    job_class => 'DEFAULT_JOB_CLASS',
    comments => 'Refresh all the materialized views ',
    auto_drop => FALSE,
    enabled => FALSE);
    sys.dbms_scheduler.set_attribute( name => '"SCHEMAOWNER"."REFRESH_MVS"', attribute => 'logging_level', value => DBMS_SCHEDULER.LOGGING_FULL);
    sys.dbms_scheduler.enable( '"SCHEMAOWNER"."REFRESH_MVS"' );
    END;

    Hi
    To understand what's going on you should analyze the trace file that is generated when such an error occurs. Metalink note 131885.1 may be helpful.
    HTH
    Chris

  • ORA-12008: error in materialized view refresh path with ORA-01652

    I have a temp tablespace with 2 tempfiles of 2GB each (total 4GB) but still refresh of materialized view is failing with following error:
    5646690 - BIS Materialized View Refresh Program
    ORA-12008: error in materialized view refresh path
    ORA-01652: unable to extend temp segment by 128 in tablespace TEMP1
    I checked and temp ts is completly filled
    SQL> select TABLESPACE_NAME, BYTES_USED, BYTES_FREE from V$TEMP_SPACE_HEADER;
    TABLESPACE_NAME BYTES_USED BYTES_FREE
    TEMP1 2147483648 0
    TEMP1 2147483648 0
    My question is how do I find out how much space I need for temp tablespace. what 's the best practise to size temp tablespace when running refresh. refresh is done by client who is submitting a request thru ebiz apps so I 'd like to size it correctly without having to keep guessing.
    Thanks so much in advance for any help

    Hello,
    Temp tablespace size depends how much sort by , order by operation your application performing. You can create new temp tablespace and drop old one with bigger file size
    CREATE  TEMPORARY TABLESPACE TEMP02 TEMPFILE '\mypath_to_temp\TEMP02' SIZE 256M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE 8192M EXTENT MANAGEMENT LOCAL;
    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP02;
    Drop tablespace temp including contents; -- Make sure you delete on temp data files.Here is link for your reading purpose
    http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_3.shtml
    Regards
    Edited by: OrionNet on Mar 6, 2009 6:15 PM

  • Materialized View, ORA-12008: error in materialized view refresh path

    I want to refresh a materialized view, but I get an ORA-12008 error.
    Does anybody have an idea? I do not find any errors in my refresh statement.
    CREATE MATERIALIZED VIEW scott.dummy_mv
      TABLESPACE test
      BUILD IMMEDIATE
      USING INDEX TABLESPACE idx_test
      REFRESH
         START WITH sysdate
         NEXT ROUND(SYSDATE)+5/24          
         WITH PRIMARY KEY
      ENABLE QUERY REWRITE
      AS
      SELECT KM.ID ID
              ,KM.USERNAME USERNAME
           ,KM.ABTID ABTID     
      FROM my_table KM
    scott@orcl>desc dummy_mv
    Name                                      Null?    Typ
    ID                                        NOT NULL NUMBER(4)
    USERNAME                                  NOT NULL VARCHAR2(30)
    ABTID                                     NOT NULL NUMBER(4)
    scott@orcl>
    BEGIN
      SYS.DBMS_JOB.REMOVE(6579);
    COMMIT;
    END;
    DECLARE
      X NUMBER;
    BEGIN
      SYS.DBMS_JOB.SUBMIT
      ( job       => X
       ,what      => 'dbms_refresh.refresh(''"scott"."dummy_mv"'');'
       ,next_date => to_date('07.01.2009 05:00:00','dd/mm/yyyy hh24:mi:ss')
       ,interval  => 'ROUND(SYSDATE)+5/24              '
       ,no_parse  => FALSE
      SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    COMMIT;
    END;
    scott@orcl>exec dbms_refresh.refresh('dummy_mv');
    BEGIN dbms_refresh.refresh('dummy_mv'); END;
    FEHLER in Zeile 1:
    ORA-12008: error in materialized view refresh path
    ORA-00947: not enough values
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 820
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 877
    ORA-06512: in "SYS.DBMS_IREFRESH", Zeile 683
    ORA-06512: in "SYS.DBMS_REFRESH", Zeile 195
    ORA-06512: in Zeile 1
    scott@orcl>

    crupper wrote:
    I get the same error:
    scott@orcl>exec dbms_mview.refresh('dummy_mv','c');
    BEGIN dbms_mview.refresh('dummy_mv','c'); END;
    FEHLER in Zeile 1:
    ORA-12008: error in materialized view refresh path
    ORA-00947: not enough values
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 820
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 877
    ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 858
    ORA-06512: in Zeile 1
    I would first check the "query" information of the DBA_SNAPSHOTS/DBA_MVIEWS dictionary views if it reveals anything obvious.
    But it looks more like an internal error while processing the refresh. You can get more information about the error by tracing the session. A "alter session set sql_trace = true;" before running the refresh should be sufficient. Disconnect afterwards and check the generated trace file for errors either using "tkprof" and checking the output or by manually searching for "err=" in the trace file.
    Which 4-digit version of Oracle are you using?
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • ORA-12008: error in materialized view refresh path

    Hi everyone,
    I'm getting a weird error when I try to do a fast refresh on my materialized view. My basic approach is simple, I got a MV log on my fact table with all the columns needed by the materialized view, sequence, rowid INCLUDING NEW VALUES.
    I've got my materialized view setup with a my summary level data, COUNT(*), and COUNT(EXP) for every SUM(EXP). I check the MV_CAPABILITIES_TABLE, and sure enough, it can be ran with fast refresh. I've got my fact table in schema USER1 and my materialized view in schema USER2.
    When I create the materialized view, there's no problem. If I immediately execute a fast refresh (EXEC DBMS_MVIEW.REFRESH('MY_MV','F'); ), again, no problem.
    However, if I run the ETLs which update the source fact table, and then I run the fast refresh again, I get the ORA-120008.
    But if I make the exact same MV in the USER1 schema, I have no problem doing fast refreshes. What's up with that? Does the table owner have to be the one with the materialized view? USER1 and USER2 are on the same DB and have the same table space. Does USER2 need any additional grants besides select on the source fact table? Do I need to grant select on the MVIEW log somehow?
    Thanks for the help!
    -Joe

    I just granted select on the base table. I assumed that since the MV log is attached to the table, that select on the table also gave select to the MV Log. But I've been wrong before.
    Is there some special syntax to grant on the MV Log?
    -Joe

  • ORA-12008: error in materialized view refresh path in 10g

    Hi, all.
    The database is on 10gr2.
    I am testing materized view refresh.
    However, I got the following errors.
    exec dbms_refresh.refresh('"STGFAB"."MV_OPTION_TEST_HO1"');
    ORA-12008: error in materialized view refresh path
    ORA-01008: not all variables bound
    ORA-02063: preceding line from L8ZFAB
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
    ORA-06512: at "SYS.DBMS_IREFRESH", line 683
    ORA-06512: at "SYS.DBMS_REFRESH", line 195
    ORA-06512: at line 1
    Thanks in advance.
    Best Regards.

    Subject:      Materialized View Refresh Fails on Second Attempt With ORA-01008 'Not All Variables Bound' Error
         Doc ID:      Note:472261.1      Type:      
    --MM                                                                                                                                                                                                                                                                                                           

  • ORA-12008: error in materialized view refresh path ;;; PLZ HELP ME

    Hi all,
    I 'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0; I got these errors when I tried to refresh my materialized view ;
    ORA-12008: error in materialized view refresh path
    ORA-01555: snapshot too old: rollback segment number 5 with name "_SYSSMU5$"
    too small
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
    I don't understand what mean these errors and why i got them?
    Someone can help me please ?
    Thanks
    regards,

    thank you Justin,
    I found in my alertDB.log this line ;
    Mon Aug 20 03:00:54 2007
    ORA-01555 caused by SQL statement below (SQL ID: 64a7sdbbvknta, Query Duration=1021 sec, SCN: 0x0004.4a145344):
    Mon Aug 20 03:00:54 2007
    INSERT /*+ BYPASS_RECURSIVE_CHECK */ INTO "MANAGEMENT"."MVIEW_COMPUTERS"("ID","WINVERSION","ANTIVIRUS","GUID","INSTALLDT","CONNECTION_TYPE","GROUPID
    ","QUOVACOUNTRY") SELECT "C"."ID","C"."WINVERSION","C"."ANTIVIRUS","C"."GUID","C"."INSTALLDT","C"."CONNECTIONTYPE","C"."GROUPID","C"."QUOVACOUNTRY"
    FROM "MANAGEMENT"."COMPUTERS" "C"
    So i execute this query to found the TUNED_UNDORETENTION value ;
    SELECT *
    FROM V$UNDOSTAT v
    WHERE v.MAXQUERYID = '64a7sdbbvknta'
    and i have this result :
    BEGIN_TIME     20070820 02:53:42
    END_TIME     20070820 03:03:42
    UNDOTSN     1
    UNDOBLKS     51242
    TXNCOUNT     5012
    MAXQUERYLEN     1060
    MAXQUERYID     64a7sdbbvknta
    MAXCONCURRENCY     21
    UNXPSTEALCNT     0
    UNXPBLKRELCNT     0
    UNXPBLKREUCNT     0
    EXPSTEALCNT     14
    EXPBLKRELCNT     51392
    EXPBLKREUCNT     0
    SSOLDERRCNT     1
    NOSPACEERRCNT     0
    ACTIVEBLKS     606920
    UNEXPIREDBLKS     19896
    EXPIREDBLKS     612728
    TUNED_UNDORETENTION     1841
    I don't know exactly which value i should set my parameter?
    Message was edited by:
    HAGGAR

  • Error in materialized view refresh path

    I have a procedure that manuall refreshes a materialized view. It almost always gets the following errors:
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-08103: object no longer exists
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
    ORA-06512: at "MGT2.ITV_026_SP", line 35
    ORA-06512: at line 1
    When I run the same refresh of the materialized view directly from SQL*Plus, it never gets the error. It takes only about 5 minutes. OEM says the undo tablespace can support retention of 753 minutes if I'm understanding the graph.
    Thanks for your help..

    I will take a wild guess:
    MGT2.VW_PRINT_026
    Is a materialized view too.
    This error means that while doing a refresh to VW_MAT_026 it
    source mv, the VW_PRINT_026 wasn't exists, i.e. has been in the refresh process.
    You didn't get it in Sql*Plus because you are doing it step by step.
    The solution - make sure that VW_PRINT_026 completed it refresh before doing
    The VW_MAT_026 refresh, e.g.
    not tested-
    begin
    dbms_snapshot.refresh('VW_PRINT_026');
    dbms_snapshot.refresh('VW_MAT_026');
    end;Another option - the VW_PRINT_026 is a table created "on the fly"
    And in some scenario - the table isn't exists yet...
    If this is the case you should check if the object exist before doing the
    VW_MAT_026 refresh, e.g.
    not tested-
    declare
    ll_exists number;
    begin
    select 1 into ll_exists from all_objects where owner ='MGT2' and
    object_name ='VW_PRINT_026';
    dbms_snapshot.refresh('VW_MAT_026');
    when others then raise;
    end;Amiel

  • Materialed View Refresh Error ORA-12008: error in materialized view refresh

    Hi,
    I am trying to refersh the following materialized view with the below command and getting the below error
    begin
    DBMS_MVIEW.REFRESH('GLVW_MIS_ADB');
    end;
    The following error has occurred:
    ORA-12008: error in materialized view refresh path
    ORA-12840: cannot access a remote table after parallel/insert direct load txn
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 803
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 860
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 841
    ORA-06512: at line 2
    Please advice on this.
    Thanks & Regards,
    Kartik

    $ oerr ora 12840
    12840, 00000, "cannot access a remote table after parallel/insert direct load txn"
    // *Cause: Within a transaction, an attempt was made to perform distributed
    // access after a PDML or insert direct  statement had been issued.
    // *Action: Commit/rollback the PDML transaction first, and then perform
    // the distributed access, or perform the distributed access before the
    // first PDML statement in the transaction.
    $                                                                   

  • Materialized view refresh error

    Hi,
    I get the error in the package I run.
    04/29/2011 BM_CARLSON 64x Failed: ORA-12008: error in materialized view refresh path
    ORA-04052: error
    Should I drop the mview and recreate it.
    Since the package refreshes a lot of mview's how will I know that a particular mview is causing problem.
    Thanks,
    Indu

    Hi,
    What is the Oracle database version? ORA - 04052 means error occurred when looking up remote object. SO check the db links and the objects on the remote database.
    >
    Error: ORA 4052
    Text: error occurred when looking up remote object %s%s%s%s%s
    Cause: An error has occurred when trying to look up a remote object.
    Action: Fix the error. Make sure the remote database system has run KGLR.SQL to create necessary
    views used for querying/looking up objects stored in the database.
    >
    Anand

  • Error: ORA-12008: error in materialized view refresh path

    Hello Dba' s
    We are on 12.0.6 EBS with 10.2.0.5 DB on Sun solaris SPARC 64 bit.
    We are getting below error while Refreshing Materialized View.
    Start of log messages from FND_FILE
    Error: ORA-12008: error in materialized view refresh path
    ORA-00600: internal error code, arguments: [kcblasm_1], [103], [], [], [], [], [], [] Occured while Refreshing Materialized View
    End of log messages from FND_FILE
    Not sure how to proceed.We have just upgraded our database from 10.2.0.3 to 10.2.0.5.
    Also we still have our test instance with 10.2.0.3 database ,there refreshing MV completed successfully.
    Also refreshing through TOAD gives below error:-
    BEGIN
    DBMS_SNAPSHOT.REFRESH(
    LIST => 'XXPPL.XXPPL_OPM_TRANSACTIONS_MV'
    ,PUSH_DEFERRED_RPC => TRUE
    ,REFRESH_AFTER_ERRORS => FALSE
    ,PURGE_OPTION => 1
    ,PARALLELISM => 0
    ,ATOMIC_REFRESH => TRUE
    ,NESTED => FALSE);
    END;
    Error at line 2
    ORA-12008: error in materialized view refresh path
    ORA-00600: internal error code, arguments: [kcblasm_1], [103], [], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
    ORA-06512: at line 2
    Please advice.
    Thanks,
    Edited by: user12209274 on Nov 23, 2010 2:10 AM

    thank you Justin,
    I found in my alertDB.log this line ;
    Mon Aug 20 03:00:54 2007
    ORA-01555 caused by SQL statement below (SQL ID: 64a7sdbbvknta, Query Duration=1021 sec, SCN: 0x0004.4a145344):
    Mon Aug 20 03:00:54 2007
    INSERT /*+ BYPASS_RECURSIVE_CHECK */ INTO "MANAGEMENT"."MVIEW_COMPUTERS"("ID","WINVERSION","ANTIVIRUS","GUID","INSTALLDT","CONNECTION_TYPE","GROUPID
    ","QUOVACOUNTRY") SELECT "C"."ID","C"."WINVERSION","C"."ANTIVIRUS","C"."GUID","C"."INSTALLDT","C"."CONNECTIONTYPE","C"."GROUPID","C"."QUOVACOUNTRY"
    FROM "MANAGEMENT"."COMPUTERS" "C"
    So i execute this query to found the TUNED_UNDORETENTION value ;
    SELECT *
    FROM V$UNDOSTAT v
    WHERE v.MAXQUERYID = '64a7sdbbvknta'
    and i have this result :
    BEGIN_TIME     20070820 02:53:42
    END_TIME     20070820 03:03:42
    UNDOTSN     1
    UNDOBLKS     51242
    TXNCOUNT     5012
    MAXQUERYLEN     1060
    MAXQUERYID     64a7sdbbvknta
    MAXCONCURRENCY     21
    UNXPSTEALCNT     0
    UNXPBLKRELCNT     0
    UNXPBLKREUCNT     0
    EXPSTEALCNT     14
    EXPBLKRELCNT     51392
    EXPBLKREUCNT     0
    SSOLDERRCNT     1
    NOSPACEERRCNT     0
    ACTIVEBLKS     606920
    UNEXPIREDBLKS     19896
    EXPIREDBLKS     612728
    TUNED_UNDORETENTION     1841
    I don't know exactly which value i should set my parameter?
    Message was edited by:
    HAGGAR

  • How can I fast refresh the  materialized view !!

    I created a MV base on some tables in order to improve the querey speed.
    but the mv I have created falied to refresh fast.
    because there are two same table in the from clause:
    jcdm jc1,jcdm jc2
    create materialized view temp_mv
    nologging
    pctfree 0
    storage (initial 2048k next 2048k pctincrease 0)
    parallel
    build immediate
    refresh force
    on demand
    as
    select
    TAB_GSHX.rowid hx_rid,
    TAB_GSHD.rowid hd_rid ,
    JC1.rowid jc1_rid ,
    JC2.rowid jc2_rid ,
    YSHD_ID     HXID,          
    JC1.JCDM     QFD,     
    JC2.JCDM     JLD     
    FROM
    TAB_GSHX,
    TAB_GSHD,
    jCDM JC1,
    JCDM JC2
    WHERE
    YSHD_ID=YSHX_ID
    AND YSHD_QFD=JC1.JBJC_ID
    AND YSHD_JLD=JC2.JBJC_ID
    AND TO_CHAR(YSHX_time,'YYYYMMDD')='20030101'
    the column msgtxt of the table MV_CAPABILITIES_TABLE is :
    "the multiple instances of the same table or view" and " one or more joins present in mv".
    How can I succeed in fast refresh the above temp_mv!!!
    thanks.

    lianjun,
    When you are using Oracle9i there is a procedure which can help you setup the materialized view. If some option isn't working it gives you hint why it doesn't work.
    The procedure is dbms_mview.explain_mview.
    Take a look at the documentation how to use it. (In the Oracle9i DWH guide the package is explained.)
    Hope this helps
    With kind regards,
    Bas Roelands

  • Need help on tuning materialized view refresh

    Hi All,
    I am working on materialized view refresh tuning.Initially it was complete refresh and used to take more than 90 mins to complete.
    I changed it to fast refresh now it is completing fast. Now i have partitioned the base tables gl_balances and gl_code_combinations of column code_combination_id and created a local index on column code_combination_id then i am trying to partition the materialized on the same column to take advantage of partition change tracking.
    Size of gl_balances base tables is 40Gb and all others tables sizes are small. In where clause there all the 4 tables are mapped. If i will create the partition only on code_combination_id will i the materialized will become the candidate for partition change tracking. As i know it will be applicable for PCT. I need expert advice on this.
    While doing a fast refresh. the refresh takes less time. when there is a change in gl_balances , gl_code_combinations or gl_periods it completes in 20-30 mins. When there is a change in gl_set_of_books tables. It creates a problem here.DEL query takes more than 48 hours to complete.
    CREATE MATERIALIZED VIEW apps.BAL_PART
    REFRESH FAST ON DEMAND
    ENABLE QUERY REWRITE as
    SELECT GL.GL_CODE_COMBINATIONS21.ROWID C1,GL.GL_BALANCES21.ROWID C2, GL.GL_SETS_OF_BOOKS.ROWID C3,
    GL.GL_PERIOD.ROWID C4,
    "GL"."GL_BALANCES21"."ACTUAL_FLAG" ,
    "GL"."GL_BALANCES21"."CURRENCY_CODE" ,
    "GL"."GL_BALANCES21"."PERIOD_NUM" ,
    "GL"."GL_BALANCES21"."PERIOD_YEAR" ,
    "GL"."GL_BALANCES21"."SET_OF_BOOKS_ID" "SOB_ID",
    "GL"."GL_CODE_COMBINATIONS21"."CODE_COMBINATION_ID" "CCID",
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT1" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT10" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT11" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT12" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT13" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT14" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT2" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT3" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT4" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT5" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT6" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT7" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT8" ,
    "GL"."GL_CODE_COMBINATIONS21"."SEGMENT9" ,
    "GL"."GL_PERIODS"."PERIOD_NAME" ,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_CR", 0) Open_Bal_Cr,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_CR", 0) +
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_CR", 0) Close_Bal_Cr,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_DR", 0) Open_Bal_Dr,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_DR", 0) +
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_DR", 0) Close_Bal_Dr,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_DR", 0) -
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_CR", 0) Open_Bal,
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_DR", 0) -
    NVL("GL"."GL_BALANCES21"."BEGIN_BALANCE_CR", 0) +
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_DR", 0) -
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_CR", 0) Close_Bal,
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_CR", 0) Period_Cr,
    NVL("GL"."GL_BALANCES21"."PERIOD_NET_DR", 0) Period_Dr
    FROM GL.GL_CODE_COMBINATIONS21,
    GL.GL_BALANCES21,
    GL.GL_SETS_OF_BOOKS,
    GL.GL_PERIODS
    WHERE GL.GL_BALANCES21.CODE_COMBINATION_ID =GL.GL_CODE_COMBINATIONS21.CODE_COMBINATION_ID
    AND GL.GL_SETS_OF_BOOKS.SET_OF_BOOKS_ID = GL.GL_BALANCES21.SET_OF_BOOKS_ID
    AND GL.GL_PERIODS.PERIOD_NUM = GL.GL_BALANCES21.PERIOD_NUM
    AND GL.GL_PERIODS.PERIOD_YEAR = GL.GL_BALANCES21.PERIOD_YEAR
    AND GL.GL_PERIODS.PERIOD_TYPE = GL.GL_BALANCES21.PERIOD_TYPE
    AND GL.GL_PERIODS.PERIOD_NAME = GL.GL_BALANCES21.PERIOD_NAME
    AND GL.GL_PERIODS.PERIOD_SET_NAME = GL.GL_SETS_OF_BOOKS.PERIOD_SET_NAME
    and gl.GL_CODE_COMBINATIONS21.summary_flag != 'Y'TRACE 1046 del statement
    DELETE FROM "APPS"."apps.BAL_PART" SNA$
    WHERE "C3" IN (SELECT /*+ NO_MERGE  */ * FROM (SELECT 
      CHARTOROWID("MAS$"."M_ROW$$") RID$     FROM "GL"."MLOG$_GL_SETS_OF_BOOKS"
      "MAS$"   WHERE "MAS$".SNAPTIME$$ > :B_ST1 ) AS OF SNAPSHOT(:B_SCN) MAS$)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1  17759.00  171782.99  159422121    1267371 2564144739           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2  17759.00  171782.99  159422121    1267371 2564144739           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 175  (APPS)   (recursive depth: 1)
    Rows     Row Source Operation
          0  DELETE  apps.BAL_PART (cr=0 pr=0 pw=0 time=0 us)
    193128740   NESTED LOOPS  (cr=592437 pr=592422 pw=0 time=945244160 us cost=339302 size=168 card=1)
          3    SORT UNIQUE (cr=7 pr=0 pw=0 time=15832 us cost=2 size=138 card=1)
         24     TABLE ACCESS FULL MLOG$_GL_SETS_OF_BOOKS (cr=7 pr=0 pw=0 time=19 us cost=2 size=138 card=1)
    193128740    INDEX RANGE SCAN C3BOOKS (cr=592430 pr=592422 pw=0 time=789499200 us cost=339299 size=3318314250 card=110610475)(object id 2114736)
    error during execute of EXPLAIN PLAN statement
    ORA-08187: snapshot expression not allowed here
    parse error offset: 314
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                   159520897        2.12     144415.96
      latch: cache buffers chains                   134        0.06          0.68
      latch: undo global data                        33        0.02          0.15
      latch: object queue header operation          521        0.02          0.53
      log file switch (private strand flush incomplete)
                                                    532        0.31         28.26
      resmgr:cpu quantum                            155        1.40         13.49
      resmgr:internal state change                   25        0.11          2.21
      latch free                                     10        0.00          0.00
      latch: cache buffers lru chain                  4        0.00          0.00
      rdbms ipc reply                               489        0.02          0.54
      reliable message                              587        0.00          0.56
      latch: row cache objects                        3        0.00          0.00
    ********************************************************************************GL_SETS_OF_BOOKS has only 6 rows. I know there is complete refresh as a option which will again take more than 90 mins.
    I want to do the fast refresh. Tables rows details below.
    SQL> select count(*) from gl.gl_code_combinations21;
    COUNT(*)
    3075255
    SQL> select count(*) from gl.GL_PERIODS;
    COUNT(*)
    1160
    SQL> select count(*) from gl.gl_balances21;
    COUNT(*)
    477613527
    SQL> select count(*) from gl.gl_sets_of_books;
    COUNT(*)
    6gl_sets_of_books has less rows. Whenever there is a change then it mapped to huge rows hence during materialized view has delete huge number of rows.
    select count(*) from apps.BAL_PART group by C3;
    C3 is the rowid which is present in create materialized statement.
    COUNT(*)
    292927011
    210215
    69330
    184406971
    Is there any way to improve the plan. As i created a partition on code_combination_id and local index on code_combination_id which will not help in set_of_books_id case. I dont PCT will help here or not. Is it possible to use PCT refresh by equipartitioning only one column in where clause.
    Please assist me in improving refresh of materialized view using fast refresh.
    Thanks and Regards,
    Edited by: user646034 on Feb 23, 2013 11:13 PM
    Edited by: user646034 on Feb 23, 2013 11:19 PM
    Edited by: user646034 on Feb 23, 2013 11:46 PM
    Edited by: user646034 on Feb 25, 2013 11:46 AM

    Hi
    The below explain without index and with index.
    /* MV_REFRESH (DEL) */ DELETE FROM "APPS"."BAL_PART                                                                                                                                                                                                                                                                                                                                                                                                                
    " SNA$ WHERE "C3" IN (SELECT /*+ NO_MERGE  */ * FROM (SELECT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    CHARTOROWID("MAS$"."M_ROW$$") RID$     FROM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    "GL"."MLOG$_GL_SETS_OF_BOOKS" "MAS$"   WHERE "MAS$".SNAPTIME$$ > :B_ST1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    ) AS OF SNAPSHOT(:B_SCN) MAS$)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
    Plan hash value: 2704021294                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Id  | Operation            | Name                          | E-Rows |E-Bytes| Cost (%CPU)| E-Time   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   0 | DELETE STATEMENT     |                               |        |       |   339K(100)|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   1 |  DELETE              | BAL_PART                          |        |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   2 |   NESTED LOOPS       |                               |      1 |   168 |   339K  (1)|999:59:59 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   3 |    SORT UNIQUE       |                               |      1 |   138 |     2   (0)| 00:02:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   4 |     TABLE ACCESS FULL| MLOG$_GL_SETS_OF_BOOKS        |      1 |   138 |     2   (0)| 00:02:31 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    |   5 |    INDEX RANGE SCAN  | C3BOOKS                       |    110M|  3164M|   339K  (0)|999:59:59 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    If i will not use the C3 index then the query will use the belolw plan, I guess this will also take same time or more time.
    |   0 | DELETE STATEMENT       |                               |        |       |  9743K(100)|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
    |   1 |  DELETE                | BAL_PART                          |       |            |          |                                                                                                                                                                                                                                                                                                                                                                                                     

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

Maybe you are looking for