Subquery is not supported on fast refresh ?

Hi ,
There is a long and complex sql statement in our production environment and the following subquery in it is called more 5 times in different clause.
I created materialized view to simplize it and decrease i/o, but fast refresh at commit time of the transaction was not support.
select report_dp as rpt_dp
from sys_currency_tbl where curr_cd = (select para_value from sys_system_param_tbl where para = 'base_currency')
SQL> select * from v$version;
BANNER
Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
SQL> create materialized view log on sys_system_param_tbl tablespace tbs_tmp with rowid,sequence (para,para_value) including new values;
Materialized view log created.
SQL> create materialized view log on sys_currency_tbl tablespace tbs_tmp with rowid,sequence (report_dp,curr_cd) including new values;
Materialized view log created.
SQL> create materialized view sys_currency_tbl_mv
2 refresh fast
3 on commit
4 as
5 select report_dp as rpt_dp
6 from sys_currency_tbl where curr_cd = (select para_value from sys_system_param_tbl where para = 'base_currency');
FROM sys_currency_tbl WHERE curr_cd = (SELECT para_value FROM sys_system_param_tbl WHERE para = 'BASE_CURRENCY')
ERROR at line 6:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
SQL> delete from mv_capabilities_table;
0 rows deleted.
SQL> exec dbms_mview.explain_mview('select report_dp as rpt_dp from sys_currency_tbl where curr_cd =
(select para_value from sys_system_param_tbl where para = ''base_currency'')','test');
PL/SQL procedure successfully completed.
SQL> set linesize 160
SQL> col msgtxt format a60
SQL> SELECT capability_name, possible,msgno,SUBSTR(msgtxt,1,60) AS msgtxt
2 FROM mv_capabilities_table
WHERE statement_id='test' and capability_name like '%FAST%';
3
CAPABILITY_NAME P MSGNO MSGTXT
REFRESH_FAST N
REFRESH_FAST_AFTER_INSERT N *2129 join or filter condition(s) are complex*
REFRESH_FAST_AFTER_ONETAB_DML N 2146 see the reason why REFRESH_FAST_AFTER_INSERT is disabled
REFRESH_FAST_AFTER_ANY_DML N 2161 see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled
REFRESH_FAST_PCT N 2157 PCT is not possible on any of the detail tables in the mater
General Restrictions on Fast Refresh
The defining query of the materialized view is restricted as follows:
     The materialized view must not contain references to non-repeating expressions like SYSDATE and ROWNUM.
     The materialized view must not contain references to RAW or LONG RAW data types.
     It cannot contain a SELECT list subquery.
     It cannot contain analytical functions (for example, RANK) in the SELECT clause.
     It cannot contain a MODEL clause.
     It cannot contain a HAVING clause with a subquery.
     It cannot contain nested queries that have ANY, ALL, or NOT EXISTS.
     It cannot contain a [START WITH …] CONNECT BY clause.
     It cannot contain multiple detail tables at different sites.
     On-commit materialized view cannot have remote detail tables.
     Nested materialized views must have a join or aggregate.
Above general restriction tell us subquery is not support on fast refresh, is right ?
If so could someone tell me how to simple the sql statement to avoid a lot of parse and I/O cost?

One way to simplify the statement and be able to use fast refreshed materialized views is getting rid of the sub-query
select a.reort_dp as rpt_dp
from sys_currency_tbl a ,  sys_system_param_tbl b
where a.curr_cd =b.para_value
and  b.para = 'base_currency'To get a faster execution, you need to do a comprehensive review of the statement, starting with explain plan, index availability and table/index statistics.
Iordan Iotzov
http://iiotzov.wordpress.com/

Similar Messages

  • Fast refreshable Mview question.

    Hi All,
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    "CORE     11.1.0.7.0     Production"
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Can't we make a Fast refresh materialized view which has UNIONALL operator on REMOTE DATA BASE..?
    REMOTEDB: R
    TARGETDB:T
    Note: all these tables are in Remote DB(R) and I want to create a Mat view on Target DB (T).
    create or replace view V_FIRST
    As
    select * from R1
    UNION ALL
    select * from R2
    UNION ALL
    select * from R3Now i am creating a Fast refresh Mat view
    CREATE MATERIALIZED VIEW REMOTE_MV
    REFRESH FAST ON DEMAND AS
    SELECT * FROM V_FIRST VF
    LEFT JOIN R4
    ON VF.ID=R4.ID
    LEFT JOIN R5
    ON  VF.ID=R5.IDHere i am getting error can not create a fast refreshable mat view on a complex query.
    I think we can create a fast refreshable Mat view which has UNION ALL operator... I don't know about remote tables.
    How to achieve this... with out splitting the Mat view ?. Is there any way..?
    Appreciate your help.
    Thanks,
    Mike

    Replace the ANSI Joins with Conventional Joins.
    Change this :
    SELECT * FROM V_FIRST VF
    LEFT JOIN R4
    ON VF.ID=R4.ID
    LEFT JOIN R5
    ON  VF.ID=R5.IDto this :
    SELECT VF.* FROM V_FIRST VF, R4, R5
    WHERE  VF.ID=R4.ID
    AND  VF.ID=R5.IDHemant K Chitale

  • Create a fast refresh materialized view with partitioned primary index

    Hi,
    I have a materialized view that is based on a table with primary key.
    I want to create a materialized view with a partitioned primary index . do you have any way of doing it?
    I tried to create a materialized view with rowid and then I created a partitioned primary index on it.
    It did not work as what I expected. I could not perform a fast refresh on it. the materialized view can only complete refresh
    thank you

    Hi,
    Here is some info from the Oracle Documentation.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10706/repmview.htm
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10810/basicmv.htm
    Determining the Fast Refresh Capabilities of a Materialized View
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10706/repmview.htm#BABEDIAH
    Regards,

  • "Fast Web View" not supported in Acrobat X plug-in for FireFox/Chrome

    The Acrobat X plug-in for displaying PDFs in FireFox/Chrome does NOT support fast web view.   This means that PDFs don't display until after the entire file has been download.
    For example, try viewing this document in either IE(Windows) or Safari(Mac):
    http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf
    Notice how it opens very quickly, and then you can scroll around and view all the content as the PDF content strreams in?  In Safari you can see the download progress like you used to be able to see in all versions of the acrobat plug-in.  Note also that in the IE version, although fast web view is working, you cannot see the download progress like you used to be able to... Thats an issue, but not nearly as bad as the real issue...
    Now try clicking the same link in either FireFox or Chrome (note that in Chrome you need to be sure that Chrome's PDF viewer is turned off and the acrobat plug-in is enabled).  Note that the PDF is not displayed until the entire file is downloaded.
    This feature is VITAL for viewing large documents online.  I'm astonished that this has not been reported by other users.
    Adobe -- PLEASE be sure that this gets fixed in the next update to Reader X!!  I was shocked to see that it was not fixed in 10.1.

    WHY would you want to disable this? Linearized "Fast Web View" enabled PDF are the right and proper type of document to be created.

  • MLOGS not purge after a fast refresh (Materialized view) ...

    Hi,
    I have a database on my own site (Quebec) that has 36 materialized views refresh by a master table site that is physically at Montreal. The MVIEWs are refreshed every day of the week (monday to friday) at 7h00 until 19h00. We use the "fast refresh" technic to refresh the materialized views.
    Last weekend, I transfered this database on a new server. So, I created a new SID (I rename the old SID "ORCL" by "ATQP") and I created this instance with a DB_BLOCK_SIZE of 16k rather than 8k. It's the only difference between the two instances (the old one and the new one). I also created the owner schema "ATQP" and I made an Export on the old server followed by an Import of the schema that owned the Materialized views (not a Full import) on the new server. The export was made many hours (saturday morning) after the last refresh of the week (friday, at 19h00) on the old server.
    After the successul import on my new server, I'm looking for the information about the creation of the MVIEW. Everything seems OK. I can see that the last refresh date indicated "2008-02-22 19:00" (date / time of the last refresh of the week). I made a quick test on a small MVIEW (a fast refresh) and it worked, no error.
    Yesterday morning, the DBA of the master table site mentionned us that the DELETE on the MLOGS didn't work on the master site. The refresh was made successfully but the MLOGS continue to grow up, again and again ... On my database, I'm looking in the SYS.SNAP$ table and I saw that the SNAPTIME date is '1950-01-01 12:00' rather than '2008-02-25 19:00'. In the SYS.SNAP_REFTIME, the SNAPTIME is OK but the LOADERTIME column contains the same strange date '1950-01-01 12:00'.
    I made a quick check on my old server and the SYS.SNAP$ table is empty !!! I think it's normal because the last refresh on this node was made last friday night and I made the transfert last saturday (I shutdown the old database after).
    I know how to solve the problem, by recreate the MVIEW, but it causes a big problem for us. We are in PRODUCTION and we don't want to refresh many millions of records. I think it will take a couple of days to refresh all the materialized views of my schema. And it doesn't sound good by the master table site management team ...
    The master table site "rush" us to solve the problem before the weekend. They don't want that we overcharge the network link between them and us by refreshing those MVIEWS.
    So, is it possible to make something simple to resynchronized the SNAPTIME date without refreshing completely all the materialized views ?
    If the master site table recreate the MLOG (purge manually), is it possible that it will solve our problem ?
    Is it also possible to recreate the MVIEW without refreshing the data (specify to Oracle to recreate the MVIEW but indicate that the table associated already exist) ?
    All of my materialized view are up to date concerning the data. I don't want to refresh all of it.
    Thank's in advance ...

    Hi Justin,
    The DBA of the master table site sent me a email about the fact he unregistered the MVIEW. He told me that the script for the unregistered worked well. He tried to purge the MLOG and he got the error ORA-23424 but I think it's normal (It's what you said yesterday about the fact that the UNREGISTER command also purge the MLOGS).
    So, it seems that the MLOGS are still not purged (that's what the DBA of the master table site said). I ran the following query:
    SQL> select * from [email protected];
    LOG_OWNER MASTER LOG_TABLE LOG_TRIGGER ROW PRI OBJ FIL SEQ INC
    ATQ ALIAS_ANILOTS MLOG$_ALIAS_ANILOTS NO YES NO YES NO YES
    ATQ ALIAS_INTERVENANTS MLOG$_ALIAS_INTERVENANTS NO YES NO YES NO YES
    ATQ ANILOTS MLOG$_ANILOTS NO YES NO YES NO YES
    ATQ CATEGORIES MLOG$_CATEGORIES NO YES NO YES NO YES
    ATQ CODES_POSTAUX MLOG$_CODES_POSTAUX NO YES NO YES NO YES
    ATQ COMMANDES MLOG$_COMMANDES NO YES NO YES NO YES
    ATQ COMMUNICATIONS MLOG$_COMMUNICATIONS NO YES NO YES NO YES
    ATQ DEPLACEMENTS MLOG$_DEPLACEMENTS NO YES NO YES NO YES
    ATQ DETAILS_STATUTS_COMMANDES MLOG$_DETAILS_STATUTS_COMM NO YES NO YES NO YES
    ATQ DOMAINES MLOG$_DOMAINES NO YES NO YES NO YES
    ATQ ENREGISTREMENT_LOGS MLOG$_ENREGISTREMENT_LOGS NO YES NO YES NO YES
    ATQ ENREGISTREMENT_NOTES MLOG$_ENREGISTREMENT_NOTES NO YES NO YES NO YES
    ATQ ESPECES MLOG$_ESPECES NO YES NO YES NO YES
    ATQ EVENEMENTS MLOG$_EVENEMENTS NO YES NO YES NO YES
    ATQ EVENE_DIFFERES MLOG$_EVENE_DIFFERES NO YES NO YES NO YES
    ATQ IDENTIFIANTS MLOG$_IDENTIFIANTS NO YES NO YES NO YES
    ATQ INTERVENANTS MLOG$_INTERVENANTS NO YES NO YES NO YES
    ATQ INTERVENANTS_CLIENTS MLOG$_INTERVENANTS_CLIENTS NO YES NO YES NO YES
    ATQ INTERVENANTS_SITES MLOG$_INTERVENANTS_SITES NO YES NO YES NO YES
    ATQ MAX_EVENE_DIFFERES MLOG$_MAX_EVENE_DIFFERES NO YES NO YES NO YES
    ATQ MESSAGES MLOG$_MESSAGES NO YES NO YES NO YES
    ATQ MUNICIPALITES MLOG$_MUNICIPALITES NO YES NO YES NO YES
    ATQ NEW_ANILOTS MLOG$_NEW_ANILOTS NO YES NO YES NO YES
    ATQ NEW_EVENEMENTS MLOG$_NEW_EVENEMENTS NO YES NO YES NO YES
    ATQ NEW_IDENTIFIANTS MLOG$_NEW_IDENTIFIANTS NO YES NO YES NO YES
    ATQ NEW_SITES MLOG$_NEW_SITES NO YES NO YES NO YES
    ATQ PAYS MLOG$_PAYS NO YES NO YES NO YES
    ATQ PRODUCTIONS MLOG$_PRODUCTIONS NO YES NO YES NO YES
    ATQ PROPRIETES_ANILOTS MLOG$_PROPRIETES_ANILOTS NO YES NO YES NO YES
    ATQ PROVINCES MLOG$_PROVINCES NO YES NO YES NO YES
    ATQ SITES_EXPLOITATIONS MLOG$_SITES_EXPLOITATIONS NO YES NO YES NO YES
    ATQ TYPES_IDENTIFIANTS MLOG$_TYPES_IDENTIFIANTS NO YES NO YES NO YES
    ATQ UTILISATEURS MLOG$_UTILISATEURS NO YES NO YES NO YES
    ATQ VALEURS MLOG$_VALEURS NO YES NO YES NO YES
    ATQ VALEURS_DETAILS MLOG$_VALEURS_DETAILS NO YES NO YES NO YES
    ATQ VEHICULES MLOG$_VEHICULES NO YES NO YES NO YES
    36 ligne(s) sélectionnée(s).
    SQL>
    I supposed that is the result of the MLOG of the MVIEW associated with my new server. How can I be sure that the MLOG associated with the old one are really deleted ?
    Thank you

  • Materialized view not fast refreshable

    I need to calculate a moving total in a materialized view - that is, calculate subtotal for rows starting at current row up to the first row.
    I am using a window function, as shown below.
    The problem is, MVs using window functions are not fast refreshable, and I need this MV to be fast refreshable.
    Is there any other way of getting the moving total without using a window function?
    CREATE MATERIALIZED VIEW BIL_BI_OPDTL_MV_11_TST
    --REFRESH FAST ON DEMAND
    AS
    SELECT
    fact.txn_time_id txn_time_id
    , fact.effective_time_id close_time_id
    , prntmv.parent_group_id
    , jgd.parent_group_id sales_group_id
    , fact.lead_id
    , fact.opp_open_status_flag
    , fact.win_loss_indicator
    , fact.forecast_rollup_flag
    ,fact.rev_flag1
    , SUM(fact.rev_flag1) OVER (PARTITION BY
    fact.effective_time_id , prntmv.parent_group_id
    , fact.lead_id, fact.opp_open_status_flag, fact.win_loss_indicator, fact.forecast_rollup_flag
    , to_number(to_char(opty_creation_date,'J'))
    , to_number(to_char(opty_conversion_date,'J'))
    ORDER BY fact.lead_id
    ROWS UNBOUNDED PRECEDING) moving_total
    , to_number(to_char(opty_creation_date,'J')) opty_creation_time_id
    , to_number(to_char(opty_conversion_date,'J')) opty_conversion_time_id
    ,count(*) cnt
    FROM bil.bil_bi_opty_ld_f_tst fact, bil_bi_rs_grp_mv rgmv, bil_bi_rs_grp_mv prntmv,
    jtf.jtf_rs_groups_denorm jgd
    WHERE rgmv.sales_group_id = fact.sales_group_id
    and rgmv.salesrep_id = fact.salesrep_id
    AND fact.sales_group_id = jgd.group_id
    AND prntmv.sales_group_id = jgd.parent_group_id
    AND prntmv.umarker in ('top_groups', 'groups')
    AND jgd.active_flag='Y'
    group by
    fact.txn_time_id,
    fact.effective_time_id
    , prntmv.parent_group_id
    , jgd.parent_group_id
    , fact.lead_id
    , fact.opp_open_status_flag
    , fact.win_loss_indicator
    , fact.forecast_rollup_flag
    , fact.rev_flag1
    , to_number(to_char(opty_creation_date,'J'))
    , to_number(to_char(opty_conversion_date,'J'))

    Please post your question at
    General Database Discussions
    for faster response

  • Materialized view - fast refresh not working on joins

    Hello,
    Is it true that fast refresh for materialized view is not possible when I do a union of 2 tables, although both tables have materialized view logs ?

    there are a number of restrictions with fast refresh, read Materialized View Fast Refresh Restrictions and ORA-12052 [ID 222843.1]
    edit: his royal kyteness has posted on this before
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6506967884606
    Edited by: deebee_eh on Apr 25, 2012 3:13 PM

  • Hi,  Trying to log in with my user id and password at iocbc but was not able to access. Problem message shown : Applet not initialised or may not be supported. Please refresh the page or check the browser setting  Anyone can advise? or i need to download?

    Hi,
    i have the same problem?
    Trying to log in with my user id and password at iocbc but was not able to access.
    Problem message shown : Applet not initialised or may not be supported. Please refresh the page or check the browser setting
    Anyone can advise?

    You need to install Java for your Mac OS version, and/or make sure it's enabled in the Java Preferences application and your browser's preferences.

  • How fast does Apple produce new RAW files for new cameras? I want to buy a D7100 wich is not supported in the present version?

    How fast does Apple produce new RAW files for new cameras? I want to buy a D7100 wich is not supported in the present version?

    Jeannot7 wrote:
    I'm interested in seeing who gets the D7100 support first? Apple or Adobe!! I will go with the one that gets it out first.
    FWIW,
    Adobe keeps a quarterly release schedule for RAW updates. The current Lightroom 4.4 RC expires on 5/31/2013 which typically is an indication that the official release will be close to that date. According to the current list of new supported cameras, the Nikon D7100 is not slated to be supported (but that could change on release).
    http://labs.adobe.com/technologies/lightroom4-4/?tabID=details#tabTop
    The most likely time frame for Adobe support of the D7100 will be sometime in August or September 2013 (although there will probably be a Lightroom 4.5 RC available prior to that for testing purposes).

  • FAST refresh not working for Cube & Dimensions in AWM

    Hi,
    My doubt is regarding refreshing cube/dimension using FAST refresh method in AWM     
    1     My dimension (MVIEW refresh enabled in AWM) is refreshed without an error when I pass the refresh method parameter as *'F'* in DBMS_CUBE.BUILD() script, although there is no MVIEW log present on the dim table.
         In ALL_MVIEWS.LAST_REFRESH_TYPE, a *'COMPLETE'* refresh is logged.
    2. My CUBE doesn't allow to select refresh_type=FAST when there is no MVIEW log built.
         The same CUBE (MVIEW refresh enabled, refresh_type=FAST in AWM) throws following error even when I create Mview logs for all fact and dimension tables in the DB.
    java.lang.NullPointerException
    at oracle.olap.awm.dataobject.DatabaseDO.commitOLAPI(Unknown Source)
    at oracle.olap.awm.dataobject.aw.WorkspaceDO.commitOLAPI(Unknown Source)
    at oracle.olap.awm.dataobject.olapi.UModelDO.commitOLAPI(Unknown Source)
    at oracle.olap.awm.dataobject.olapi.UModelDO.update(Unknown Source)
    at oracle.olap.awm.dataobject.olapi.UCubeDO.update(Unknown Source)
    at oracle.olap.awm.dataobject.dialog.PropertyViewer.doApplyAction(Unknown Source)
    at oracle.olap.awm.dataobject.dialog.PropertyViewer$1ApplyThread.run(Unknown Source)     
    If I continue with this error, CUBE mview vanishes from the DB.
    Please help - How to do a FAST refresh for CUBE and Dimensions.
    Edited by: 861346 on May 26, 2011 12:12 AM
    Edited by: 861346 on May 26, 2011 12:13 AM
    Edited by: 861346 on May 26, 2011 12:14 AM

    If your object is to process the cube as quickly as possible, MV refresh of the cube is probably not required. As an alternative, you can do the following:
    - Map the cube to a view and use a filter control what data is presented to the cube during a refresh.
    - Avoid dimension maintenance (adding new members, dropping members, changing parent-child relationships).
    Let's say you update your cube daily with sales data coming from 10,000 stores. You could add a LAST_UPDATED column to the source fact table, timestamp rows whenever the fact table is updated and then filter on that column in a view to present only the new or changed records to the cube (or whatever filtering scheme you might like).
    Dimensions are always entirely processed (compiled) regardless of what data is presented to them, so there isn't any advantage to timestamping the records in the dimension table and filtering on them. What is important to understand is that any change to a hierarchy (adding members, deleting members, changing parentage) will trigger re-aggregation of the cube. If you can batch those changes periodically you can limit how much of the cube is processed during a refresh.
    Continuing with the example of the daily update of the sales cube, we can examine two scenarios. In both cases, the cube is partitioned by month and a fact view filters for only the new or updated fact records (let's say there are new records every day).
    Scenario 1
    New records are added to the sales fact table and new stores are added to the store dimension table each day. The store dimension will be updated with new stores, new records will be loaded from the fact table and all partitions will be processed (loaded and solved/aggregated).
    Scenario 2
    New records are added to the fact table, but new stores loaded into the store dimension only once a week (e.g., Saturday). The fact view filters for only new or changed records and stores that currently exist in the store dimension. For Sunday through Friday, new or changed records will be loaded from the fact table and only those partitions in the cube that have new or updated data will be solved / aggregated. (If there are no changes to hierarchies and no records are loaded into a partition, that partition is not solved / aggregated). On Saturday, new stores are added to the store dimension table and the store dimension and the cube are updated. Because the store dimension has changed, all partitions of the will be processed.
    With scenario 1, data for new stores are available each day but the entire cube might be solved each day (if there are new stores). In scenario two, new stores are not available until Saturday but the processing of the cube will be limited to only those partitions where there is new fact data.

  • Your TV may not support this resolution or refresh rate.

    Hi All,
    In the last hour, my apple TV (3rd Gen) has changed the TV resolution (hookup via HDMI directly into a Samsung 720p LED TV). Everything is bigger. No issue since in the past I would just change the resolution manually to 720p 50Hz, but now it will not let me and it says the following:
    "Your TV may not support this resolution or refresh rate."
    Does this have anything to do with ATV latest software update? Is it that my TV is an older model?
    Any and all ideas would be greatly appreciated.
    Best,
    Bonfoa

    Change the Apple TV resolution:
    Press and hold the Menu and Up button on your Apple Remote for six seconds.
    The Apple TV will automatically cycle to the next resolution at approximately 20 second intervals.
    Press Play on the Apple Remote to keep the current resolution or Select to manually cycle to the next resolution.

  • Fast refresh of materialized view on remote database

    Hi All,
    I have the following scenario, two databases called ORCL_1 and ORCL_2
    ORCL_1 (11.1.0.7) ORCL_2 (10.2.0.1)
    EMPLOYEE (Master table)
    DEPARTMENT (Master table)
    I have created materialied view logs on both the master tables as follows...
    create materialized view log on department
    with rowid, sequence(department_id, department_name)
    including new values
    create materialized view log on employee
    with rowid, sequence (employee_no, surname, firstname, title, department_id, dob, dependants)
    including new values
    On ORCL_1 i have created a materialized view as follows...
    create materialized view employee_mview
    build immediate
    refresh on demand with rowid
    as select e.employee_no, e.title, e.firstname, e.surname, d.department_name, d.department_id, e.dob, e.dependants, e.rowid emp_rowid, d.rowid dept_rowid
    from employee@ORCL_2 e,
    department@ORCL_2 d
    where e.department_id = d.department_id
    then i have a scheduled task, on ORCL_1, that execute "...dbms_mview.refresh ('mac_dba.employee_mview','?');...." every minute
    this works fine, except for the fact that all the records are deleted from the materialized view and then all the records are re-inserted.
    How can i get it so that only the records that have been added or amended, as per the materialized view logs, are refreshed to the materialized view.
    thanks
    Mel

    Hi Harry,
    Have tried creating materialized view as follows...
    create materialized view mac_dba.employee_mview
    build immediate
    refresh fast on demand with rowid
    as select e.employee_no, e.title, e.firstname, e.surname, d.department_name, d.department_id, e.dob, e.dependants, e.rowid emp_rowid, d.rowid dept_rowid
    from mac_dba.employee@ORCL_2 e,
    mac_dba.department@ORCL_2 d
    where e.department_id = d.department_id
    I get the following error message
    ORA-12028: materialized view type is not supported by master site
    thanks
    Mel

  • MATERIALIZED view on two tables with Fast Refresh

    i Wanted to create MV on two tables with Fast refresh on commit.
    I followed below steps
    create materialized view log on t1 WITH PRIMARY KEY, rowid;
    create materialized view log on t2 WITH PRIMARY KEY, rowid;
    CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
    REFRESH fast ON commit
    ENABLE QUERY REWRITE
    AS
    select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
    from t1 A
    join t2 b
    on AB.c1= CD.c2;
    i am getting below error.
    Error report:
    SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
    Please do the needfull.

    does the table support PCT? the other restrictions on joins look to be ok in your statement.
    maybe try creating first with on demand instead of commit to see does it create.
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
    >
    Materialized Views Containing Only Joins
    Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
    Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
    A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
    If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
    A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
    The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
    If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met.

  • Regarding Error in Materialized view Fast Refresh

    ORA-12015: cannot create a fast refresh materialized view from a complex query
    CREATE MATERIALIZED VIEW MVCONTENTHISTORY_01
    BUILD IMMEDIATE
    REFRESH FAST
    WITH PRIMARY KEY
    ENABLE QUERY REWRITE
    AS
    SELECT a.DAY, a.contentname,
    SUM
    (CASE
    WHEN (b.subscriptionstartdate) <= (a.DAY)
    AND ((CASE
    WHEN b.subscriptionenddate IS NOT NULL
    THEN (a.DAY)
    ELSE TO_DATE ('01/20/1990', 'MM/DD/YYYY')
    END
    ) <=
    (CASE
    WHEN b.subscriptionenddate IS NOT NULL
    THEN (b.subscriptionenddate)
    ELSE TO_DATE ('01/20/1990', 'MM/DD/YYYY')
    END
    THEN 1
    ELSE 0
    END
    ) COUNT,
    COUNT
    (CASE
    WHEN (b.subscriptionstartdate) <= (a.DAY)
    AND ((CASE
    WHEN b.subscriptionenddate IS NOT NULL
    THEN (a.DAY)
    ELSE TO_DATE ('01/20/1990', 'MM/DD/YYYY')
    END
    ) <=
    (CASE
    WHEN b.subscriptionenddate IS NOT NULL
    THEN (b.subscriptionenddate)
    ELSE TO_DATE ('01/20/1990', 'MM/DD/YYYY')
    END
    THEN 1
    ELSE 0
    END
    ) cnt
    FROM TBLTDATEWISECONTENT a,
    (SELECT TRUNC (a.subscriptionstartdate) subscriptionstartdate,
    TRUNC (a.subscriptionenddate) subscriptionenddate, b.NAME,
    b.contentid
    FROM syntbltcontentsubscrhistory a, syntblmcontent b
    WHERE b.contentid = a.contentid(+)) b
    WHERE a.contentid = b.contentid(+) AND a.DAY = b.subscriptionstartdate(+)
    GROUP BY a.contentname, a.DAY;
    I can't create Materialized view with fast Refresh .
    Kindly provide solution .
    Regards,
    nayana chavda.

    Kindly provide full Oracle version since option vary by release.
    There error message says it is impossible to fast refresh based on a complex query.
    On 10g Oracle provides a package procedure that will tell you why the view cannot be fast refreshed: dbms_mview.explain_mview.
    Otherwise see the Advanced Replication Manual for a list of restrictions.
    10gR2 >>Restrictions for Materialized Views with Subqueries
    The defining query of a materialized view with a subquery is subject to several restrictions to preserve the materialized view's fast refresh capability.
    The following are restrictions for fast refresh materialized views with subqueries:
    Materialized views must be primary key materialized views.
    The master's materialized view log must include certain columns referenced in the subquery. For information about which columns must be included, see "Logging Columns in the Materialized View Log".
    If the subquery is many to many or one to many, join columns that are not part of a primary key must be included in the materialized view log of the master. This restriction does not apply to many to one subqueries.
    The subquery must be a positive subquery. For example, you can use the EXISTS condition, but not the NOT EXISTS condition.
    The subquery must use EXISTS to connect each nested level (IN is not allowed).
    Each table can be in only one EXISTS expression.
    The join expression must use exact match or equality comparisons (that is, equi-joins).
    Each table can be joined only once within the subquery.
    A primary key must exist for each table at each nested level.
    Each nested level can only reference the table in the level above it.
    Subqueries can include AND conditions, but each OR condition can only reference columns contained within one row. Multiple OR conditions within a subquery can be connected with an AND condition.
    All tables referenced in a subquery must reside in the same master site or master materialized view site.
    <<
    HTH -- Mark D Powell --
    Message was edited by: added list of restrictions left off initial post
    mpowel01

  • Macbook MiniVGA Display port Epson Projector Issues "Not Supported"

    I have been using my Macbook OSx 10.8.5 with a Rocketfish Mini Displayport to VGA adapter (RF-AP307) connected to an Epson Projector (Powerlite83plus) for 3 weeks and just the other day a blue screen appeared on the projector stating that the computer is 'Not Supported'.
    Actions I have already tried:
    - turned on and off mirroring
    - changed the refresh rate
    - unplugged VGA adapter and restarted the computer
    - attempted to install firmware update for MiniVGA display port following directions located here: http://support.apple.com/downloads/_Mini_DisplayPort_to_VGA_Firmware_Update (update failed because VGA adapter not found)
    Anyone having similar issues and have some additional solutions? Need a solution fast, if I need to buy another VGA adapter I will but would rather not have to spend the money again...
    Thanks

    "- attempted to install firmware update for MiniVGA display port following directions located here: http://support.apple.com/downloads/_Mini_DisplayPort_to_VGA_Firmware_Update (update failed because VGA adapter not found)"
    That update is for the Apple branded adapter, not the Rocketfish adapter.
    I have the same adapter as you and have had no problems.  That doesn't really mean anything other than the part does work with many types of projectors.  Yours could have failed, though.  Does it work on any other display or projector?

Maybe you are looking for

  • Animated Gif as an ICNS

    Hi Everyone, please could you help me, i am trying to change my External USB hard drive icon to a Animated gif with a flashing blue light i have created the gif and put it through img2icns but that doesn't seem to work, so my question is 1 if it is p

  • Dynamic Credit Limit check not giving error message

    Hi! I have configured the credit management like below: 1. high risk, medium risk, low risk category. 2. credit control area with update : 00000012 3. In pricin procedure for net value, routine "A" is given. 4. In Item Category, Credit Active tick ma

  • Neither of my ipod touches will synch

    I have 2 ipod touches That will no longer sync with itunes. I uninstalled, and reinstalled itunes. I am using Windows 7.

  • How to disable fields on selection screen?

    hi, i have two fields f1 and f2 on selection screen and two radio buttons r1 and r2. if i select r1, f1 should be input enable and f2 shuld be disabled. and if i select r2, f2 should be input enable and f1 shuld be disabled. i hav code like this SELE

  • Cannot open some ID files

    I am on Mac and just installed Snow Leopard. Upon attempting to open some ID doc's I get a window stating, "Missing required parameter "from" for event "open." Clicking OK doesn't open the ID document. I am totally befuddled as many of my ID files ca