Index On Materialized View

I have created a materialized view that involves joining 4 tables for diferent where conditions. How can I create index on this materialized view.
Thanks

Yes, but it is done automatically:
SQL> create materialized view emp_dept_mv
  2  as
  3  select e.empno
  4       , e.ename
  5       , e.sal
  6       , d.deptno
  7       , d.dname
  8    from emp e
  9       , dept d
10   where e.deptno (+) = d.deptno
11  /
Gematerialiseerde view is aangemaakt.
SQL> create index i1 on emp_dept_mv (deptno)
  2  /
Index is aangemaakt.
SQL> exec dbms_stats.gather_table_stats(user,'emp_dept_mv',cascade=>true)
PL/SQL-procedure is geslaagd.
SQL> set autotrace on explain
SQL> select * from emp_dept_mv where deptno = 40
  2  /
     EMPNO ENAME             SAL     DEPTNO DNAME
                                         40 OPERATIONS
1 rij is geselecteerd.
Uitvoeringspan
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=4 Bytes=96)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'EMP_DEPT_MV' (Cost=2 Card=4 Bytes=96)
   2    1     INDEX (RANGE SCAN) OF 'I1' (NON-UNIQUE) (Cost=2 Card=4)
SQL> set autotrace off
SQL> insert into dept (deptno, dname) values (50, 'EXTRA DEPT')
  2  /
1 rij is aangemaakt.
SQL> exec dbms_mview.refresh('emp_dept_mv')
PL/SQL-procedure is geslaagd.
SQL> set autotrace on explain
SQL> select * from emp_dept_mv where deptno = 50
  2  /
     EMPNO ENAME             SAL     DEPTNO DNAME
                                         50 EXTRA DEPT
1 rij is geselecteerd.
Uitvoeringspan
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=4 Bytes=96)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'EMP_DEPT_MV' (Cost=2 Card=4 Bytes=96)
   2    1     INDEX (RANGE SCAN) OF 'I1' (NON-UNIQUE) (Cost=2 Card=4)Regards,
Rob.

