Materialized View creation with REFRESH FAST

Hello ,
Please see below case,
TABLE A1(partitioned range+list)
COLUMN C1  -- Primary key
COLUMN C2  -- NUMBER
TABLE D1
COLUMN C1 -- PRIMARY KEY
created MV log as below
CREATE MATERIALIzED VIEW LOG ON A1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;
CREATE MATERIALIzED VIEW LOG ON D1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;
Trying to create MV like below:
CREATE MATERILIZED VIEW mv1test
                                REFRESH FAST ON COMMIT
AS
Select
FROM A1,
                        D1
                WHERE A1.C1 = D1.CI
AND A1.C2 IS NOT NULL;
It gives below error message:
ORA-12052: cannot fast refresh materialized view schema.mv1test
12052. 00000 -  "cannot fast refresh materialized view %s.%s"
*Cause:    Either ROWIDs of certain tables were missing in the definition or
           the inner table of an outer join did not have UNIQUE constraints on
           join columns.
*Action:   Specify the FORCE or COMPLETE option. If this error is got
           during creation, the materialized view definition may have be
           changed. Refer to the documentation on materialized views.
However ,as discussed in earlier thread i checked all general restrictions of the 'Refresh fast' approach for join.
Restrictions on Fast Refresh on Materialized Views with Joins Only
Defining queries for materialized views with joins only and no aggregates have the following restrictions on fast refresh:
1) They cannot have GROUPBY clauses or aggregates.
2) Rowids of all the tables in the FROM list must appear in the SELECT list of the query.
3)Materialized view logs must exist with rowids for all the base tables in the FROM list of the query.
4)You cannot create a fast refreshable materialized view from multiple tables with simple joins that include an object type column in the SELECTstatement.
As per above restrictions ,
1) Group by clause is not present
2)i do not understand 2nd point , i have added a1.rowid  and d1.rowid in  select statement of MV, but got same error.
3) observed same as 2nd point.
4)we have CLOB column in select list. Tried removing this column but got same error.
Please do let me know any workaround on this.
Thanks in advanced ..
PM

Basic Materialized Views show how to analyse MVs using dbms_mview. I'm not sure about creating MVs on partitioned tables, that partition maintenance might cause problems

