Materialized View Definition

Can we use PIVOT in Materialized View Definition ?
Thanks
Dheeraj

782331 wrote:
Can we use PIVOT in Materialized View Definition ?
Thanks
DheerajWhy not try it out and see?
It should likely take you 1 minute to put together a simple test case.

Similar Messages

  • Takes along time to view a materialized view definition

    Hi,
    Using owb 11.2.0.3 and takes a long time to see any materialized view definition which is based on a particular table (talking a few minutes compared to over a minute compared to seconds
    to see other mview definitions.
    platform aix.
    8 million rows in base table.
    Thoughts as to why this would be case?
    Thanks

    user5716448 wrote:
    Hi,
    Using owb 11.2.0.3 and takes a long time to see any materialized view definition which is based on a particular table (talking a few minutes compared to over a minute compared to seconds
    to see other mview definitions.
    platform aix.
    8 million rows in base table.
    Thoughts as to why this would be case?
    Thanks
    post actual EXPLAIN PLAN

  • Materialized view definition from export

    Hi,
    Long time Oracle developer, first time poking with imp - I'm trying to find the definition on a materialized view from the dmp file, using windows.
    I've used:
    imp userid=dev/pwd file=C:\OraExports\DEV.dmp  show=Y fromuser=devmgr touser=devmgr 2> c:\scott_all.txt
    but can't locate the object I'm looking for - only the synonym of the same name.
    Are snapshots included in a typical export? Any other suggestions for locating the SQL defn?
    Cheers,
    Scott

    Hi,
    What is the DB Version you are using. If its 9i there is some restriction with Export/Import. remove the cluse fromuser/touser and then Try.
    Materialized View Concepts and Architecture
    Are snapshots included in a typical export? Any other suggestions for locating the SQL defn?
    You can user the dbms_metadata.get_ddl for the Sql definition, If your DB is in 10g and Above Version you can use the Datapump Export/Import.
    HTH

  • Materialized view definition in oracle 9i

    How do we find the definiton (or the script) of a materialized view ? I am using oracle 9i and toad. The script tab of toad throws up the 'create table' script and not the original sql which defined the materialized view.
    Please help.

    You can use DBMS_METADATA :
    SCOTT@orcl SQL> create materialized view mv_emp
      2  refresh fast on demand with rowid
      3* as select empno,ename,job,sal from emp
    SCOTT@orcl SQL> /
    Materialized view created.
    SCOTT@orcl SQL> set long 100000
    SCOTT@orcl SQL> select DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','MV_EMP','SCOTT') from dual
    SCOTT@orcl SQL> /
    DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','MV_EMP','SCOTT')
      CREATE MATERIALIZED VIEW "SCOTT"."MV_EMP"
      ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOG
    GING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      BUILD IMMEDIATE
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      REFRESH FAST ON DEMAND
      WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
      DISABLE QUERY REWRITE
      AS select empno,ename,job,sal from emp
    SCOTT@orcl SQL>                                                                               

  • Refresh of a materialized view

    Hi All!
    I have a materialized view defined like:
    CREATE MATERIALIZED VIEW v_ship_info_new
    PCTFREE 5 PCTUSED 60
    TABLESPACE DATA_BIG
    STORAGE
    INITIAL 32768K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    USING INDEX STORAGE (INITIAL 2M NEXT 500K)
    REFRESH START WITH ROUND(SYSDATE + 1) + 08/24
    NEXT ROUND(SYSDATE + 2) + 08/24
    AS
    SELECT .....
    The view was created on Sep.-13-2005. I expected that the view will be refreshed today at 08:00 AM, but the last_ddl_time in user_objects is Sep.-18-2005 and the data in the view is also from Sep.-18-2005. There is no time filter in SELECT statement. The view should shows a result of left outer join of two tables.
    Any idea?
    Thanks,
    Andrej

    Andrej,
    You should consider the NEXT interval relative to the last materialized view refresh. Reading your materialized view definition it results that:
    - the materialized view was refreshed for the first time on 14-sep at 8:00 am (START WITH ROUND(SYSDATE + 1) + 08/24)
    - the materialized view is then refreshed on 16-sep at 8:00 am, 18-sep at 8:00 am (ROUND(SYSDATE + 2) + 08/24)
    Considering you have specified the START WITH clause in your command, the NEXT date should be considered starting from the timestamp of the last refresh and not from the moment of the materialized view creation.
    Regards,
    Adi

  • Creation of Materialized view and Materialized view log.

    I wanted to create materialized view with 'REFRESH FAST ON COMMIT' option.
    1) Table1 --it is partitioned range + list -- Added primary key
    2) view1   -- having primary keys on view's base table
    Steps:
    1) create materialized view log on Table1 ; -- default primary key
    2) create materialized view log on view1.  --- It is giving below error.
    ORA-00942: table or view does not exist
    i wanted to create Materialized view like below
    create materialized view
    REFRESH fast ON commit
    as
    select ...
    ... from table1
    where c1 in (select c1 from view1 where ... );
    Question:
    1) As i am getting above error while creating MV log on view. Can we create MV log on view or we have to create MV log on view base table?
    2) To create MV with ''REFRESH FAST ON COMMIT' option , do we need to have primary key on master tables? 
    Any pointers on this will really helpful.
    Thanks
    Prasad

    Also created MV LOG on 3 tables and tried with joins ..
    create materialized view
    REFRESH fast ON commit
    as
    select ...
    ... from table1 , tab2 t2,tab3 t3
    where ....
    and ...
    Get same error ORA-12052: cannot fast refresh materialized view AVSYS.EVENT_LOG_MV
    2052. 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.

  • Materialized views on prebuilt tables - query rewrite

    Hi Everyone,
    I am currently counting on implementing the query rewrite functionality via materialized views to leverage existing aggregated tables.
    Goal*: to use aggregate-awareness for our queries
    How*: by creating views on existing aggregates loaded via ETL (+CREATE MATERIALIZED VIEW xxx on ON PREBUILT TABLE ENABLE QUERY REWRITE+)
    Advantage*: leverage oracle functionalities + render logical model simpler (no aggregates)
    Disadvantage*: existing ETL's need to be written as SQL in view creation statement --> aggregation rule exists twice (once on db, once in ETL)
    Issue*: Certain ETL's are quite complex via lookups, functions, ... --> might create overy complex SQLs in view creation statements
    My question: is there a way around the issue described? (I'm assuming the SQL in the view creation is necessary for oracle to know when an aggregate can be used)
    Best practices & shared experiences are welcome as well of course
    Kind regards,
    Peter

    streefpo wrote:
    I'm still in the process of testing, but the drops should not be necessary.
    Remember: The materialized view is nothing but a definition - the table itself continues to exist as before.
    So as long as the definition doesn't change (added column, changed calculation, ...), the materialized view doesn't need to be re-created. (as the data is not maintained by Oracle)Thanks for reminding me but if you find a documented approach I will be waiting because this was the basis of my argument from the beginning.
    SQL> select * from v$version ;
    BANNER                                                                                                                                                                    
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production                                                                                                    
    PL/SQL Release 11.2.0.1.0 - Production                                                                                                                                    
    CORE     11.2.0.1.0     Production                                                                                                                                                
    TNS for Linux: Version 11.2.0.1.0 - Production                                                                                                                            
    NLSRTL Version 11.2.0.1.0 - Production                                                                                                                                    
    SQL> desc employees
    Name                                                                                            Null?    Type
    EMPLOYEE_ID                                                                                     NOT NULL NUMBER(6)
    FIRST_NAME                                                                                               VARCHAR2(20)
    LAST_NAME                                                                                       NOT NULL VARCHAR2(25)
    EMAIL                                                                                           NOT NULL VARCHAR2(25)
    PHONE_NUMBER                                                                                             VARCHAR2(20)
    HIRE_DATE                                                                                       NOT NULL DATE
    JOB_ID                                                                                          NOT NULL VARCHAR2(10)
    SALARY                                                                                                   NUMBER(8,2)
    COMMISSION_PCT                                                                                           NUMBER(2,2)
    MANAGER_ID                                                                                               NUMBER(6)
    DEPARTMENT_ID                                                                                            NUMBER(4)
    SQL> select count(*) from employees ;
      COUNT(*)                                                                                                                                                                
           107                                                                                                                                                                
    SQL> create table mv_table nologging as select department_id, sum(salary) as totalsal from employees group by department_id ;
    Table created.
    SQL> desc mv_table
    Name                                                                                            Null?    Type
    DEPARTMENT_ID                                                                                            NUMBER(4)
    TOTALSAL                                                                                                 NUMBER
    SQL> select count(*) from mv_table ;
      COUNT(*)                                                                                                                                                                
            12                                                                                                                                                                
    SQL> create materialized view mv_table on prebuilt table with reduced precision enable query rewrite as select department_id, sum(salary) as totalsal from employees group by department_id ;
    Materialized view created.
    SQL> select count(*) from mv_table ;
      COUNT(*)                                                                                                                                                                
            12                                                                                                                                                                
    SQL> select object_name, object_type from user_objects where object_name = 'MV_TABLE' ;
    OBJECT_NAME                                                                                                                      OBJECT_TYPE                              
    MV_TABLE                                                                                                                         TABLE                                    
    MV_TABLE                                                                                                                         MATERIALIZED VIEW                        
    SQL> insert into mv_table values (999, 100) ;
    insert into mv_table values (999, 100)
    ERROR at line 1:
    ORA-01732: data manipulation operation not legal on this view
    SQL> update mv_table set totalsal = totalsal * 1.1 where department_id = 10 ;
    update mv_table set totalsal = totalsal * 1.1 where department_id = 10
    ERROR at line 1:
    ORA-01732: data manipulation operation not legal on this view
    SQL> delete from mv_table where totalsal <= 10000 ;
    delete from mv_table where totalsal <= 10000
    ERROR at line 1:
    ORA-01732: data manipulation operation not legal on this view While investigating for this thread I actually made my own question redundant as the answer became gradually clear:
    When using complex ETL's, I just need to make sure the complexity is located in the ETL loading the detailed table, not the aggregate
    I'll try to clarify through an example:
    - A detailed Table DET_SALES exists with Sales per Day, Store & Product
    - An aggregated table AGG_SALES_MM exists with Sales, SalesStore per Month, Store & Product
    - An ETL exists to load AGG_SALES_MM where Sales = SUM(Sales) & SalesStore = (SUM(Sales) Across Store)
    --> i.e. the SalesStore measure will be derived out of a lookup
    - A (Prebuilt) Materialized View will exist with the same column definitions as the ETL
    --> to allow query-rewrite to know when to access the table
    My concern was how to include the SalesStore in the materialized view definition (--> complex SQL!)
    --> I should actually include SalesStore in the DET_SALES table, thus:
    - including the 'Across Store' function in the detailed ETL
    - rendering my Aggregation ETL into a simple GROUP BY
    - rendering my materialized view definition into a simple GROUP BY as wellNot sure how close your example is to your actual problem. Also don't know if you are doing an incremental/complete data load and the data volume.
    But the "SalesStore = (SUM(Sales) Across Store)" can be derived from the aggregated MV using analytical function. One can just create a normal view on top of MV for querying. It is hard to believe that aggregating in detail table during ETL load is the best approach but what do I know?

  • 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

  • ORA-12052 when create materialized view

    I following the sample in Oracle document to create materialized viewCREATE MATERIALIZED VIEW LOG ON sales
       WITH ROWID, SEQUENCE(amount_sold, time_id, prod_id)   INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW LOG ON times
       WITH ROWID, SEQUENCE (time_id, calendar_year)  INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW LOG ON products
       WITH ROWID, SEQUENCE (prod_id,prod_name)  INCLUDING NEW VALUES;
    CREATE MATERIALIZED VIEW sales_mv
       BUILD IMMEDIATE   REFRESH FAST ON COMMIT
       AS SELECT t.calendar_year, p.prod_id, p.prod_name,
          SUM(s.amount_sold) AS sum_sales
          FROM times t, products p, sales s
          WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id
          GROUP BY t.calendar_year, p.prod_id, p.prod_name; This works. BUt I actually does not want do aggregation. Thus I changed the MV creation statement toCREATE MATERIALIZED VIEW sales_mv
       BUILD IMMEDIATE REFRESH FAST ON COMMIT
       AS SELECT t.calendar_year, p.prod_id, p.prod_name,s.amount_sold
          FROM times t, products p, sales s
          WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id;I got errorSQL Error: ORA-12052: cannot fast refresh materialized view GLU.SALES_MV
    *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.Please help or point me to the relevant document.
    Thanks

    damorgan, Thank you for you reply.
    the inner table of an outer join did not have UNIQUE constraints on join columns.
    I am not sure how much clearer and explanation can be written.If you look at the query, you will find that there is no outer join in the query.
    sales table does not have unique constraints on prod_id and time_id. If this is the cause of the problem, I cannot change the data but is there a work around. That is way I ask for specific doc. In 11g documents, I only find some info on CREATE MV. That is mainly on syntax but not on requirement.

  • Create Materialized View ORA-01723: zero-length columns are not allowed

    I am trying to create a materialized view which derives a column from a function and I get: ORA-01723: zero-length columns are not allowed.
    I am using 10gR2 with the following definition (simple version):
    CREATE MATERIALIZED VIEW AS
    SELECT
    function_name(column_name) COLUMN_ALIAS
    FROM table_name;
    I have even tried to cast it like below:
    CREATE MATERIALIZED VIEW AS
    SELECT
    CAST(function_name(column_name) AS VARCHAR2(200)) COLUMN_ALIAS
    FROM table_name;
    My function does have an exception to return a value even if no values are found.
    I have looked all over for the solution. Does anyone have a way around this issue? I really need my function to derive the column as it has business rules which I cannot join into my materialized view definition. My only hope around this is to insert the values into a table and then create a materialized view from that table, I don't want to do that if someone has a solution around this.
    Any help would be greatly appreciated.
    Thank you,
    Kyle
    Edited by: Kyle Miller on Apr 19, 2011 8:28 AM

    Have you tried creating a table with the correct structure and then creating the materialized view based on the prebuilt table as described here...
    http://www.oaktable.net/content/ultra-fast-mv-alteration-using-prebuilt-table-option
    Cheers
    Ben

  • Materialized View Fast Refresh been ignored For Complete refresh.

    Hi,
    I have a script that create a materialised view with a refresh method of 'FAST'.
    When I refresh the view on one machine it refreshes using the 'FAST' method (i.e. LAST_REFRESH_TYPE = FAST) in 22 seconds, however, when I run the same script on a different machine the database chooses a 'COMPLETE' refresh method, despite me stating explicitly for it to use the FAST method. The complete refresh completes in about four hours.
    Does anyone know the logic that Oracle uses in determining the type of refresh to use?
    Thanks.

    Assuming that the Materialized View definition is the same (and doesn't conflict with any FAST REFRESH requirements for that specific Oracle Version), check to see if the source table(s) has/have Materialized View Logs defined on them. MV Logs with PK/Rowid would be required.
    Hemant K Chitale

  • Materialized view issue ORA-12052

    Hi All,
    I'm currently trying to create a MV using Fast refresh method.
    and I'm getting the following error:
    ORA-12052:
    cannot fast refresh materialized view string.string
    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.
    I'm trying to create the Unique constraints required. Could anybody help me with this?. Which are the "inner tables of an outer join"?
    I have also created the MVs logs with rowid, but also nothing happend.
    I' ve created a Unique constraint that includes all the fields of the ourter joins. Nothing happend either.
    Thi is the MV script:
    'CREATE MATERIALIZED VIEW MVIEW1
    USING INDEX
    REFRESH ON DEMAND FAST
    WITH rowid
    DISABLE QUERY REWRITE AS
    SELECT fp.FINAL_AMOUNTFIXED,
    fp.FINAL_FPRATE,
    fp.updated_rate,
    fp.gsd_rate,
    fp.nongsd_rate,
    fp.AMT_CD,
    fp.AMT_CD_ADJ1,
    fp.AMT_CD_ADJ2,
    fp.AMT_LC,
    fp.AMT_LC_ADJ1,
    fp.AMT_LC_ADJ2,
    fp.ASSIGNMENT_STATUS,
    fp.CURRENCY,
    fp.DOLLARS,
    fp.FORECAST_REVENUE_STATUS,
    fp.GUID,
    NVL(fp.HOURS,0) HOURS,
    fp.ID,
    fp.JOB_LEVEL,
    fp.PJR_AMT_CD,
    fp.PJR_HOURS_VALUE,
    fp.PJR_LC,
    fp.PJR_RATE,
    fp.PJR_RATE_VALUE,
    fp.PROJECT_COST_CENTER,
    fp.PROJECT_COST_CENTERTXT,
    NVL(cust.project_manager,fp.project_manager) project_manager,
    NVL(cust.project_name,fp.project_name) project_name,
    fp.PROJECT_NUMBER,
    fp.PROJECT_ORGANIZATION,
    NVL(cust.project_status,fp.project_status) project_status,
    NVL(cust.project_type,fp.project_type) project_type,
    NVL(fp.RATE,0) Rate,
    fp.RATE_ADJ1,
    fp.RATE_ADJ2,
    fp.RATE_LEVEL,
    fp.REPORT_DATE_ID,
    fp.REPORT_DESCRIPTION,
    fp.RESOURCE_COST_CENTER,
    fp.RESOURCE_COST_CENTERTXT,
    fp.RESOURCE_COUNTRY,
    fp.RESOURCE_NAME,
    fp.RESOURCE_ORGANIZATION,
    fp.RESOURCE_TYPE,
    fp.REVENUECOST_TYPE,
    fp.ROLE_END_DATE,
    fp.ROLE_NAME,
    fp.ROLE_START_DATE,
    fp.TAB,
    fp.TASK_NUMBER,
    fp.TPRATE_TP,
    fp.WAR,
    fp.WE_DATE_ID,
    fp.WEEK,
    fp.WORK_TYPE,
    fp.PJR_FF_DIFF_MONTH,
    fp.PJR_FF_DIFF_QTR,
    NVL(fp.PJR_WOW,0) WOW,
    fp.PJR_WOW_HRS,
    fp.REMOVED_BY_ADJUSTMENT,
    fp.PICK_FOR_WRITEBACK,
    fp.DRAFT_REV_NUM,
    fp.DRAFT_INV_NUM,
    NVL(pca.country,fp.PROJECT_COUNTRY) Country,
    NVL(cust.customer_id,NVL(fp.CUSTOMER_NUMBER,'TBD')) Customer_ID,
    NVL(cust.CUSTOMER_NAME,NVL(fp.CUSTOMER_NAME,'TBD')) Customer_Name ,
    fp.ITEM_DATE,
    fp.REVENUE_CC,
    fp.EXPLANATION,
    fp.REPORT,
    fp.REPORT_ADJUSTMENT,
    fp.REPORT_ADJ1,
    fp.REPORT_ADJ2,
    fp.JE_DESCRIPTION,
    pca.REGION_HQ_TIERLAST_CODE,
    pca.MANAGER_FIELD_TIERLAST_CODE,
    pca.SPECIALTY_HQ_TIERLAST_CODE,
    pca.SECTOR_HQ_TIERLAST_CODE,
    rca.REGION_HQ_TIERLAST_CODE,
    rca.MANAGER_FIELD_TIERLAST_CODE,
    rca.SPECIALTY_HQ_TIERLAST_CODE,
    rca.SECTOR_HQ_TIERLAST_CODE,
    pca.VERTICALS_SUB_LOB,
    pca.MISC_GROUP ,
    rca.VERTICALS_SUB_LOB,
    rca.MISC_GROUP ,
    fp.gl_date,
    fp.pjr_wow_rate ,
    fp.created_by,
    fp.created_on,
    NVL(fp.TOTAL_FUNDING,0) TOTAL_FUNDING,
    NVL(fp.INCEPTION_TO_BURN,0) INCEPTION_TO_BURN,
    NVL(fp.AVAILABLE_FUNDING,0) AVAILABLE_FUNDING,
    NVL(fp.FORECAST_AMT,0) FORECAST_AMT,
    cust.pop_date,
    fp.COMMENTS_WOW_PROJ,
    fp.COMMENTS_PAPER_CONFIRM,
    rep.LOOKUP_CODE,
    rep.NAC_SORTING1,
    fp.ACTION_TO_CLOSE,
    NVL(fp.NEGATIVE_BACKLOG,0) NEGATIVE_BACKLOG,
    fp.SALES_REP,
    fp.FORECAST_DATE,
    pca.NAC_RES_TYPE_3,
    rca.NAC_RES_TYPE_3
    FROM FACT_PJR fp,
    COSTCENTER_ATTRIBUTES pca ,
    COSTCENTER_ATTRIBUTES rca,
    wb_customer_lookups cust,
    XXAPX_LOOKUPS rep
    WHERE fp.revenue_cc = pca.LEAF_CC(+)
    AND fp.RESOURCE_COST_CENTER = rca.LEAF_CC(+)
    AND fp.project_number = cust.project_number(+)
    AND fp.REPORT_ADJ2 = rep.VALUE(+)
    AND rep.LOOKUP_TYPE = 'NAC_WB_PHASE2';'
    Edited by: 859267 on May 3, 2012 11:51 AM

    Please edit your post and surround the code with code tags. See 'Are there any useful formatting options not shown on the sidebar?' in the FAQ.
    Also provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).

  • Materialized View - Invalid Objects

    We created materialized views to access Corporate HRMS data on our local instance using DB Links. All the materialized views become invalid very often. Not sure under which Circumstances. Our DBA mentioned that it happens when we refresh our instance. He suggested to create sysnonyms for DBLINK which points to Corporate instance. Then we should refer the synonym in our Materializd view script and not to refer the DBLINK directly in materialized view definition. He might be right but I am not sure whether his suggestion will solve our issue completely.
    We are refreshing the materialized views every four hours and we do complete refresh.
    Any suggestions to avoid the the above situation. Right now we recompile the materialized whenever the objects become invalid.
    Thanks
    Indu

    Hi,
    it happens when we refresh our instanceWhat do you mean ? Is it an export/import from an other database ? Does the db link used on source exists and works on the target (where you currently experience pb) ?
    Nicolas.

  • Materialized view not being used in the report

    I have had a materialized view (MV) for a particular report. Recently, the report definition has changed little bit, so the existing MV is not being used by the report anymore. I copied the code Discoverer's SQL Inspection and recreated the materialized view. But still it is not working. Obviously, I am missing something at the database level. Does anyone have any idea? The database is 9i and Discoverer is 9.0.2. Thank you!

    The SQL that you see from the Inspect SQL option will provide you with the SQL that Discoverer sends to the database. The database then may do a query rewrite to point to an available materialized view if available. This rewrite won't be seen from the inspect sql option. You need to check at the database level to verify if a query rewrite did in fact take place.
    You may want to check the section titled "Query Rewrite with Materialized Views" from Ch1 - "Introduction to the Optimizer" in the Oracle9i Database Performance Tuning Guide and Reference, Release 2 (9.2), Part Number A96533-02, available at http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/optimops.htm#37287
    Regards
    Abhinav Agarwal
    Oracle Business Intelligence Product Management
    http://www.oracle.com/bi
    http://www.oracle.com/technology/documentation/bi_ee.html
    http://www.oracle.com/technology/software/products/ias/htdocs/101320bi.html
    http://oraclebi.blogspot.com/

  • Need advise : Risks of using  materialized views

    Hi -
    I need some advise on whether using a materilzied view can help in teh folloiwng scenario.
    Scenario : You have a large tables which has sy 60 million rows, This is a demand management application which accesses this data at various aggregate levels (It is not using any OLAP functionality). The worksheets that is used to display the data takes up hours to execute on.
    To solve teh above scenario I created partitions on the base table say by time and the on top I created some materialized views. This gave me tremendoud gain in performance for the worksheets.
    Question is : Will Materialzied views help in situations say where the user changes the data in the worksheet and another user tries to query the changes will the materialized view be able to show the changes or do I need enforce a fast refresh. all the standard option of enabling query rewrite and fast refresh are enabled. The parameter for query_rewrite_integrity is set to Trusted.
    Please advise what could be teh pitfalls in managing such huge data where some of it changes infrequently.

    Hi Arch,
    Will Materialzied views help in situations say where the user changes the data in the worksheet and another user tries to query the changes will the materialized view be able to show the changes or do I need enforce a fast refresh.That depends on your "stale tolerance":
    http://www.dba-oracle.com/t_materialized_view_fast_refresh_performance.htm
    pitfalls in managing such huge data where some of it changes infrequently. If it does not change frequently, then it's just a matter of extra disk space for the materializations. I have more notes here:
    http://www.dba-oracle.com/t_finding_materialized_view_contents.htm
    Hope this helps. . .
    Don Burleson
    Oracle Press author
    Author of “Oracle Tuning: The Definitive Reference”
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

Maybe you are looking for