Similar Messages

  • Index organized Materialized View in SQL Developer Datamodeler

    Hello SQL Developer Datamodeler Team,
    I'm using version 4.0.2.840 and looking for a how-to to change a MV to an IOMV.
    So far I do the following:
    Create Table in Relational Model
    Create MV in Oracle 11g Physical Model
    Double Click Table in Oracle 11g Physical Model
    Set "Implement as MV" to my MV
    OK
    Now I can't find an option for index organized in Physical Model Materialized View properties.
    The setting "Organization: Head/Index" for Physical Model MV-Basetable properties does not change the generated DDL.
    Also, setting this to "Index" does not enable the window's "IOT Properties"-tab (like it does for normal tables).
    Is it possible to create an Index organized Materialized View in current SQL Developer Datamodeler?
    Thank you & Best regards,
    Blama

    Hi Blama,
    DDL for Index-organized Materialized Views is generated in the Early Adopter release 4.1.0.866, which is now available for download.
    The Organization on the Table that is implemented as the Materialized View should be set to INDEX, and the Table's IOT properties will be used during DDL generation.
    David

  • Can I create index on Materialized view log

    Hello
    The ADDM suggest me to create index on some fields of my materialized view log , I don't know does it cause any problem ? Is it safe ? have you done it before ?
    thanks

    Actually you can do it since materialized view log is in fact a table.
    SQL> create table t(x int primary key);
    Table created.
    SQL> create materialized view log  on t;
    Materialized view log created.
    SQL> select segment_name, segment_type from user_segments;
    SEGMENT_NAME
    SEGMENT_TYPE
    MLOG$_T
    TABLE
    T
    TABLE
    SYS_C004857
    INDEX
    SQL> desc mlog$_t;
    Name                                      Null?    Type
    X                                                  NUMBER
    SNAPTIME$$                                         DATE
    DMLTYPE$$                                          VARCHAR2(1)
    OLD_NEW$$                                          VARCHAR2(1)
    CHANGE_VECTOR$$                                    RAW(255)
    SQL> create index i on mlog$_t(x);
    Index created.However I don't know if this is really supported and makes sense.

  • Oracle Text Index on Materialized View

    Hello,
    I have designed a search engine for an internet application.
    We have different tables for our main business objects, the search is based on the content of all these dependent entities (Product, Company etc...)
    So I have created a materialized view to embody this aggregation.
    Then I have created a Multi column datastore index on top of the snapshot.
    The search engine has to be refreshed automatically 3 times a day, and manually anytime.
    This is achieved by executing a complete refresh on the view and rebuild the index, programmatically via Toplink (SqlCall).
    The MV refresh looks like this :
    alter index usr_batiprod.fullTextMulticolIdx rebuild
    and the index rebuild:
    begin
    DBMS_MVIEW.REFRESH('FT_TEST','C');
    end;
    Everything was fine until now, we have had lots of tuning on the index side, the refresh process was working fine...
    We have let the users access the engine since Thursday (the index had been created on the production environment a fews weeks ago) and since yesterday (or maybe before) we have been experiencing data incoherency on the index...
    I've tracked down the pb to the Fulltext Search's refresh process (manual and automatic share the same code) that was crashing on the Materialized view refresh :
    java.sql.SQLException: ORA-20000: Oracle Text error:
    DRG-50610: internal error: drexdsync
    DRG-50857: oracle error in drekrtd (lob erase)
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 794
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 851
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 832
    ORA-06512: at line 2
    Again, we had tested the functionality thoroughly and never experienced such behaviour before... even while refreshing the materialized view and the index 3 times (or more) a day..
    Once I dropped the Oracle Text Index, I was able to refresh the MV again..
    so it looks like the index was in some incoherent state and was holding a lock on the materialized view...
    Maybe my Index refresh call is wrong, and a stronger load on the functionality leads quickly to this pb, I dont know..
    I had always been a bit doubtful towards my index rebuild call, so Im thinking about using a more complete call :
    alter index usr_batiprod.fullTextMulticolIdx rebuild parameters ('sync')
    is it enough, or do I have to switch to a 'Oracle Text' specific call ?
    Is there another possible reason for the MV lock ?
    Thank you for your support
    Best Regards
    Olivier Cuzacq

    MVs are constructed in different ways and have lots of different uses.
    Why not just use MV as temp table for OT (Oracle Text) index?
    Refresh MV OT_TEMP.
    Delete all not matching rows from OT.
    Insert all missing missing rows from OT_TEMP to OT.
    sync OT index (online).
    Query table OT.

  • How to create a Complex Organization Index  Materialized View Example

    Hi
    I have a 11g database that I'm trying to create a complex Materialized View that I would like to make Organization Index? How do I specify what I want for a primary Key?
    CREATE MATERIALIZED VIEW RCS_STG.MV_NEXT_HOP_iot
    ORGANIZATION INDEX
    AS
    SELECT r2.resource_key, r1.resource_key resource_key2, r2.resource_full_path_name, device_name, device_model,
    service_telephone_number, service_package_name, telephone_number.telephone_number_key, c1.created_on
    FROM network_resource PARTITION (network_resource_subinterface) r1,
    connection c1,
    network_resource PARTITION (network_resource_subinterface) r2,
    device d1,
    tn_network_resource,
    telephone_number
    WHERE r1.resource_key = c1.resource1_key
    AND c1.resource2_key = r2.resource_key
    AND d1.device_key = r2.device_key
    AND tn_network_resource.resource_key(+) = r2.resource_key
    AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
    UNION ALL
    SELECT r1.resource_key, r2.resource_key resource_key2, r1.resource_full_path_name, device_name, device_model,
    service_telephone_number, service_package_name, telephone_number.telephone_number_key, c1.created_on
    FROM network_resource PARTITION (network_resource_subinterface) r1,
    connection c1,
    network_resource PARTITION (network_resource_subinterface) r2,
    device d1,
    tn_network_resource,
    telephone_number
    WHERE r1.resource_key = c1.resource1_key
    AND c1.resource2_key = r2.resource_key
    AND d1.device_key = r1.device_key
    AND tn_network_resource.resource_key(+) = r1.resource_key
    AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
    I get an error message ORA-25175: no PRIMARY KEY constraint found
    I would like to specify resource_key, resource_key2, and service_telephone_number as my primary key?

    Ah,
    I get it now. This is what I did.
    CREATE TABLE mv_next_hop_iot
    resource_key NUMBER (38),
    resource_key2 NUMBER (38),
    resource_full_path_name VARCHAR2 (256 BYTE),
    device_name VARCHAR2 (64 BYTE),
    device_model VARCHAR2 (64 BYTE),
    service_telephone_number VARCHAR2 (20 BYTE),
    service_package_name VARCHAR2 (64 BYTE),
    telephone_number_key NUMBER (38),
    created_on DATE,
    CONSTRAINT mv_next_hop_pk PRIMARY KEY (resource_key, resource_key2, service_telephone_number)
    ORGANIZATION INDEX
    CREATE MATERIALIZED VIEW rcs_stg.mv_next_hop_iot
    ON PREBUILT TABLE
    AS
    /* Formatted on 2010/06/10 1:39:04 PM (QP5 v5.149.1003.31008) */
    SELECT resource_key, resource_key2, resource_full_path_name, device_name, device_model, service_telephone_number,
    service_package_name, telephone_number_key, created_on
    FROM (SELECT r2.resource_key, r1.resource_key resource_key2, r2.resource_full_path_name, device_name, device_model,
    NVL (service_telephone_number, ' ') AS service_telephone_number, service_package_name,
    telephone_number.telephone_number_key, c1.created_on
    FROM network_resource PARTITION (network_resource_subinterface) r1,
    connection c1,
    network_resource PARTITION (network_resource_subinterface) r2,
    device d1,
    tn_network_resource,
    telephone_number
    WHERE r1.resource_key = c1.resource1_key
    AND c1.resource2_key = r2.resource_key
    AND d1.device_key = r2.device_key
    AND tn_network_resource.resource_key(+) = r2.resource_key
    AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key
    UNION ALL
    SELECT r1.resource_key, r2.resource_key resource_key2, r1.resource_full_path_name, device_name, device_model,
    NVL (service_telephone_number, ' ') AS service_telephone_number, service_package_name,
    telephone_number.telephone_number_key, c1.created_on
    FROM network_resource PARTITION (network_resource_subinterface) r1,
    connection c1,
    network_resource PARTITION (network_resource_subinterface) r2,
    device d1,
    tn_network_resource,
    telephone_number
    WHERE r1.resource_key = c1.resource1_key
    AND c1.resource2_key = r2.resource_key
    AND d1.device_key = r1.device_key
    AND tn_network_resource.resource_key(+) = r1.resource_key
    AND telephone_number.telephone_number_key(+) = tn_network_resource.telephone_number_key)
    Many thanks. the PREBUILT TABLE is the secret.

  • Oracle materialized view + spatial index

    Hello,
    i faced with problem when i create spatial index on materialized view.
    I create materialized view on 2 table which contains spatial geometrys.
    create materialized view mv_geom as
    select g.nid, g.geometry
    from geom1
    union all
    select select g.nid, g.geometry
    from geom2
    i created spatial index - all works fine, but when i try to drop table, i get exception "ORA-04020"...
    Materialized view become invalid but don't drop from database.
    SQL> drop materialized view mv_geom;
    Materialized view dropped
    But object does not drop
    select * from all_objects z where z.OBJECT_NAME = 'geom1'
    and z.OBJECT_TYPE ='MATERIALIZED VIEW'
    Any ideas?
    Thank's for help!

    I don't quite follow you. Do you mean that after you dropped mv "mv_geom".
    you expect that the base table "geom1" should be dropped?

  • Way to add an additional column that acts as a PK in a Materialized View?

    I want to create a materialized view that also has an index column. A unique number sequence assigned to each record. Is this even possible? Can a materialized view do this, and would the indexes stay the same on a refresh?
    Any help would be greatly appreciated.

    Materialized views are copies of data or aggregations. They can be used to replicate all or part of a table, or to replicate the result of a query against multiple tables. The big advantage they have is that unlike a standard view, which can return the same data, you can index the materialized view to improve performance. These indexes will be maintained and updated during the refresh process.
    Refer to Metalink document: 76673.1 or the Oracle Concepts manual for more information.

  • Problem refreshing Materialized View in SQL Developer

    I have a database schema with a Materialized View (MV) that updates a products table shown on a website. This schema was recently imported to an 11g database from 8i, but since this import I have been unable to refresh my schema’s Materialized View.
    The MV_PRODUCT_MASTER Materialized View attaches price data to product data that is stored in a normal WEB_PRODUCT table, and create an MV table as a result. The output MV table is what the website pulls data from to display to the site users. Since it is an MV table, this table cannot be edited directly. In order to change, say, a product description, I need to alter the description field in WEB_PRODUCT and manually refresh the MV_PRODUCT_MASTER table. Only through the refresh will the upstream edits appear in the MV_PRODUCT_MASTER table and be visible on the website.
    In my old 7.6.0.11 copy of TOAD, I could manually refresh these MVs easily, by opening the “Snapshots” tab, right clicking on the MV I wanted to refresh and selecting the “Refresh” option. Since the schema was imported to 11g, I have been using the Oracle SQLDeveloper tool to manage the schema. SQLDeveloper doesn’t have a clear method for manually refreshing an MV, or else the method I am using isn’t working.
    If I right click on the MV_PRODUCT_MASTER Materialized View object, and choose “Other Actions”, I see the following choices:
    Shrink Materialized View
    Compile Materialized View
    Force Materialized View Refresh
    Rebuild Materialized View
    …I assumed that “Force Materialized View Refresh” was the right choice, and chose that. This option displays the SQL:
    alter materialized view "WEBADMIN"."MV_PRODUCT_MASTER" consider fresh
    When I apply this, I get the message: “Materialized view “MV_PRODUCT_MASTER” has been set torefreshed”. However, no changes appear in the MV output table. i.e. if I make a specific change to a row in the WEB_PRODUCT table, the change is not being carried into the MV_PRODUCT_MASTER table, so that indicated that the refresh is not actually happening. The MV table appears to believe it is being refreshed:
    REWRITE_CAPABILITY     GENERAL
    REFRESH_MODE     DEMAND
    REFRESH_METHOD     COMPLETE
    BUILD_MODE     IMMEDIATE
    FAST_REFRESHABLE     NO
    LAST_REFRESH_TYPE     COMPLETE
    LAST_REFRESH_DATE     06-APR-10
    STALENESS     UNKNOWN
    …but it isn’t showing any changes.
    What am I doing wrong? Is there a plain SQL statement I can run in order to run these refreshes, instead of using the SQLDeveloper GUI? Thanks for any advice on this.

    Hi Blama,
    DDL for Index-organized Materialized Views is generated in the Early Adopter release 4.1.0.866, which is now available for download.
    The Organization on the Table that is implemented as the Materialized View should be set to INDEX, and the Table's IOT properties will be used during DDL generation.
    David

  • CONTAINS problem in materialized view

    SELECT SCORE(1) AS RELEVANCE, AST_OID, TOTAL
    FROM asset_materialized_vw
    WHERE CONTAINS(total, '%PRODUCT%', 1) > 0
    ORDER BY RELEVANCE DESC;
    The table in the FROM clause, asset_materialized_vw is a materialized view of a view called asset_vw with a complex query in it, it produces 2 columns, 1 ast_oid, which contains a unique id, and total which is a varchar2 column on which I put a CTXSYS.CONTEXT index, after putting the index on this column, I can execute the above query and it results many rows, but after about 5 - 10 minutes it doesn't return any rows at all anymore. Here is the script I used to create the index and materialized view:
    The view:
    SELECT * FROM asset_materialized_vw WHERE upper(total) LIKE '%N4S%'
    DROP MATERIALIZED VIEW mv_emp_pk
    CREATE MATERIALIZED VIEW asset_materialized_vw
         REFRESH COMPLETE
         NEXT SYSDATE + 1/96
         WITH PRIMARY KEY
         AS
         SELECT AST_OID,
              CONCAT(ASSET_REMARK, CONCAT(OBJECT_REFERENCE, CONCAT(PRJ_PROJECT_NAME, CONCAT(DV_REFERENCE_VALUE, CONCAT(LD_NAME_B, CONCAT(LD_NAME_A, CONCAT(DVL_DESCRIPTION, CONCAT(MDV_TEXT_VALUE, CONCAT(BUT_DVL_DESCRIPTION, CONCAT(MAG_DVL_DESCRIPTION, CONCAT(AGP_DVL_DESCRIPTION, CONCAT(BRC_DVL_DESCRIPTION, CONCAT(CAM_DVL_DESCRIPTION, CONCAT(PRS_NAME, PRD_PROPERTIES)))))))))))))) AS TOTAL
         FROM ASSET_VW
    The index:
    CREATE INDEX idx_asset_materialized_vw ON asset_materialized_vw(total)
    INDEXTYPE IS CTXSYS.CONTEXT

    Simple testcase to reproduce your issue:
    /* snapshot refreshes every 15 seconds */
    SQL> CREATE MATERIALIZED VIEW emp_mv
    REFRESH COMPLETE
    NEXT SYSDATE + 15/(24*60*60)
    AS
    SELECT * FROM emp
    Snapshot created.
    /* Context index */
    SQL> CREATE INDEX emp_txt_idx ON emp_mv
    (ename)
    INDEXTYPE IS ctxsys.CONTEXT
    Index created.
    SQL> SELECT ename,
           deptno
      FROM emp_mv
    WHERE contains (ename, 'scott') > 1
    ENAME          DEPTNO
    SCOTT              20
    /* wait 20 seconds*/
    SQL> EXEC dbms_lock.sleep(20)
    PL/SQL procedure successfully completed.
    SQL> SELECT *
      FROM emp_mv
    WHERE contains (ename, 'scott') > 1
    "no rows selected."
    /* sync the index */
    SQL> BEGIN
       ctx_ddl.sync_index ('emp_txt_idx');
    END;
    SQL> SELECT ename,
           deptno
      FROM emp_mv
    WHERE contains (ename, 'scott') > 1
    ENAME          DEPTNO
    SCOTT              20I would alter the generated job (from creation of materialized view) to append the sync of the index:
    BEGIN
      SYS.DBMS_JOB.CHANGE
          job        => 325634 /*  your job number */
         ,what       => 'dbms_refresh.refresh(''"EMP_MV"'');
                         ctx_ddl.sync_index (''emp_txt_idx'');'
         ,next_date  => sysdate
         ,interval   => 'SYSDATE + 15/(24*60*60) '
    END;

  • Oracle - Query taking too long (Materialized view)

    Hi,
    I am extracting billing informaiton and storing in 3 different tables... in order to show total billing (80 to 90 columns, 1 million rows per month), I've used a materialized view... I do not have indexes on 3 billing tables - do have 3 indexes on Materialized view...
    at the moment it's taking too long to query the data (running a query via toad fails and shows "Out of Memory" error message; runing a query via APEX though is providing results but taking way too long)...
    Please advice how to make the query efficient...

    tparvaiz,
    Is it possible when building your materialized view to summarize and consolidate the data?
    Out of a million rows, what would your typical user do with that amount data if they could retrieve it readily? The answer to this question may indicate if and how to summarize the data within the materialized view.
    Jeff
    Edited by: jwellsnh on Mar 25, 2010 7:02 AM

  • Materialized view is not taking the Index

    Hi Friends,
      I have a materialized View for my Sales Details.  I created a view on the Materialized View and using in my report. The Performance is very slow. After little research,
    I found that the indexes are not used when the MV is accessed in the SQL.  I tried explain plan for a very simple query on the view to prove that.
    Here is my simple query.
    select month_num ,sum(qty) from v_mv_sales_table
    where month_num=201301
    by month_num;
    When I checked for count() it is considering the index and performance is good.
    select month_num ,count(*) from v_mv_sales_table
    where month_num=201301
    by month_num;
           Then I tried using hint for forcing the index. That time also it is working only for count not for SUM.
    select   /* +INDEX(tr, IDX2_MV_SALES_TABLE) */  month_num,count(*)
    v_mv_sales_table tr
    month_num=201301
    by month_num;
    Is there any way , I can force my sql to use the index on the month_num column?.
    I have a question about using hint to force the sql.
    My Question is  I have indexes on my Materialized View. But I am using the hint on my view based on the Mat View.
    Will it be okay to use like that?.
    You may ask why I am using View instead of using Mat View directly. At later stage we are planning to apply some user level restrictions to the data
    by linking the view to some other tables/view. So I am forced to use the View instead of MV.
    Any ideas or suggestions will be good
    Thanks in advance,
    Vimal....

    here's an example
    SQL> set autot off
    SQL>
    SQL> create table t
      2  (dt date)
      3  /
    Table created.
    SQL>
    SQL> insert into t
      2  select trunc (sysdate) + rownum
      3    from all_objects
      4  /
    25707 rows created.
    SQL>
    SQL>
    SQL> create index tidx on t (trunc (dt))
      2  /
    Index created.
    SQL>
    SQL> begin
      2     dbms_stats.gather_table_stats (user, 'T');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL> set autot trace expl
    SQL> select *
      2    from t
      3   where dt = to_date ('24-07-2009', 'dd-mm-yyyy')
      4  /
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=8)
       1    0   TABLE ACCESS (FULL) OF 'T' (Cost=6 Card=1 Bytes=8)
    SQL>
    SQL> select *
      2    from t
      3   where dt = trunc (sysdate)
      4  /
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=8)
       1    0   TABLE ACCESS (FULL) OF 'T' (Cost=6 Card=1 Bytes=8)
    SQL>
    SQL> select *
      2    from t
      3   where trunc (dt) = trunc (sysdate)
      4  /
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=8)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'T' (Cost=2 Card=1 Bytes=
              8)
       2    1     INDEX (RANGE SCAN) OF 'TIDX' (NON-UNIQUE) (Cost=1 Card=1
    SQL>
    SQL>
    SQL> drop table t
      2  /
    Table dropped.
    SQL>

  • How to add an index to a materialized view in Data Modeler 3.3

    Hello everyone,
    I'm looking for a how-to to add an index to a materialized view in Data Modeler 3.3.0.747, as I coudn't find a way to do it so far.
    I looked here:
    Relational Model
    Physical Model
    Oracle 11g
    Materialized Views
    "my_mv_name"
    "INDEXES" IS NOT HERE IN THE TREE
    "Tables" does not include it either
    Thank you & Best regards,
    Blama

    Hi David,
    thanks a lot. I did so and it worked, but I found a minor bug while doing so:
    I marked the table as "Implement as Materialized View" and went to File->Export->DDL (for Oracle 11g).
    The generated code (I checked all options in "Drop Selection") includes a row:
    DROP MATERIALIZED VIEW mv_mymatview CASCADE CONSTRAINTS ;
    which produces a syntax error.
    Best regards,
    Blama

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

  • Materialized views - schedule, indexes, query rewrite, etc.

    I'm trying to get the hang of materialized views and need some help . . .
    running Oracle 10gR2
    I created a materialized view as follows:
    CREATE MATERIALIZED VIEW "MY_SCHEMA"."USERS"
    AS
    SELECT * FROM "USERS"@PRODUCTION -- to copy the USERS table from my production database to this database
    Worked fine. So far so good. Then, I altered it to schedule the refresh:
    ALTER MATERIALIZED VIEW "MY_SCHEMA"."USERS" REFRESH FORCE START WITH SYSDATE NEXT TRUNC(SYSDATE + 1) + 4/24
    -- to schedule a refresh immediately (SYSDATE) and every morning thereafter at 4:00 am (I think)
    then, I wanted to enable query rewrite, so I issued the following command:
    ALTER MATERIALIZED VIEW "MY_SCHEMA"."USERS" ENABLE QUERY REWRITE;
    and I got the
    ALTER MATERIALIZED VIEW succeeded.
    message for both of those commands (I'm doing this in SQL Developer).
    Then, I edit the materialized view in SQL Developer, click on the 'SQL' tab, and get the following:
    CREATE MATERIALIZED VIEW "MY_SCHEMA"."USERS"
    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 "TBLSPC_PHIGH"
    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 "TBLSPC_PHIGH"
    REFRESH FORCE ON DEMAND START WITH sysdate+0 NEXT TRUNC(SYSDATE + 1) + 4/24
    WITH PRIMARY KEY USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS SELECT "USERS"."User" "User","USERS"."Logon" "Logon","USERS"."Name" "Name","USERS"."Password"
    "Password","USERS"."Level" "Level","USERS"."Producer" "Producer","USERS"."Deleted" "Deleted","USERS"."ClaimDoctor"
    "ClaimDoctor","USERS"."UserType" "UserType","USERS"."Locked" "Locked","USERS"."Scheduler"
    "Scheduler","USERS"."RestrictDays" "RestrictDays","USERS"."First" "First","USERS"."DisableAutoChart"
    "DisableAutoChart","USERS"."MaxChartOut" "MaxChartOut","USERS"."MaxHoursOut" "MaxHoursOut","USERS"."EffDate"
    "EffDate","USERS"."ExpDate" "ExpDate","USERS"."SwipeLogon" "SwipeLogon","USERS"."SwipePassword"
    "SwipePassword","USERS"."PwdLastChanged" "PwdLastChanged","USERS"."Audit" "Audit","USERS"."IsInstructor"
    "IsInstructor" FROM "USERS"@PRODUCTION.REGRESS.RDBMS.DEV.US.ORACLE.COM "USERS";
    The problems I've encountered so far:
    1) I created this two days ago and changed the value of one column in one row in the 'source' USERS table
    (USERS@PRODUCTION) as a test case. So far, that change has not propagated over to my materialized view even though
    it has had two chances to do so (yesterday morning at 4:00 am and this morning at 4:00 am).
    2) I enabled QUERY REWRITE. Why does it still show DISABLE?
    3) The primary key of the table came over (as far as I can tell) because it shows in SQL Developer. However, the
    indexed columns are no longer indexed. Do I need to recreate those indexes manually and will they persist?
    4) As you have guessed, I have just taken the plunge into materialized views, and have not been able to find
    anything on the Web along the lines of 'Materialized Views for Dummies'. So, any and all advice/suggestions/help
    will be welcome.
    Thanks,
    Carl

    The Refresh would be executed by a job submitted in the background.
    Query USER_JOBS (or DBA_JOBS) to see if a job has been submitted and if it has been running (you'd be able to see LAST_DATE, LAST_SEC and NEXT_DATE and NEXT_SEC). \
    If the Refresh job has been failing the FAILURES count would be incremented. If there are 16 consecutive failures, the job is marked BROKEN. (if a job fails, Oracle retries it automatically and keeps retrying till it is BROKEN). If the job has been failing you would get messages in the database instance alert log file and trace files.
    If the Refresh job has not been running check the parameter value for JOB_QUEUE_PROCESSES -- a value of 0 would not run in jobs in the USER_JOBS/DBA_JOBS view. Ask the DBA to increase set this parameter to at least 1.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

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

Maybe you are looking for

  • Query SharePoint List View

    As per http://msdn.microsoft.com/en-us/library/ms434064.aspx if we use list.GetItems(query, view.ID.ToString("B").ToUpper()); properties of the view that is specified by the viewName parameter override the properties that are specified in the query o

  • Forcing ComboBox to lose its focus when isPopupVisible()==false

    Hi, I'm in a situation where I need to force my comboBox to lose its focus, in a case when user clicks the comboBox to pull down the popup but does not click any value inside the comboBox popup. In such a situation I need to force the comboBox to los

  • Error In Glassfish Server

    Error attempting to process extensions from the manifest of JAR file C:\sabonay\stchurch\stChurchEnterpriseApp\dist\gfdeploy\stChurchEnterpriseApp-ejb.jar; ignoring it and continuing java.io.FileNotFoundException: C:\sabonay\stchurch\stChurchEnterpri

  • Adobe error message?

    Is this an Adobe error message?   I am trying to update Amazon's MP3 player on a Windows 7 ASUS computer.  Somewhere in that chain someone has dropped the torch.  I have downloaded the Amazon update.  On Amazon's advice, based on my verbal descriptio

  • Raw support Canon EOS Mark III 1Ds

    It is April, and I have Leopard 10.5.2 Aperture 2.1 I still do not see support for CR3 files from Mark III 1Ds. I am dying after spending nearly $8000 for the camera body. Do I have to go back to Lightroom? Apple, please let me know when this going t