Similar Messages

  • Create materialized View fails with "table or view does not exist"

    DB: 10.2.0.4
    OS: Win 2003
    Hi,
    Here in my tests, i have 2 databases (A(source) and B(backup)), and i am trying to create an mview in database B to replicate data from one test table from database A, only for test purpose. I'm getting the error "table or view does not exist" when i try to create a mview with REFRESH FAST. Here is my code:
    CREATE MATERIALIZED VIEW TESTES.TAB_TESTES_REPLIC_MVIEW_02
    REFRESH FAST
    START WITH TO_DATE('21/02/2012 18:50:00', 'DD/MM/YYYY HH24:MI:SS')
    NEXT SYSDATE + 1/24/60
    WITH PRIMARY KEY
    AS SELECT REGISTRO1,
    REGISTRO2
    FROM TESTES.TAB_TESTES_REPLIC_MVIEW_02@DB_LINK_ORA10;
    The dblink is workig fine(dblink user has select privilege on TESTES.TAB_TESTES_REPLIC_MVIEW_02), and i have created the mview log on database A.
    Where is my mistake.
    Thanks a lot.
    Edited by: Fabricio_Jorge on 21/02/2012 19:06

    I found the solution.
    I had to grant SELECT on the mview log. The name is avaiable in DBA_MVIEW_LOGS

  • Materialized view issue with spatial index and UNION all.

    Hi guys,
    I'm trying to build the following materialized view:
    create materialized VIEW MV_ElectricalStuffs
      refresh fast
      AS
      SELECT jb.ROWID,
        jb.FID,
        JB.NAME_NUMBER
      FROM EL_BUS_BAR jb
      UNION ALL
      SELECT INC.ROWID,
        INC.FID,
        NULL,
        INC.NAME_NUMBER
      FROM EL_INTERNAL_CELL INC;
    I have this error showing up:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    This is because the table EL_INTERNAL_CELL has a SDO_GEOMETRY column that has a spatial index, whose ddl is
    CREATE INDEX EL_INTERNAL_CELL_S ON EL_INTERNAL_CELL (GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS('SDO_INDX_DIMS=2 TABLESPACE=USERS LAYER_GTYPE=COLLECTION');
    When I remove the spatial index from EL_INTERNAL_CELL column GEOM, Oracle is very happy and creates the view.
    Is there a mean however to keep the spatial index in the materialized view?

    I've managed to drop the spatial index prior to create the materialized view and it is ok. After the materialized view creation, I've recreated the spatial index on the table and all ran smooth. Hope nothing will go bad in the future because of this trick on spatial index..

  • Query against materialized view awful after refresh of Mview

    We have a materialized view defined to refresh complete daily at 5am. YOu can run queries against the MV alone or joining it to other tables. Results come back in 2 or 3 seconds. Once the MView refreshes at 5am - those same queries now take 15 minutes or even more sometimes to complete. WHY IS THIS HAPPENING?? Help anyone?

    okay this is better... sorry...
    this is the GOOD EXPLAIN PLAN:
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                      
    | Id  | Operation                         |  Name             | Rows  | Bytes | Cost  |                                                                                                                                                                                                
    |   0 | SELECT STATEMENT                  |                   |     1 |   127 |  1665 |                                                                                                                                                                                                
    |   1 |  SORT AGGREGATE                   |                   |     1 |   127 |       |                                                                                                                                                                                                
    |   2 |   NESTED LOOPS                    |                   |     1 |   127 |  1665 |                                                                                                                                                                                                
    |   3 |    NESTED LOOPS                   |                   |     1 |   113 |  1664 |                                                                                                                                                                                                
    |   4 |     NESTED LOOPS                  |                   |     1 |    99 |  1663 |                                                                                                                                                                                                
    |   5 |      NESTED LOOPS                 |                   |     1 |    88 |  1662 |                                                                                                                                                                                                
    |*  6 |       HASH JOIN ANTI              |                   |     1 |    70 |  1661 |                                                                                                                                                                                                
    |*  7 |        TABLE ACCESS BY INDEX ROWID| CONTACT           |  3815 |   201K|  1534 |                                                                                                                                                                                                
    |   8 |         AND-EQUAL                 |                   |       |       |       |                                                                                                                                                                                                
    |*  9 |          INDEX RANGE SCAN         | IDX_CNT__C_STATE  |       |       |       |                                                                                                                                                                                                
    |* 10 |          INDEX RANGE SCAN         | IDX_CNT__STATUS   |       |       |       |                                                                                                                                                                                                
    |  11 |        INDEX FAST FULL SCAN       | PK_RPP            | 69277 |  1082K|   120 |                                                                                                                                                                                                
    |* 12 |       TABLE ACCESS BY INDEX ROWID | REP_PROFILE       |     1 |    18 |     1 |                                                                                                                                                                                                
    |* 13 |        INDEX UNIQUE SCAN          | PK_C19            |     1 |       |       |                                                                                                                                                                                                
    |* 14 |      INDEX UNIQUE SCAN            | PK_B01            |     1 |    11 |       |                                                                                                                                                                                                
    |* 15 |     INDEX UNIQUE SCAN             | PK_B02            |     1 |    14 |       |                                                                                                                                                                                                
    |* 16 |    INDEX UNIQUE SCAN              | PK_RCN            |     1 |    14 |       |                                                                                                                                                                                                
    Predicate Information (identified by operation id):                                                                                                                                                                                                                                    
       6 - access("B"."CONTACT_ID"="RPP"."PARTNERSHIP_ID")                                                                                                                                                                                                                                 
       7 - filter("B"."C_STATE"='GA' AND "B"."C_LAST"<>'Name Unknown' AND                                                                                                                                                                                                                  
                  "B"."STATUS"='Confirmed')                                                                                                                                                                                                                                                
       9 - access("B"."C_STATE"='GA')                                                                                                                                                                                                                                                      
      10 - access("B"."STATUS"='Confirmed')                                                                                                                                                                                                                                                
      12 - filter("C19"."TERR1"='46')                                                                                                                                                                                                                                                      
      13 - access("B"."CONTACT_ID"="C19"."CONTACT_ID")                                                                                                                                                                                                                                     
      14 - access("B"."FIRM_ID"="B01"."FIRM_ID")                                                                                                                                                                                                                                           
      15 - access("B"."OFFICE_ID"="B02"."OFFICE_ID")                                                                                                                                                                                                                                       
      16 - access("B"."CONTACT_ID"="RCN"."CONTACT_ID")                                                                                                                                                                                                                                     
    Note: cpu costing is off                                                                                                                                                                                                                                                               
    38 rows selected.

  • Materialized view not properly refreshing

    Hi,
    As materialized view is not refreshing properly. we compare the sum of hashcode materialized view with the sum of hash code of the base view or table the materialized view is defined. If it's found equal then materialized view got refreshed succesfully else not.
    But in below example the column value is interchanged in between the row eventhough hashcode is same.
    Is there any other way to find the materialized view got refreshed successfully or not.
    SQL> create table temp as select object_name, subobject_name from user_objects where rownum<3;
    Table created
    SQL> select * from temp;
    OBJECT_NAME SUBOBJECT_NAME
    ATP_BN_I_1
    ATP_START_END_DATE_I_2
    SQL> create materialized view mv1 as select * from temp;
    Materialized view created
    SQL> select * from mv1;
    OBJECT_NAME SUBOBJECT_NAME
    ATP_BN_I_1
    ATP_START_END_DATE_I_2
    SQL> select sum(nvl(ora_hash("OBJECT_NAME"||"SUBOBJECT_NAME"),0)) from temp;
    SUM(NVL(ORA_HASH("OBJECT_NAME"
    4852176374
    SQL> select sum(nvl(ora_hash("OBJECT_NAME"||"SUBOBJECT_NAME"),0)) from MV1;
    SUM(NVL(ORA_HASH("OBJECT_NAME"
    4852176374
    SQL> UPDATE TEMP SET OBJECT_NAME=SUBOBJECT_NAME,SUBOBJECT_NAME=OBJECT_NAME;
    2 rows updated
    SQL> COMMIT;
    Commit complete
    SQL> select * from mv1;
    OBJECT_NAME SUBOBJECT_NAME
    ATP_BN_I_1
    ATP_START_END_DATE_I_2
    SQL> select * from temp;
    OBJECT_NAME SUBOBJECT_NAME
    ATP_BN_I_1
    ATP_START_END_DATE_I_2
    SQL> select sum(nvl(ora_hash("OBJECT_NAME"||"SUBOBJECT_NAME"),0)) from MV1;
    SUM(NVL(ORA_HASH("OBJECT_NAME"
    4852176374
    SQL> select sum(nvl(ora_hash("object_name"||"subobject_name"),0)) from temp;
    select sum(nvl(ora_hash("object_name"||"subobject_name"),0)) from temp
    ORA-00904: "subobject_name": invalid identifier
    SQL> select sum(nvl(ora_hash("OBJECT_NAME"||"SUBOBJECT_NAME"),0)) from temp;
    SUM(NVL(ORA_HASH("OBJECT_NAME"
    4852176374
    Any help really appreciated.
    Thanks in advance.

    unique wrote:
    Is there any other way to find the materialized view got refreshed successfully or not.You can look at the last_refresh_date and staleness columns of all_mviews: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1105.htm#REFRN20139
    Or maybe use the all_mview_refresh_times view: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1104.htm#sthref1068
    Regards,
    Rob.

  • Materialized View hangs with SELECT MAX

    Hi there,
    I'm using Oracle 10.2.0.4 on a 64bit AIX system and I am having issues with creating a materialized view.
    We have a large (1Tb) database and the large table the materialized view looks at is 200m rows.
    I've created 5 other materialized views each with a select max clause and all looking at the same table.
    When I created my problem MV I forget the select max and it created in 22mins.
    I corrected my error by putting in the select max clause (so as to retrieve the top record) and the create MV ran for 16hrs+, I killed it.
    If I just run the select statement at a sqlplus prompt it runs through in 22mins, if I create another object e.g. a table from the query it creates in 22mins.
    So the question would be, why can I not create a MV using SELECT MAX on 10.2.0.4?
    If I've missed any details don't hesitate to ask.
    Thanks in advance.

    Hi Justin,
    Thank you for your reply.
    It has been upgraded to 9.2.0.8.0 from 9.1.... I'm not aware about the procedure used.
    I could see a job scheduled for the materialized view , but that fails and it's broken after 16 attempts.
    How to log the error generated by the Refresh Job?
    Recreating the View - After the upgrade I have created the Materialized view again. Object T1 exists in the user schema User1.
    I'm not explicitly getting any error but the refresh doesn't happens , so I couldn't find any records in the materialized view.
    Thanks
    GM

  • 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).

  • Materialized view - parameter and refresh

    Hi,
    We are creating a Materialized view that has 2 rows for a CCID, one for this year and one for previous year with balances in 12 buckets.
    We have 2 questions:
    1. Can a materialized view be created with a parameter? or it can only take hard coded values?
    2. Can we refresh a part of materialized view, lets say we want to refresh the balances only for this year?
    Thanks

    user12182208 wrote:
    Hi,
    We are creating a Materialized view that has 2 rows for a CCID, one for this year and one for previous year with balances in 12 buckets.
    We have 2 questions:
    1. Can a materialized view be created with a parameter? or it can only take hard coded values? Typically, you want a materialized view to contain a complete set of aggregate data ... so, no, parameters don't really make sense (also, the results are pre-computed unlike a regular VIEW which is just a stored query. With a MV the data is actually computed on creation unless you defer it, and takes up physical storage).
    >
    2. Can we refresh a part of materialized view, lets say we want to refresh the balances only for this year?
    You can (depending on your Oracle Version and complexity of your materialized view) create a materialized view that does fast refreshes. If for some reason it was pertinent for you to achieve what you've asked, you could make 2 MV's and then a view that does a UNION ALL of them (the MV's would not contain overlaps), then you would just refresh the 1 MV, seems odd to me to want to do this though.
    Thanks

  • How to get a materialized view get to refresh itself after the job is "broken"

    we created a materialized view sometime ago with the following statement:
    create materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    as
    select  sxv_emp_cert_all.*
    from    sxv_employee_certification_all sxv_emp_cert_all;
    this week we found out it had not been refresh for about a month
    In dba_jobs the column broken was 'Y', next_date time something like 01-01-4000 and failures 16
    when I ran it manually by executing
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    I found that one of the columns was too small (probably a columns of one of the underlying tables had been extended since the creation of the materialized view)
    After fixing this I ussied yesterday (on 29-8-2013) the statement :
    alter materialized view SXV_PUB_EMPLOYEE_CERT_ALL_M
    refresh complete on demand
    start with to_date('30-08-2009 04:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate) + (28/24)
    after this the table dba_jobs showed me 30-08-2013 04:00:00 as next date
    I was expecting it to run this night at 04:00, but it didn't
    the last_date column value was still from about a month ago, the column broken still shows 'Y'
    and the next date 30-08-2013 04:00:00 (while it should been set to 31-08-2013 01:00:00
    Rrunning
    BEGIN DBMS_MVIEW.REFRESH('SXV_PUB_EMPLOYEE_CERT_ALL_M', 'C'); END;
    gave no errors this time
    and in User_Mview_Analysis the last_refresh_date column showed the date/time I had executed it
    Any idea how to get the job "unbroken" again so that the view refreshes itself every night?
    the database is Oracle Database 10g Release 10.2.0.4.0
    regards,
    Remco

    thanx for all your helpful and correct answers . but eventually I found it myself
    exec dbms_job.broken(<jobnumber>, false);

  • Materialized View creation  advice and SQL advice

    I want to create a materialized view for the table below. The materialized view should query data from only this table and i want to join 2 rows to one.
    The key for the joins are the column internal_correlation_id which is unique for request/response pair.
    The table is updated every day with 2 million rows.
    What type of materialized view should i use and how can i query to get one row?
    CREATE TABLE EVENT (
           caller_id                              VARCHAR2(255)          NOT NULL
         , service_id                         VARCHAR2(255)          NOT NULL
         , country_code                         VARCHAR2(2)
         , internal_correlation_id                  VARCHAR2(255)          NOT NULL  -- Unique for request response pair
         , received_date                         DATE                    NOT NULL
         , status                              VARCHAR2(20)
         , queue_name                         VARCHAR2(255)          NOT NULL
         , USER_ID                              VARCHAR2(50)
         , engine_id                         VARCHAR2(50)
         , tracking_correlation_id                  VARCHAR2(2000)
         , mnc                              VARCHAR2(20)
         , mcc                              VARCHAR2(20)
         , request_type                         VARCHAR2(50)  -- REQUEST or RESPONSE
         , app_id                              VARCHAR2(50)
         , failure_code                         VARCHAR2(50)
         , failure_string                            VARCHAR2(255)
         , created_date                          DATE DEFAULT SYSDATE
        , updated_date                              DATE DEFAULT SYSDATE
        DB release 11G release 1
    Edited by: Alekons01 on Mar 24, 2012 2:43 PM

    Anyway, I don't believe you will be able to create MV with fast refresh. MV with complete refresh:
    CREATE MATERIALIZED VIEW event_mv
      BUILD IMMEDIATE
      REFRESH COMPLETE ON DEMAND
      AS
        SELECT  e1.caller_id req_caller_id,
                e1.service_id req_service_id,
                e1.country_code req_country_code,
                e1.internal_correlation_id req_internal_correlation_id,
                e1.received_date req_received_date,
                e1.status req_status,
                e1.queue_name req_queue_name,
                e1.user_id req_user_id,
                e1.engine_id req_engine_id,
                e1.tracking_correlation_id req_tracking_correlation_id,
                e1.mnc req_mnc,
                e1.mcc req_mcc,
                e1.request_type req_request_type,
                e1.app_id req_app_id,
                e1.failure_code req_failure_code,
                e1.failure_string req_failure_string,
                e1.created_date req_created_date,
                e1.updated_date req_updated_date,
                e2.caller_id rsp_caller_id,
                e2.service_id rsp_service_id,
                e2.country_code rsp_country_code,
                e2.internal_correlation_id rsp_internal_correlation_id,
                e2.received_date rsp_received_date,
                e2.status rsp_status,
                e2.queue_name rsp_queue_name,
                e2.user_id rsp_user_id,
                e2.engine_id rsp_engine_id,
                e2.tracking_correlation_id rsp_tracking_correlation_id,
                e2.mnc rsp_mnc,
                e2.mcc rsp_mcc,
                e2.request_type rsp_request_type,
                e2.app_id rsp_app_id,
                e2.failure_code rsp_failure_code,
                e2.failure_string rsp_failure_string,
                e2.created_date rsp_created_date,
                e2.updated_date rsp_updated_date
          FROM  event e1,
                event e2
          WHERE e2.internal_correlation_id = e1.internal_correlation_id
            AND e1.request_type = 'REQUEST'
            AND e2.request_type = 'RESPONSE'
    /SY.

  • How does materialized view work when refresh the view vs create the view?

    I am using a materialized view, and I cant set it to fast refresh because some of the tables are from remote database which does not have materialized view log.
    When I create the materialized view, it took like 20 30 seconds. however when I was trying to refresh it. It took more than 2 3 hours. and total number of records are only around 460,000.
    I understand that when the view refreshes, it would take extra step like purge the table however I am not sure why it made so much difference in execution time perspective...
    Does the dbms_mview.refresh('MY_MATVIEW', 'C', atomic_refresh=>false) do the same exact insert as when I created the view?
    Could anyone please let me know how would this happen? Thanks,
    Code looks like as following
    create materialized view MY_MV1
    refresh force on demand
    start with to_date('20-02-2013 22:00:00', 'dd-mm-yyyy hh24:mi:ss') next trunc(sysdate)+1+22/24
    as
    ( SELECT Nvl(Cr.Sol_Chng_Num, ' ') AS Change_Request_Nbr,
           Nvl(Sr.Sr_Num, ' ') AS Service_Request_Nbr,
           Nvl(Sr.w_Org_Id, 0) AS Org_Id,
           Fcr.rowid,
           Cr.rowid,
           Bsr.rowid,
           Sr.rowid,
           SYSDATE
      FROM [email protected] Fcr
    INNER JOIN [email protected] Cr
        ON Fcr.w_Sol_Chng_Id = Cr.w_Sol_Chng_Id
    INNER JOIN [email protected] Bsr
        ON Fcr.w_Sol_Chng_Id = Bsr.w_Sol_Chng_Id
    INNER JOIN [email protected] Sr
        ON Sr.w_Srv_Rec_Id = Bsr.w_Srv_Rec_Id
    WHERE Sr.Sr_Num !='NS'
    );I have tried to use dbms_mview.refresh('MY_MATVIEW', 'C', atomic_refresh=>false) but it still took 141 mins to run... vs 159 mins without atomic_refresh=>false
    Edited by: 986006 on Feb 20, 2013 2:15 PM

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION)
    >
    I am using a materialized view, and I cant set it to fast refresh because some of the tables are from remote database which does not have materialized view log.
    When I create the materialized view, it took like 20 30 seconds. however when I was trying to refresh it. It took more than 2 3 hours. and total number of records are only around 460,000.
    I understand that when the view refreshes, it would take extra step like purge the table however I am not sure why it made so much difference in execution time perspective...
    Does the dbms_mview.refresh('MY_MATVIEW', 'C', atomic_refresh=>false) do the same exact insert as when I created the view?
    >
    What Oracle version are you using? The 'atomic_refresh' parameter default was changed to TRUE starting with 10g.
    See the PL/SQL Packages and Types doc
    >
    atomic_refresh
    If this parameter is set to true, then the list of materialized views is refreshed in a single transaction. All of the refreshed materialized views are updated to a single point in time. If the refresh fails for any of the materialized views, none of the materialized views are updated.
    If this parameter is set to false, then each of the materialized views is refreshed in a separate transaction.
    >
    What that means is that if the value is TRUE Oracle uses a DELETE to remove the existing rows. If the value is FALSE then Oracle uses TRUNCATE.
    If you really are using the FALSE setting you should not be seeing that much of a time difference between creating the MV and a complete refresh so something else must be going on.

  • Materialized View not getting refreshed

    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    I am having a situation here..there a materialized view named mv_empdept,the base table of this MV is located on a remote database.Therefore the MV creation scripti contains a DB link.
    Please find the script below.
    Select Deptno,dept_name,empno,ename,DOB,Job
    from [email protected];
    The refresh mode of this MV is set as FAST,and the refresh cycle is scheduled through Oracle Job.
    The job does get triggerd but from the log we found this error.
    The error message is:ORA-12008: error in materialized view refresh path
    ORA-01461: can bind a LONG value only for insert into a LONG column.
    I even checked at the source Db and found that there is no mismatch as far datatype and datalength is concerned.
    Strangely when i do a manual Complete refresh of the same MV the data does gets populated in mv_empdept snapshot.
    Can anybody explain me the why the data is not getting populated in FAST refresh mode.
    Your help is highly appreciated.
    ---Vineet

    Read the following...
    http://download.oracle.com/docs/cd/B10500_01/server.920/a96567/repmview.htm
    and analyze the restrictions of Fast Refresh in your situation.

  • Materialized view creation taking long time

    Hi All,
    We are creating a dimensional OLAP model with the Materialized views. In that we are having 7 dimensions and 1 fact table. I have created all the dimensions with the materialized views with out any problem. But when im trying to create my Fact materialized view it is running for 14 hours and is still running. I'm waiting to see when it will complete. The select statement in the Fact MV returns only 19 records and that too in seconds. But when i use the same select statement for MV creation it is taking a long time. I dont know how long it gonna take. How can i reduce this long running time. Mean while my fact MV is having nearly 15 joins with other physical tables and dimensions.
    Thanks in advance,
    Karthick

    Hi all,
    Thanks for your reply..
    I think i dint clearly mention my problem..
    The select statement for the MV will return 19 records. But when im trying to create the MV it is taking quite a long time. it ran for >14 hours but still it dint create a MV. Why is it happening like this? Is it possible to increase the performance.
    Thanks,
    Karthick

  • Update sequence wrong in Materialized view when using refresh group

    Hi,
    I made a trigger (for each row) on a materialized view(replication data from a master table in in a different database), which is refreshed by a refresh group (exec dbms_refresh.refresh('"...). However, the update order/sequence is important and must be handled (by the trigger) in the same order how the updates where done in the master table. Unfortunately the updates in the materialized view are NOT in the same order. The trigger is fired in a wrong order.
    I am using database version 10.2.0
    Does anybody reconize this problem, Is there a solution for this problem ( with keeping the refresh group mechanisme)?
    Thanks
    Regards
    Jurn

    rownum is determined as the row is output, so "order by rownum" does literally nothing.
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns009.htm

  • Materialized view log with multiple materialized views

    DB: 9.2.0.8
    Yes its old. I am not allowed to upgrade it.
    I have a set of materialized views that are created off of 5 base tables. They do fast refreshes. So I have multiple materialized views for the same base table and same materialized view log.
    1. how do materialized view logs manage multiple dependent materialized views?
    2. How do I tell by looking at the materialized view log which rows have not been fast refresh for a specific materialized view?

    As a starter for 10 try reading: Materialized View Refresh : Log Population and Purge (Doc ID 236233.1) on MOS.
    Thanks
    Paul

Maybe you are looking for

  • How to restart my #'s of computers with the account

    I have had so many problems with my computers, I only have 3 computers signed on my account and they all don't work and i want to deauthorize them but i can't cause they don't work is it possible i can just start over and have all 5 authoriations aga

  • Passing large number of values to a WebI prompt from external application

    Hello all, BIt of a strange request this! I need to abuse the OpenDocument function and pass A LOT of prompt values into a webi report.  The users can select hundreds/thousands of records in an external web based application and click to open a BO We

  • I am having issues with syncing my calender and contacts

    I would like for the changes that I make on my iphone to be primary. I have sync issues with the calender and contacts. New contacts get erased and some contacts are doubles as well as email addresses. My calender entries have been erased on sync. Ca

  • Gps in iphone 4 not working

    I have an iPhone 4 whose GPS is misbehaving.  I use the latest version of Navigon, and it always loses the GPS signal and puts me in the wrong place on the map.  I have also checked the GPS location in the standard Maps app, same result.  This began

  • 'mounting failed' when trying to download iTunes8

    I'm running OS X 10.4.11 on a PPC G5. I've tried to download iTunes8 (I currently have iTunes7.7, but need 8 for my new iPod), but at the end of the attempted download I get the message 'Mounting Failed'. I have spoken to 4 different operators in 2 d