Refresh materialized view on fast refresh

Hi,
I want to create a fast refresh on a materialized view but i kept getting ORA-12015: cannot create a fast refresh materialized view from a complex query. When I did a complete refresh on the materialzed view, it completed. I have create a materialized view log for the table. In my materialized view script, I have included a user defined function. Does db version 10g have the capability to do a fast refresh?
Thanks

What is the query you are using for the MV?
The error message says it all... "cannot create a fast refresh materialized view from a complex query"
If your query is complex then you will have to perform complete refreshes.
One way around can be to fast refresh all tables in the query then create a view on them based on the 'complex' query. Admittedly this is only a workaround in certain scenarios.
Check out the documentation...
http://68.142.116.70/docs/cd/B19306_01/server.102/b14226/repmview.htm#sthref422

Similar Messages

  • Issue with materialized view and fast refresh between Oracle 10g and 11g

    Hi all,
    I've hit a problem when trying to create a fast-refreshable materialized view.
    I've got two databases, one 10.2.0.10, another 11.2.0.1.0, running on 32-bit Windows. Both are enterprise edition, and I'm trying to pull data from the 10g one into the 11g one. I can happily query across the database link from 11g to 10g, and can use complete refresh with no problem except the time it takes.
    On the 10g side, I've got tables with primary keys and m.v. logs created, the logs being of this form ...
    CREATE MATERIALIZED VIEW LOG ON table WITH PRIMARY KEY INCLUDING NEW VALUES
    On the 11g side, when I try to create an m.v. against that ...
    CREATE MATERIALIZED VIEW mv_table REFRESH FAST WITH PRIMARY KEY AS SELECT col1, col2 FROM table@dblink;
    ... I get an ORA-12028 error (materialized view type is not supported by master site).
    After running the EXPLAIN_MVIEW procedure it shows this;
    REFRESH_FAST_AFTER_INSERT not supported for this type mv by Oracle version at master site
    A colleague has managed to build a fast-refresh m.v. from the same source database, but pulling to a different one than I'm using; his target is also 10g, like the (common) source, so I've no idea why I'm getting the 'not supported' message whilst he isn't.
    I've been able, on previous projects, to do exactly what I'm trying to achieve but on those someone with more knowledge than me has configured the database!
    I'm now stumped. I'm also no DBA but despite that it's been left to me to install the new 11g database on the 32-bit Windows server from scratch, so there are probably a couple of things I'm missing. It's probably something really obvious but I don't really know where to look now.
    If anyone can give me any pointers at all, I'd be really grateful. This question is also duplicated in the Replication forum but hasn't had any replies as yet, so I'm reproducing it here in hope!
    Thanks in advance,
    Steve

    Hi Steve,
    You should have a look at metalink, Doc ID 1059547.1
    If that does not help, there may be something else in Mater note ID 1353040.1
    Best regards
    Peter

  • Enabling materialized view for fast refresh method

    In AWM when i select refresh method as FAST and enable the materialized view, am getting the below error:
    "Refresh method fast requires materialized view logs and a previously run complete refresh of the cube mv". i need this Fast refresh of a cube materialized view, so that it performs an incremental refresh and re-aggregation of only changed rows in the source table.
    can anyone help me on this??

    If you want the cube to hold data even after it has been deleted from the relational table, then you should disable the MV on the cube.
    Synchronization with the source table is determined by the default "cube script".
    <li>CLEAR, LOAD, SOLVE : This will synchronize your cube with the source table. It is a requirement for MVs.
    <li>LOAD, SOLVE: This will allow your cube to contain data even after it has been removed from the source table. It sounds like you want this.
    Cube builds can be "incremental" in one of two ways.
    (1) You can have an "incremental LOAD" if the source table contains only the changed rows or if you use MV "FAST" or "PCT" refresh. Since you can't use MVs, you would need a source table with only the changed rows.
    (2) You will have an "incremental SOLVE" (a.k.a. "incremental aggregation") if there is no "CLEAR VALUES" or "CLEAR AGGREGATES" step and various other conditions hold.
    To force a "complete LOAD" with an "incremental SOLVE" you should have all rows in your source table and run the following build script.
    LOAD, SOLVE You could also run "CLEAR LEAVES, LOAD, SOLVE" to synchronize the cube with the table.
    To force an "incremental LOAD" with a "complete SOLVE" you make the source table contains only the changed rows and the run the following:
    CLEAR AGGREGATES, LOAD, SOLVEor
    LOAD, CLEAR AGGREGATES, SOLVEFinally, if you want both LOAD and SOLVE to be incremental you make the source table contains only the changed rows and the run the following:
    LOAD, SOLVE

  • 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

  • Error While Creating Fast Refresh Materialized view.

    Table Scripts:
    CREATE TABLE CONTRACT_MASTER
      CONTRACT_SEQ                    NUMBER(10)    NOT NULL,
      PDN                             CHAR(5)       NOT NULL,
      APPID                           NUMBER(10)    NOT NULL,
      CONTRACT_LOB_DESC               VARCHAR2(20)  NOT NULL,
      CUSTOMER_NAME                   VARCHAR2(57)  NOT NULL,
      CONTRACT_DT                     DATE          NOT NULL,
      CONTRACT_RECD_DT                DATE          NOT NULL,
      HELD_OFFERING_DT                DATE          NOT NULL,
      DRAFT_AMT                       NUMBER(15,2)  NOT NULL,
      STATUS_DESC                                   VARCHAR2(20)  NOT NULL,
      GIF_UPLOAD_TM                                            TIMESTAMP     NOT NULL
    CREATE table CONTRACT_COMMENTS
      CONTRACT_COMMENTS_SEQ           NUMBER(10)     NOT NULL,
      APPID                           NUMBER(10)     NOT NULL,
      COMMENTS                        VARCHAR2(1000) NOT NULL,
      GIF_UPLOAD_TM                                            TIMESTAMP      NOT NULL
    Constraints on tables
    ALTER TABLE CONTRACT_MASTER ADD
      CONSTRAINT XPKCONTRACT_MASTER PRIMARY KEY (CONTRACT_SEQ) USING INDEX ;
    ALTER TABLE CONTRACT_COMMENTS ADD
      CONSTRAINT XPKCONTRACT_COMMENTS PRIMARY KEY (CONTRACT_COMMENTS_SEQ) USING INDEX ;
    alter table CONTRACT_MASTER add CONSTRAINT XUIAPPCONTRACT_MASTER UNIQUE (APPID) USING INDEX;
    CREATE INDEX XUIAPPCONTRACT_COMMENTS ON
    CONTRACT_COMMENTS(APPID) ;
    Materialized View Creation:
    CREATE MATERIALIZED VIEW LOG ON CONTRACT_MASTER WITH PRIMARY KEY,ROWID;
    CREATE MATERIALIZED VIEW LOG ON CONTRACT_COMMENTS WITH PRIMARY KEY, ROWID;
    CREATE MATERIALIZED VIEW MV_CONTRACT_COMMENTS_HELDOFFERING
    REFRESH FAST
    ENABLE QUERY REWRITE AS
    SELECT APPID,COMMENTS FROM CONTRACT_COMMENTS  WHERE APPID IN (
    SELECT APPID FROM CONTRACT_MASTER WHERE STATUS_DESC = 'Held Offering' )
    Errors generated:
    ERROR at line 4:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    _*Afer That I have changed the query but still it was not created like:*_
    CREATE  MATERIALIZED VIEW MV_CONT_COMMNTS_HELDOFFERNG
    REFRESH FAST
    ENABLE QUERY REWRITE AS
    SELECT CONTRACT_COMMENTS_SEQ,c.APPID,COMMENTS
    FROM CONTRACT_COMMENTS c,CONTRACT_MASTER  m 
    WHERE m.APPID = c.APPID and m.STATUS_DESC = 'Held Offering'
    *even though error displayed:
    SQL> CREATE  MATERIALIZED VIEW MV_CONT_COMMNTS_HELDOFFERNG*
       2  REFRESH FAST
       3  ENABLE QUERY REWRITE AS
       4  SELECT CONTRACT_COMMENTS_SEQ,c.APPID,COMMENTS
       5  FROM CONTRACT_COMMENTS c,CONTRACT_MASTER  m
       6  WHERE m.APPID = c.APPID and m.STATUS_DESC = 'Held Offering';
    FROM CONTRACT_COMMENTS c,CONTRACT_MASTER  m
    ERROR at line 5:
    ORA-12052: cannot fast refresh materialized view GSSIO.MV_CONT_COMMNTS_HELDOFFERNG
    *Again I have done "Analyzing Materialized Views for Fast Refresh" as follows:*
    1: exec dbms_mview.explain_mview('MV_CONT_COMMNTS_HELDOFFERNG');
    2: SELECT capability_name,  possible, SUBSTR(msgtxt,1,60) AS msgtxt
               FROM mv_capabilities_table
               WHERE capability_name like '%FAST%';
    Output is :
    CAPABILITY_NAME                               P              MSGTXT                                                            
    REFRESH_FAST                                   N                                                                   
    REFRESH_FAST_AFTER_INSERT            N  the SELECT list does not have the rowids of all the detail t      
    REFRESH_FAST_AFTER_ONETAB_DML   N  see the reason why REFRESH_FAST_AFTER_INSERT is disabled          
    REFRESH_FAST_AFTER_ANY_DML         N  see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled      
    REFRESH_FAST_PCT                            N  PCT is not possible on any of the detail tables in the mater      
    Please suggest what to do to implement fast refresh materialized view for same.Edited by: dba on Sep 20, 2010 12:00 AM

    If the two MVs have to be consistent with each other as of a specific time, put them into a Refresh Group and refresh them with DBMS_MVIEW.REFRESH
    If an MV is dependent on another, use DBMS_MVIEW.REFRESH_DEPENDENT
    See the "Oracle® Database PL/SQL Packages and Types Reference" documentation pages for DBMS_MVIEW.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com --- this is NOT a documentation site.
    Edited by: Hemant K Chitale on Sep 20, 2010 5:19 PM

  • Materiazed view with fast refresh

    Hi All,
    I want to create a Materialized view with fast refresh.
    I think for fast refresh we need to set up a materialized view log first before the MV gets created.
    Can someone please provide the steps and the syntax to do this?
    I am new to MV creation so appreciate any help in this regard.
    Thanks.
    AS

    http://www.morganslibrary.org/library.html
    Look up Materialized View Log and Materialized View ... both on the same page ... build the demo MV and you can modify the code to build any others you wish.

  • Reg:package code to refresh materialized views

    i am new to pl/sql packages and procedures.i want it to execute for running mappings in informatica which takes 0 and gives 1 when executed successfully
    create or replace PACKAGE BODY pkg_refresh_mv as
    procedure prc_mv (p_mv_name varchar2) is
    begin
    dbms_mview.refresh (p_mv_name);
    end prc_mv;
    procedure refresh_all_mv (proc_response IN OUT number) is
    begin
    dbms_mview.refresh('materialized view','C');
    dbms_mview.refresh('materialized view','C');
    proc_response := 1;
    exception
    when others then
    proc_response := 0;
    end refresh_all_mv ;
    end pkg_refresh_mv;
    when i execute this code i get the following errors
    PLS-00201: identifier 'PKG_REFRESH_MV' must be declared
    PLS-00304: cannot compile body of 'PKG_REFRESH_MV' without its specification
    what needs to be changed
    thanks

    try this one :
    CREATE OR REPLACE PACKAGE pkg_refresh_mv
    AS
       PROCEDURE prc_mv (p_mv_name VARCHAR2);  
       PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER);
    END pkg_refresh_mv;
    CREATE OR REPLACE PACKAGE BODY pkg_refresh_mv
    AS
       PROCEDURE prc_mv (p_mv_name VARCHAR2)
       IS
       BEGIN
          dbms_mview.refresh (p_mv_name);
       END prc_mv;
       PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER)
       IS
       BEGIN
          dbms_mview.refresh ('materialized view', 'C');
          dbms_mview.refresh ('materialized view', 'C');
          proc_response := 1;
       EXCEPTION
          WHEN OTHERS
          THEN
             proc_response := 0;
       END refresh_all_mv;
    END pkg_refresh_mv;
    /

  • Creation of fast refresh materialized view

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

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

  • 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-12015: cannot create a fast refresh materialized view from a complex qu

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit 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 - ProductionI'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh?
    CREATE TABLE "DAS_DESC"."AUTHORITY_TEST"
        "NAID"      NUMBER(20,0) NOT NULL ENABLE,
        "AUTH_TYPE" VARCHAR2(40 BYTE),
        "XML_DATA" "SYS"."XMLTYPE" ,
        "TERM_NAME" VARCHAR2(4000 BYTE)
    CREATE TABLE "DAS_DESC"."AUTH_ASSC_TEST"
        "NAID"    NUMBER(20,0),
        "P_NAID" NUMBER(20,0),
        "REL_TYPE"    VARCHAR2(25 BYTE),
        "XML_DATA" "SYS"."XMLTYPE"
    CREATE
    MATERIALIZED VIEW person_mv
    AS
    SELECT  p.naid
          , p.auth_type
          , INSERTCHILDXML
              p.xml_data                 -- Parent XML Column
            , '//*[contains(local-name(), ''person'')]' --XPATH to Person
            , 'nonPreferredHeadingArray'                -- Value for new child element
            (                                                       -- Sub query for injecting new variant person array
              SELECT XMLELEMENT
                "nonPreferredHeadingArray"
              , XMLAGG -- Aggregator for Variant Persons Array
                  XMLELEMENT
                    "variantPersonName"                    -- Wrapper for each entry in array
                  , extract(a.xml_data,'*/*')
              FROM auth_assc_table -- Link table
              WHERE a.p_naid = p.naid
          ) AS XML_DATA
    FROM authority p -- Parent table
    WHERE p.auth_type = 'Person';The views are created fine and they work perfectly for what we need. The problem is the refresh when we edit the base tables. Ideally, it should take a couple seconds. Right now, it takes a couple minutes. XMLTYPE is one problem and the Complex Query exception is the other. If there is a work-around for fast refresh, please let me know. Greatly appreciated.

    jjmdb wrote:
    I'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh? Besides XMLTYPE column, your MV definition has a subquery which prevents it from being fast refreshable.
    I could not find any specific reference in documentation about restriction on XMLTYPE (or CLOB) columns but it seems logical that oracle will not be able to keep track of changes to binary data. What does DBMS_MVIEW.EXPLAIN_MVIEW generate for your MV definition? That should tell you which all conditions (for FAST REFRESH) your MV violates. Since you can not create a MV LOG to include XMLTYPE column, it will not be possible to create a FAST REFRESHABLE MV that includes the XMLTYPE column.
    I am afraid there is not much you can do here unless you are prepared to change the way data is stored in your base tables. If you can store data in base tables using standard data types instead of binary/XML storage, you might be able to create a FAST REFRESHABLE MV.

  • ORA-12015:  cannot create a fast refresh materialized view from a complex q

    Hi,
    I'm facing very strange problem. Please help me why this error is coming
    I'm creating a simple materialized view, but it is giving below error since this is simple select * from.
    CREATE MATERIALIZED VIEW EFMS.MS_TASK
    BUILD IMMEDIATE
    REFRESH FAST
    START WITH SYSDATE
    NEXT (SYSDATE + 1/24)
    WITH ROWID
    AS
    SELECT * FROM MS_TASK@efms_link;
    SELECT * FROM MS_TASK@efms_link
    ERROR at line 8:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    CREATE MATERIALIZED VIEW LOG ON MSDBO.MS_TASK
    TABLESPACE DBOR_MVLOG
    PCTUSED 0
    PCTFREE 60
    INITRANS 20
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOLOGGING
    PARALLEL ( DEGREE 2 INSTANCES 1 )
    WITH ROWID, PRIMARY KEY
    EXCLUDING NEW VALUES;


    Not is a best practice to use 'select *'

    ORA-12015: cannot create a fast refresh materialized view from a complex query
    Cause:      Neither ROWIDs and nor primary key constraints are supported for complex queries.
    Action:      Reissue the command with the REFRESH FORCE or REFRESH COMPLETE option or create a simple materialized view.
    Then you have to change REFRESH FAST or create a primary key in MS_TASK@efms_link to avility fast refresh.
    . :-) any help with my english is wellcome :-) .

  • ORA-12015: cannot create a fast refresh materialized view from a complex

    Hi All,
    I am trying to create materialized view but i got a error ORA-12015: cannot create a fast refresh materialized view from a complex query.
    Regards,
    narayana

    Hi,
    Please see if (Note: 179466.1 - Diagnosing ORA-12015 fast refresh materialized view / complex queries) helps.
    Regards,
    Hussein

  • Fast Refresh Materialized view on a 'View'

    Hi,
    I am trying to create a materialized view with Refresh FAST option. This is based on a view. I am getting an error that there is no materialized view log on the table. But we cannot create a materialized view log on a view. Can you please let me know how to create a FAST REFRESH materialized view on a view.
    Thanks!

    Thanks Justin! Actually, I have a remote database on which I want the copy of one of our tables. We have a view on this table on the source database with meaningful names. I have created materialized view logs on the underlying table. If I am able to create a MV on the view, then I need not write that extra step to code for meaningful names. I wanted to know if a fast refresh is possible on a view (There are materialized view logs on the underlying table)?
    Thanks!

  • Fast-Refresh Materialized Views

    hi
    How to auto Refresh Materialized Views. Mean when ever a new row inserted into a table ; It must show automatically..
    Or Tells is that , Is it a good decision use Materialized Views for reporting purpose.
    Thanks
    Mani

    Small example for you:
    [email protected]> create table dept2 as select * from scott.dept;
    Table created.
    [email protected]> alter table dept2 add constraint dept2_pk primary key(deptno);
    Table altered.
    [email protected]> create materialized view log on dept2;
    Materialized view log created.
    [email protected]> create materialized view dept2_mv
    2 refresh fast on commit as
    3 select * from dept2 ;
    Materialized view created.
    [email protected]> select * from dept2_mv;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    [email protected]> insert into dept2 values(50,'HR','WARSAW');
    1 row created.
    [email protected]> commit;
    Commit complete.
    [email protected]> select * from dept2_mv;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    50 HR WARSAW
    Best Regards
    Krystian Zieja / mob

  • Alternative for OUTER Join for use in fast refresh materialized view

    Hi ,
    I have two tables as :
    CREATE TABLE TEST_SANDY1
    COL1 NUMBER
    CREATE TABLE TEST_SANDY2
    COL1 NUMBER,
    COL2 VARCHAR2(10 BYTE)
    Data for the tables are :
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    1);
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    2);
    INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
    3);
    COMMIT;
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    1, 'a');
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    2, 'b');
    INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
    4, 'd');
    COMMIT;
    Now when I run the following select statement :
    select
    b.col1
    from
    test_sandy1 a,
    test_sandy2 b
    where
    b.COL1 = a.COL1(+)
    I get :
    COL1
    1
    2
    4
    I want to build a materialized view to generate the same values but it has to be fast refresh. But since I am using outer join I am unable to create a fast refresh one.
    Can someone suggest an alternate select to create fast refresh materialized view.
    Thanks,
    Sandipan

    The select statement was not fitting my problem , so I'll change it as :
    select
    a.col1, nvl(b.col2, 'DEFAULT')
    from
    test_sandy1 a,
    test_sandy2 b
    where
    b.COL1(+) = a.COL1
    I get :
    COL1     VAL
    1     a
    2     b
    3     DEFAULT
    How do I this ?

Maybe you are looking for

  • CS4 in Snow Lepard Action Issues

    Snow Lepard 10.6.1 /  illCS4 14.0.0 I have a collection of actions (CS3) which are essential to my work. In particular, actions which call up Layer and Colour Palette functions which are not included in Keyboard mapping.  These actions are triggered

  • Broadcasting Blank Reports

    Is there any configuration I can use to stop Broadacsting blank reports. I'm doing a basic broadcast to email of a bex report. The report shows absence by cost centre. However there are some cost centres where the employee's assigned have not been ab

  • Help Dynamic pdf generation

    please help to generate dynamic pdf which show data of database.

  • Unable to open any website due to The proxy server is refusing connections, why?

    Firefox is opened, but unable to open any website. The message says, "The proxy server is refusing connections" & "Firefox is configured to use a proxy server that is refusing connections". I installed the version 8.0.1 again. But there was the same

  • Concrete example of (whole ALV program )

    Hi i did some modification in the ALV program before .  like changing field catalog etc...  but i have never write a whole program in ALV and would like to try one by myself . could you please in just 2 3 words write the step, and is there a sample p