Diff materialized view and view

what is diff materialized view and view

Check these documents please
[Overview of Materialized Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT411]
[Overview of Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#i20690]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com

Similar Messages

  • Table and Materialized View in different namespaces?

    I've just faced something completly new for me. It appears that there are two objects with the same name and owner. Table and Materialized View have the same names and when I look into system dictionary I can se sth. like that:
    OWNER OBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE NAMESPACE
    USER_A USER_TABLE 159381 159381 TABLE 1
    USER_A USER_TABLE 159382 MATERIALIZED VIEW 19
    (I couldn't find how to write above with const length font).
    Two object in different namespace? I thought that Tables and Materialized Vievs have the same namespace.
    Can you please tell me how can I create objects to achieve above result? I would also be grateful if you tell me where to find that topic in documentation.

    Perfectly normal.
    SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
    no rows selected
    SQL>
    SQL> create materialized view test_mv
      2  as
      3  select sysdate from dual;
    Materialized view created.
    SQL>
    SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
    OBJECT_NAME                                        OBJECT_TYPE
    TEST_MV                                            TABLE
    TEST_MV                                            MATERIALIZED VIEW
    SQL>
    SQL> drop materialized view test_mv;
    Materialized view dropped.
    SQL>
    SQL> select object_name, object_type from user_objects where object_name = 'TEST_MV';
    no rows selected
    SQL>

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

  • Authorization for material type and material views

    Hello all,
    I would need to restrict a user group, in creation (MM01) and modification of material master, based of type material and material views.
    The authorization, for each user should be:
    - view, modify and create of all views, except accounting (B) for type material ZFER;
    - view, modify and create of all views for type material ZOFF.
    I tried to create 2 roles in PFCG with the following authorization objects:
    1) M_MATE_MAR (Material Master: Material Types)  ACTVT = *, BEGRU = ZFER and M_MATE_STA (Maintenance Statuses) ACTVT = *, STATM = A,C, D, E, F, G,K, L, P, Q, S, V, X, Z (excluding B)
    2) ) M_MATE_MAR  ACTVT = *, BEGRU = ZFER and M_MATE_STA ACTVT = *, STATM = B
    but the effect is to be authorized, to all view for material type ZFER and ZOFF.
    I have already updated the authorization group of the type materials (OMS2).
    Is there a solution for this problem?
    (component version SAP ECC 6.0)
    Thanks.
    Regards,
    Luca

    I tried to create 2 roles in PFCG with the following authorization objects: 1) M_MATE_MAR (Material Master: Material Types) ACTVT = *, BEGRU = ZFER and M_MATE_STA (Maintenance Statuses) ACTVT = *, STATM = A,C, D, E, F, G,K, L, P, Q, S, V, X, Z (excluding B) 2) ) M_MATE_MAR ACTVT = *, BEGRU = ZFER and M_MATE_STA ACTVT = *, STATM = B
    - Are both these roles assigned to the same user? then your purpose is not solved, It is more or less like giving full authorization.
    - One role should be
    M_MATE_MAR (Material Master: Material Types) ACTVT = *, BEGRU = ZFER and M_MATE_STA (Maintenance Statuses) ACTVT = *, STATM = A,C, D, E, F, G,K, L, P, Q, S, V, X, Z (excluding B) for view, modify and create of all views, except accounting (B) for type material ZFER. This should be assigned to one user
    - Second role should be
    M_MATE_MAR ACTVT = *, BEGRU = ZOFF and M_MATE_STA ACTVT = *, STATM = * for view, modify and create of all views for type material ZOFF. This role should be assigned to the second user.
    Regards,
    Subbu

  • Materialized View  with Joins and Possibilities of Partitioning

    Hi,
    We have a materialized view which has a data to query around 12 gb. The query goes some thing like
    this.
      Select a.c1,a.c2,b.c1,b.c2,c.c1,c.c2
      from a,b,c
      where a.c1=b.c1
      --and the where condition goes on...
      --i.e Basically joining 3 different tables with complex join conditions but without any group functions and subqueries.
       Now i have few questions here.
    Firstly as the Mview is created with joins we will have to create separate logs for each tables and we have did the same. The logs are created with rowid and sequence for better performance during refresh.
    Question No 1
    Is this is a best approach for materializing a query with complex join conditions. Or Is it better to make 3 different materialized views for each 3 tables and join those 3 MViews and write a query for my report. I ask this question just to make sure the refresh time is brought down by this method. But as such as we have created 3 different logs for 3 tables the refresh must be happening separately.
    Question No 2
    Data is likely to grow faster and faster on this. So we have a idea of making this a partitioned Mview. Can the Pro's advice me on this and suggest me the right practice for the same and help me to correct links from where i can pick a example and continue from there.
    Question No 3
    How to find whether the materialized view has refreshed on a fast mode or complete mode after the last refresh.
    Apart from querying and checking the rowid which i feel is quiet cumbersome for a mview with a data volume like what we have. By default when i see the info in TOAD for this Mview it shows Refresh Mode as "Force". But how to ascertain this.
    Thanks in anticipation for a good round of discussion

    Hi,
    We have a materialized view which has a data to query around 12 gb. The query goes some thing like
    this.
      Select a.c1,a.c2,b.c1,b.c2,c.c1,c.c2
      from a,b,c
      where a.c1=b.c1
      --and the where condition goes on...
      --i.e Basically joining 3 different tables with complex join conditions but without any group functions and subqueries.
       Now i have few questions here.
    Firstly as the Mview is created with joins we will have to create separate logs for each tables and we have did the same. The logs are created with rowid and sequence for better performance during refresh.
    Question No 1
    Is this is a best approach for materializing a query with complex join conditions. Or Is it better to make 3 different materialized views for each 3 tables and join those 3 MViews and write a query for my report. I ask this question just to make sure the refresh time is brought down by this method. But as such as we have created 3 different logs for 3 tables the refresh must be happening separately.
    Question No 2
    Data is likely to grow faster and faster on this. So we have a idea of making this a partitioned Mview. Can the Pro's advice me on this and suggest me the right practice for the same and help me to correct links from where i can pick a example and continue from there.
    Question No 3
    How to find whether the materialized view has refreshed on a fast mode or complete mode after the last refresh.
    Apart from querying and checking the rowid which i feel is quiet cumbersome for a mview with a data volume like what we have. By default when i see the info in TOAD for this Mview it shows Refresh Mode as "Force". But how to ascertain this.
    Thanks in anticipation for a good round of discussion

  • DBMS_METADATA.GET_DDL and Materialized View

    hi gurus,
    In 10gR2, i have created a materialized view EMP_MV with a simple structure.
    I wanted to get the DDL of EMP_MV.
    I used DBMS_METADATA to get the DDL,
    select DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','EMP_MV','TARGET') into v_return from dual;
    Output
    CREATE MATERIALIZED VIEW "TARGET"."EMP_MV"
    ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "TARGET_TS_01"
    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 "TARGET_TS_01"
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS select empid,empname,address from web.emp
    Is there any way to get only SELECT part of this MV, ie select empid,empname,address from web.emp directly from dictionary without any string manipulation?
    tia,
    newbie

    Yes you can do it. By using INSTR and SUBTR against the result of GET_DDL function
    Try this:
    select substr(DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','EMP_MV','TARGET'),instr(DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','EMP_MV','TARGET'),'select'),1000)
    into v_return from dual;- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • 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

  • How to create materialized  view with parameter and index ?

    Hi all,
    i am using oracle 11g.
    i want to create  parameter materialized view  with two parameter (STORED_VALUE, LOV_NAME) with  an index .
    i have below view
    CREATE OR REPLACE FORCE VIEW SR_MY_TEST(DISPLAYED_VALUE, STORED_VALUE, LOV_NAME) AS
      SELECT  DISPLAYED_VALUE , LOVVALUE.STORED_VALUE , lovname.lov_name
               FROM (SELECT T.LOV_VALUE_ID,
          T.LOV_ID,
          T.ORG_ENTITY_ID,
          T.STORED_VALUE,
          T.DISPLAYED_VALUE,
          T.ENTERPRISE_ID
         FROM MS_QS_LIST_OF_VALUES_T T) lovvalue, ms_qs_lov_names lovname
              WHERE lovvalue.lov_id = lovname.lov_id
                AND lovvalue.org_entity_id = 1
                and LOVVALUE.ENTERPRISE_ID = 100000
                AND LOVNAME.ENTERPRISE_ID = 100000;
    i want to create index on   STORED_VALUE, LOV_NAME
    Thanks
    Damby

    No.AFAIK, there's nothing called as "parameterized MV".
    Materialized View store data like tables (and not like Views). So, does it make sense when you say - "table with parameters" ?
    Could you please explain your business requirement?
    What is the purpose behind those 2 parameters?

  • Terminator missing in materialized view diff script

    Is this a known issue?  I'm on Version 4.1.0.18:
    When a difference in a materialized view is found,  the generated script does not include a semicolon between the CREATE MATERIALIZED VIEW and the COMMENT ON statements.  Is has to be manually added to the script.
    The export DDL works fine.

    Thank you for the reply.
    So, once the materialized view is refreshed, the previous data will be cleared, right? I wanted to store old data and add new data at the same time, but it seems to be impossible.
    In our environment, table Log1 and Log2 are used alternately. So, once 14 days data are stored in Log1, new log data will be written into Log2 table and after another 14 days, the new log data will be written in Log1 Table. So, Maximum 28 days data can be stored.

  • Truncate table and materialized view log

    I user oracle 10 R2
    I have a table and on that table a materialized view log.
    I execute in a pl/sql procedure:
    1) execute immediate('drop materialized view log on tab1');
    then:
    2) execute immediate('truncate table tab1');
    3) Now I insert a lot of records in tab1
    4) execute immediate('create materialized view log on tab1 WITH rowid INCLUDING NEW VALUES');
    When I create the materialized view log I recieved this message:
    ora32321: refresh fast on tab2 unsupported after detail table truncate
    Why?

    Refresh fast after truncate operation on container table is not supported, regardless the container table is or is not partitioned.
    Perform a refresh complete.
    ORA-32321 :
    Cause:     A detail table has been truncated and no materialized view
         supports fast refersh after a detail table has been truncated
    Action:     Use REFRESH COMPLETE. Note: you can determine why your
         materialized view does not support fast refresh after TRUNCATE
         using the DBMS_MVIEW.EXPLAIN_MV() API.

  • Moving all Materialized View and logs at schema level using data pump

    Hi Experts,
    Please help me on how can I exp/imp all Materialized Views andMV logs (as these are local MVs) only of complete schema to other database. I want to exlude everything else.
    Regards
    -Samar-

    Use DBMS_METADATA. Create the following SQL script:
    SET FEEDBACK OFF
    SET SERVEROUTPUT ON FORMAT WORD_WRAPPED
    SET TERMOUT OFF
    SPOOL C:\TEMP\MVIEW.SQL
    DECLARE
        CURSOR V_MLOG_CUR
          IS
            SELECT  DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW_LOG',LOG_TABLE) DDL
              FROM  USER_MVIEW_LOGS;
        CURSOR V_MVIEW_CUR
          IS
            SELECT  DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW',MVIEW_NAME) DDL
              FROM  USER_MVIEWS;
    BEGIN
        DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
        FOR V_REC IN V_MLOG_CUR LOOP
          DBMS_OUTPUT.PUT_LINE(V_REC.DDL);
        END LOOP;
        FOR V_REC IN V_MVIEW_CUR LOOP
          DBMS_OUTPUT.PUT_LINE(V_REC.DDL);
        END LOOP;
    END;
    SPOOL OFFIn my case script is saved as C:\TEMP\MVIEW_GEN.SQL. Now I'll create a mview log and mview in SCOTT schema and run the above script:
    SQL> CREATE MATERIALIZED VIEW LOG ON EMP
      2  /
    Materialized view log created.
    SQL> CREATE MATERIALIZED VIEW EMP_MV
      2  AS SELECT * FROM EMP
      3  /
    Materialized view created.
    SQL> @C:\TEMP\MVIEW_GEN
    SQL> Running script C:\TEMP\MVIEW_GEN.SQL generated a spool file C:\TEMP\MVIEW.SQL:
      CREATE MATERIALIZED VIEW LOG ON "SCOTT"."EMP"
    PCTFREE 10 PCTUSED 30 INITRANS
    1 MAXTRANS 255 LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1       
    MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
    DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "USERS"
    WITH PRIMARY KEY EXCLUDING NEW VALUES;
      CREATE MATERIALIZED VIEW "SCOTT"."EMP_MV" ("EMPNO", "ENAME", "JOB", "MGR",  
    "HIREDATE", "SAL", "COMM", "DEPTNO")
      ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 
    INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576
    MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE 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 FLASH_CACHE    
    DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "USERS"
      REFRESH FORCE ON     
    DEMAND
      WITH PRIMARY KEY USING DEFAULT LOCAL ROLLBACK SEGMENT
      USING ENFORCED
    CONSTRAINTS DISABLE QUERY REWRITE
      AS SELECT "EMP"."EMPNO"                    
    "EMPNO","EMP"."ENAME" "ENAME","EMP"."JOB" "JOB","EMP"."MGR"                    
    "MGR","EMP"."HIREDATE" "HIREDATE","EMP"."SAL" "SAL","EMP"."COMM"               
    "COMM","EMP"."DEPTNO" "DEPTNO" FROM "EMP" "EMP";
                                   Now you can run this on other database. You might need to adjust tablespace and storage clauses. Or you can add more DBMS_METADATA.SET_TRANSFORM_PARAM calls to C:\TEMP\MVIEW_GEN.SQL to force DBMS_METADATA not to include tablespace or/and storage clauses.
    SY.

  • Help with query rewrite and materialized views

    Hello everybody,
    I'm currently learning how to use Oracle (10G Enterprise) and in particular, Materialized Views.
    I seem to have a problem making the optimizer use a materialized view. I have already set the OPTIMIZER_MODE, QUERY_REWRITE_ENABLED and QUERY_REWRITE_INTEGRITY as needed.
    I need to create a materialized view for the following query:
    Q1:
    SELECT PS_SUPPKEY, PS_PARTKEY, PS_SUPPCOST
    FROM PARTSUPPLIER E, PART WHERE PS_PARTKEY=P_PARTKEY and (lower(P_COMMENT) LIKE ''_o_a\%'' or lower(P_COMMENT) LIKE ''_o_u\%'')
    and PS_SUPPCOST =
    (SELECT min( PS_SUPPCOST)
    FROM PARTSUPPLIER I
    WHERE E.PS_PARTKEY=I.PS_PARTKEY)'
    I created it using the following code:
    CREATE MATERIALIZED VIEW mv_q1
    ENABLE QUERY REWRITE
    AS SELECT PS_SUPPKEY, PS_PARTKEY, PS_SUPPCOST
    FROM PARTSUPPLIER E JOIN PART ON (PS_PARTKEY=P_PARTKEY)
    WHERE lower(P_COMMENT) LIKE '_o_a%' or lower(P_COMMENT) LIKE '_o_u%'
    and PS_SUPPCOST=
    (SELECT min( PS_SUPPCOST)
    FROM PARTSUPPLIER I
    WHERE E.PS_PARTKEY=I.PS_PARTKEY);
    I have created the statistics using:
    execute dbms_stats.gather_table_stats('frandres',' mv_q1');
    execute dbms_stats.gather_table_stats('frandres','PARTSUPPLIER');
    execute dbms_stats.gather_table_stats('frandres','PART');
    Both partsupplier and part are tables and not views.
    When executing Q1, the plan does not use the materialized view. Furthermore, when using explain rewrite:
    DECLARE
    qrytxt VARCHAR2(3000) := 'SELECT PS_SUPPKEY, PS_PARTKEY, PS_SUPPCOST
    FROM PARTSUPPLIER E, PART WHERE PS_PARTKEY=P_PARTKEY and (lower(P_COMMENT) LIKE ''_o_a\%'' or lower(P_COMMENT) LIKE ''_o_u\%'')
    and PS_SUPPCOST =
    (SELECT min( PS_SUPPCOST)
    FROM PARTSUPPLIER I
    WHERE E.PS_PARTKEY=I.PS_PARTKEY)';
    BEGIN
    dbms_mview.EXPLAIN_REWRITE
    (qrytxt,'MV_Q1','MV_Q1');
    END;
    I get the following message:
    MESSAGE
    QSM-01150: query did not rewrite
    QSM-01263: query rewrite not possible when query references a dictionary table o
    r view
    QSM-01219: no suitable materialized view found to rewrite this query
    What I can't understand is why it says I am referencing the dictionary or a view?
    If I remove the (lower(P_COMMENT) LIKE ''_o_a\%'' or lower(P_COMMENT) LIKE ''_o_u\%'') condition to the query (using the same materialized view), I get the following message from EXPLAIN_REWRITE:
    MESSAGE
    QSM-01150: query did not rewrite
    QSM-01219: no suitable materialized view found to rewrite this query
    Which is reasonable.
    I don't know if the like condition is messing up my materialized view. Can anyone please help?
    Thanks a lot in advance.
    Edited by: user12072111 on Oct 29, 2009 9:43 PM

    Bingo!
    The 10.2.0.3 patch set is supposed to fix this ( [List of bugs fixed (MVs)|http://www.dbatools.net/doc/bug10203.html#MVIEW] )
    In particular:
    5052568      Query rewrite does not work for SQL with LIKE clause.
    Thank you very much for your message!
    The downside is that I'm only using Oracle for educational purposes and consequently have no Metalink id, so I can't install the patch. Thanks a lot though!

  • Materialized Views appear twice - under MV and under tables

    Hi,
    I've encountered a wierd issue.
    It seems that every materialized view is also appearing under the tables tab.
    For example sh.cal_month_sales_mv. Another example, run this as sh:
    CREATE MATERIALIZED VIEW SH.OFIR_MV
    REFRESH FORCE ON DEMAND
    ENABLE QUERY REWRITE
    AS SELECT sum(s.amount_sold) AS dollars
    FROM sales s;
    You'll see a table OFIR_MV under the table tab. If you try to drop it(right-click-> table-> drop), you get ora-12083 must use DROP MATERIALIZED VIEW to drop "SH"."OFIR_MV"
    Also, SQL tab of the "table" has the folowing remark
    -- DBMS_METADATA was unable to use TABLE_EXPORT to generate sql. Now trying to use TABLE
    I guess this is the source of the issue:
    select object_name,object_type from user_objects where object_name = 'OFIR_MV';
    OBJECT_NAME OBJECT_TYPE
    OFIR_MV TABLE
    OFIR_MV MATERIALIZED VIEW
    2 rows selected
    So, creating a MV also adds a table to user_objects/tables. (Huh? that suprised me)
    Could SQL Dev filter these fake tables or at least have a different icon/color for them?
    Thanks.
    Ofir
    BTW - Win XP, 10.2.0.3EE, SQL Dev 1.1.1.25.14

    e.g Re: Materialized Views, indexes and Raptor Eeerrr... no.
    That user wanted to be able to access indexes, etc., which he thought could be easily accomplished by adding the MV to the tables node.
    To what the response was: the options on the MV will be improved (which it has), NOT bringing it in the tables node. As Ofir also pointed out, there's a reason for it not belonging there: the operations performed on the objects of the table node expect tables, not MVs.
    So, between fixing the tables node for accepting MVs and it's operations, and just removing the MVs from the node, I'd go for the second, faster, more correct solution.
    K.

  • Materialized Views and Substr ?

    Hi,
    I'm currently trying to create a materialized view that can be fast refreshed, but it complains each time. I think it's because I'm using a constraint substr(x,1,10) so complete refreshes are all that can be done?
    My steps are :
    create materialized view log on a_table with rowid;
    create materialized view log on b_table with rowid;
    create materialized view log on c_table with rowid;
    create materialized view log on d_table with rowid;
    and the materialized view is
    create materialized view MY_VIEW
    build immediate
    enable query rewrite
    REFRESH FAST
    as
    SELECT bt.mid AS mid, ct.imid AS imid, bt.iid AS iid, vendor_name AS make, at.dname AS dname, bt.timestamp AS timestamp
              FROM b_table bt, c_table ct, d_table dt, a_table at
                   WHERE bt.mid=ct.mid
                        AND substr(bt.iid,1,5)=dt.val1
                        AND at.profile_id=dt.profile_id
              order by bt.timestamp desc;
    ORA-12052: cannot fast refresh materialized view MY_VIEW
    I'm at a loss, I can make it without the fast refresh, but the table view is huge and updating it completely each time isn't going to work :(
    Any help or suggestions would be greatly appreciated,
    Regards,
    Brian

    Well, basically, you can relatively easily find it out yourself.
    First, there is a very useful script $ORACLE_HOME/rdbms/admin/utlxmv.sql
    You should execute under the same account as you create materialized views like this
    @?/rdbms/admin/utlxmvThen you are prepared to check, whether your mv is fast refresheable and if not - why.
    SQL> create table new_dept as select * from dept
      2  /
    Table created.
    SQL> -- Now create table emp with new join column of type varchar2
    SQL> create table new_emp as
      2  select e.*,d.dname
      3  from emp e,dept d
      4  where e.deptno=d.deptno
      5  /
    Table created.
    SQL> create materialized view log on new_emp with rowid
      2  /
    Materialized view log created.
    SQL> create materialized view log on new_dept with rowid
      2  /
    Materialized view log created.
    SQL> begin
      2          dbms_mview.explain_mview('select e.*,d.loc
      3                  from new_emp e,new_dept d
      4                  where substr(d.dname,1,10)=e.dname');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select capability_name,possible,msgtxt
      2  from  mv_capabilities_table
      3  where capability_name like '%FAST%'
      4  /
    CAPABILITY_NAME                PO MSGTXT
    REFRESH_FAST                   N
    REFRESH_FAST_AFTER_INSERT      N  the SELECT list does not have the rowids
                                       of all the detail tables
    REFRESH_FAST_AFTER_ONETAB_DML  N  see the reason why REFRESH_FAST_AFTER_IN
                                      SERT is disabled
    REFRESH_FAST_AFTER_ANY_DML     N  see the reason why REFRESH_FAST_AFTER_ON
                                      ETAB_DML is disabled
    REFRESH_FAST_PCT               N  PCT is not possible on any of the detail
                                       tables in the materialized view
    SQL> rollback
      2  /
    Rollback complete.
    SQL> -- Now we know - for materialized view rowid of all involved in join tables
    SQL> -- should be in the select list to make possible fast refresh
    SQL> -- of course they should get proper aliases. Yet one attempt
    SQL> begin
      2    dbms_mview.explain_mview('select e.*,e.rowid erow_id,d.loc,d.rowid drow_id
      3      from new_emp e,new_dept d
      4      where substr(d.dname,1,10)=e.dname');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select capability_name,possible,msgtxt
      2  from  mv_capabilities_table
      3  where capability_name like '%FAST%'
      4  /
    CAPABILITY_NAME                PO MSGTXT
    REFRESH_FAST                   Y
    REFRESH_FAST_AFTER_INSERT      Y
    REFRESH_FAST_AFTER_ONETAB_DML  Y
    REFRESH_FAST_AFTER_ANY_DML     Y
    REFRESH_FAST_PCT               N  PCT is not possible on any of the detail
                                       tables in the materialized view
    SQL> -- Mission successful - refresh_fast is possibleBest regards
    Maxim

  • Oracle equals_path condition NOT working with table and materialized view

    The user i am using is xdb with dba role.
    1.When i try to use the statement
    SELECT PATH FROM xdb.path_VIEW
    WHERE
    EQUALS_PATH(res, '/home/OE/PurchaseOrders/2002')=1
    the result is
    /home/OE/PurchaseOrders/2002
    2. When i drop the path_view and recreated it like materialized view with statement
    create MATERIALIZED view path_view as
    select /*+ ORDERED */ t2.path path, t.res res,
    xmltype.createxml(xdb.xdb_link_type(NULL, r2.xmldata.dispname, t.name,
    h.name, h.flags, h.parent_oid, h.child_oid),
    'http://xmlns.oracle.com/xdb/XDBStandard.xsd', 'LINK') link,
    t.resid
    from ( select xdb.all_path(9999) paths, value(p) res, p.sys_nc_oid$ resid,
    p.xmldata.dispname name
    from xdb.xdb$resource p
    where xdb.under_path(value(p), '/', 9999)=1 ) t,
    TABLE( cast (t.paths as xdb.path_array) ) t2,
    xdb.xdb$h_link h, xdb.xdb$resource r2
    where t2.parent_oid = h.parent_oid and t2.childname = h.name and
    t2.parent_oid = r2.sys_nc_oid$
    then the equals_path condition STOP working !!!
    3. The same experiment, but i recreate it like table
    create table path_view as .... using the rest of the statement ...
    Can someone help me to understand why equals_path is NOT working on table and materialized view !

    Thanks Jonah. I was under the impression that I already had it but seems like it has to be a direct priv - thru a role doesn't work.
    I granted the reqd privs and then it worked fine. Thx for your help!

Maybe you are looking for

  • There is no iView available for system "SAP_ERP_Manufacturing"...

    Hi out there, I have imported the business packages Common Parts 1.2 and Maintenance Technician 1.2 in our portal testsystem (nw7, sps18). after setting up a system with alias SAP_ECC_MANUFACTURING and asigning the role com.sap.pct.erp.maintech.maint

  • Several Standard functions are not working properly in CRM Web

    We are working on different ABAP developments embedded on a Web environment, and we are facing some issues with different standard functions. This functions such as GUI_DOWNLOAD, GUI_UPLOAD, MS_EXCEL_OLE_STANDARD_DAT, POPUP_TO_CONFIRM which are used

  • Driver needed for ideaTab A2107A

    Hello, in Germany a 7'' Tablet from Lenovo is avaliable, the ideaTab A2107A! I need a driver for this Item to use the Google-Tools to update the operating - system! Does anyboby here know, where to find this driver? Thank you for your fast reply!

  • Problem with the display sequence of free characteristics in Bex Analyzer

    Hello, I want to display free characteristics in particular sequence in Bex Analyzer. I have arranged free characteristics in particular sequence in bex designer but while executing the report from analyzer free characteristics are not getting displa

  • How to display Adobe Interactive Form from ABAP (not WDABAP)

    I have created a WD ABAP application that creates an Adobe Interactive Form (ZCI) and submits it for workflow.  All of the data on the form is saved in custom itables in the SAP System.  The end-users are supposed to save a copy of the form at the la