Droping Materialized View but preserve its local table - Oracle 9i

Hello gurus,

How a drop views, materialized in 9i but would preserve the table?

Thank you

How a drop views, materialized in 9i but would preserve the table?

Drop the MV will fall off the table unless the MV was created on a predefined table.

If you have allowed the PARALLEL option, you can use the EXCHANGE PARTITION to swap the MV segment for a work with AN empty partition table.

Then you can drop the MV and the (now empty) table.

Create a standard table, and then reuse the EXCHANGE PARTITION to swap in the work table data segment.

Tags: Database

Similar Questions

  • Refresh the Materialized View constructed from an external table commit?

    Is it possible to create a materialized with Refresh view on commit built from an external table?

    I think the answer is "no, because there is no way for the outer table report to the view materialized it has been changed," but I would like to be sure before I tell my client who has requested the opportunity to do this (or, Alternatively, to learn how Oracle hoops I have to cross in order to operate).

    I can create a Refresh on demand, it is not a question of not having the necessary permissions to create the materialized view itself.

    No, you can't. The outer table is not modified in a transactional way and there no materialized view logs, so there is no event to hang in and no delta to apply.

    However, you can use dbms_scheduler observer file that will ask for the presence of a file and load the data in a table or refresh a materialized view based on the external table.

    Justin

  • refresh the materialized view, but skip delete

    I have a main table named DATA with mview log created on this subject.

    DATA_MVIEW is created in the select * data.

    For some reason, I want to update DATA_MVIEW every hour, but to only UPDATE/INSERT, skip DELETE action.

    A way to achieve that is to write additional code:
    1 detect records looking into MLOG$ _DATA (Journal mview) worth $$ DMLTYPE is D.
    2. pull these records in a separate temporary table.
    3 Refresh DATA_MVIEW
    4. Insert the records from the temporary table in DATA_MVIEW.

    My question is "is there a better, simpler way to ignore DELETE them when updating MVIEW?

    Thank you very much and waiting for tips Rewards points!

    There is another convoluted option:
    1. create an ON DELETE trigger on the DATA table that copies each line removed in a shadow / historical table
    2 update the MV
    3. create a view (not a MV) which is a Union All of the table shadow history with the MV
    4 refer to this view when you want to that 'all', the MV lines when you want 'alone that does not exist' reference lines

    Of course, if your MV is equipped with filters (WHERE clause) that is defined as a subset of the DATA table, you must also check that the shadow/history table also applies the same filters so that it fits with the MV.

    Hemant K Collette

  • ALTER select materialized view

    Hello

    I need to change a select the materialized view in order to add two new columns. Someone there knows a way to change the materialized view, select without dropping?

    Kind regards
    Rogério

    Hello

    Yes you must delete and re-create the materialized view, but using the PREDEFINED TABLE option you can save time, you can avoid re-creating the underlying segment of the materialized view.

    Please, take a look at the following link:

    http://www.rampant-books.com/art_nanda_fast_regfresh_materialized_views.htm

    Hope this helps.
    Best regards
    Jean Valentine

  • Impact on performance at the addition of materialized view logs at the tables?

    I write a very complex query for a client of our database system transaction and this will require the creation of a materialized viewbecause, all attempts at development to make acceptable performance failed.

    I want to activate the fast refresh the MVIEW but I am confused about the consequences of the addition of the addition of materialized view logs to the base tables.

    Some tables are large and involved in a large number of transactions and I wonder if the INSERT/update performance will be seriously affected by the presence of a newspaper mview.

    Maybe it's a simple question, but I was unable to find an answer very clear in the literature.

    Thanks for all the answers!

    Chris Mills
    Biotechnology data management consultant

    There is an overload for the newspapers of the view materialized, a little less, but roughly on par with a trigger that writes to a table.

    If it is an OLTP system where you do a lot of low-value transactions, the general expenses percentage is probably not particularly great, something in the range of 5-10% maybe (although, of course, by running tests in the development environment would be desirable). If there are loads in bulk, the impact of the percentage could be higher.

    Justin

  • Materialized view and Table

    Dear friends,

    A quick question...

    If the name of the materialized view and table name is same truncate table data truncates too materialized view?

    Thanks /.

    kumar73 wrote:
    Dear friends,

    A quick question...

    If the name of the materialized view and table name is same truncate table data truncates too materialized view?

    Thanks /.

    If the materialized view is built on the table and the Table is truncated data will continue to reside in the MView as long as it is not refreshed.

    Once you refresh the MView, data must disappear.

    With MView and Table names even, does not affect.

  • Change the definition of the materialized view while maintaining access for users uninteruupted

    Hello

    We have a system report and the need to change the report definition mv access - like to do it without interruption.

    Is this possible?

    the sql behind mv was change picks up so column of another table.

    Have you heard but not used for dbms_redefinition tables

    Thank you

    It is built in the Oracle solution for this one, where you can edit the definition WITHOUT interruption. You can drop the materialized view existing with the clause "save table" and rebuilt the view materialized on 'predefined table'. I googled this example for you

    create materialized view mv1 as select dept , count(*) as cnt from scott.emp;

    We want to change the statement so that only dept more 5 will be calculated

    drop materialized view mv1 preserve table;
    

    Notice that PRESERVE TABLE clause - mv1 table is not droped - single layer mview.

    desc mv1
    

    now, we create the mview with a different query on top of the existing table

    create materialized view mv1 on prebuilt table as  select dept , count(*) as cnt from scott.emp where dept > 5;
    

    Notice that on prebuilt table the mview uses the existing object clause.

    exec dbms_mview.refresh_mview('mv1');
    

    http://StackOverflow.com/questions/18085894/redefine-MATERIALIZED-view-with-no-downtime

    http://Arup.blogspot.com/2009/01/ultra-fast-MV-alteration-using-prebuilt.html

  • question on the materialized view unregistered on the main site

    Hello

    you know how one knows, on the main site, on the existence of a materialized view another site referring to other tables to a primary site. It seems registration is not required.

    the site main orcl1: I have a table, and a materialized view log defined on A table.
    another site orcl2: have a link db orcl1 and rapid updatable view SCOTT materialized. A_MVW (create a materialized view A_MVW cool off quickly in select * from A@orcl1)

    on orcl1 I perform: exec DBMS_MVIEW. UNREGISTER_MVIEW (mviewowner = > 'SCOTT', mviewname = > mviewsite, 'A_MVW' = > 'ORCL2');
    so the materialized view seems to be correctly set aside (because it no longer appears in: select * from DBA_REGISTERED_MVIEWS ;))
    But, to my surprise, I can still perform refreshes fast on A_MVW, which also remove rows from the materialized view log. So how is site orcl1 always aware of the existence of the materialized view?

    It seems that, registered or not to the main site, a materialized view has the same... or is not? where is it stored, on the main site, information about materialized views (especially those of quickly updatable) as local tables reffer?

    Thank you

    See DocIDs 258634.1, 67371.1, 1031924.6
    on Oracle's Support website.

    Hemant K Collette

  • No rewrite of materialized view query

    Hello world

    I have a strange situation where I can't activate on a materialized view query rewriting, I try to create. I have all the privileges granted to me. I think I followed all the online instructions I found supportive query about rewrite, then someone could point out (I feel like it should be obvious) why I can't use the rewrite of the query?
    SQL> select * from v$version
      2  /
    
    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 - Production
    
    SQL> ALTER SYSTEM SET QUERY_REWRITE_ENABLED = TRUE;
    
    System altered.
    
    SQL> ALTER SYSTEM SET QUERY_REWRITE_INTEGRITY = STALE_TOLERATED;
    
    System altered.
    
    SQL> ALTER SYSTEM SET OPTIMIZER_MODE = ALL_ROWS;
    
    System altered.
    
    SQL> desc cef_record
     Name                                      Null?    Type
     ----------------------------------------- -------- -------------
    
     ID                                        NOT NULL NUMBER(38)
     EVENT_ID                                  NOT NULL NUMBER(38)
     CEF_DATE                                           VARCHAR2(20)
     HOST_NAME                                          VARCHAR2(25)
     CEF_VERSION                                        VARCHAR2(10)
     DEVICE_VENDOR                                      VARCHAR2(75)
     DEVICE_PRODUCT                                     VARCHAR2(75)
     DEVICE_VERSION                                     VARCHAR2(75)
     SIGNATURE_ID                                       VARCHAR2(75)
     CEF_NAME                                           VARCHAR2(700)
     SEVERITY                                           VARCHAR2(25)
     CEF_DATE_VIRTUAL                                   DATE
    
    SQL> CREATE MATERIALIZED VIEW distinct_vendors_mv
      2  BUILD IMMEDIATE
      3  REFRESH ON DEMAND
      4  ENABLE QUERY REWRITE
      5  AS
      6  SELECT distinct device_vendor FROM cef_record;
    SELECT distinct device_vendor FROM cef_record
                                       *
    ERROR at line 6:
    ORA-30353: expression not supported for query rewrite
    Thanks in advance,
    Alex

    user9022475 wrote:
    So, I thought about it. CEF_DATE_VIRTUAL is a virtual column. I tried to drop it and the CREATE MATERIALIZED VIEW statement worked. Why? I do not know. The virtual column was not involved at all in my materialized view, but I guess you can't create materialized views on tables with virtual columns?

    Ahh OK. I have it.
    Column virtual itself is not a problem, but its definition is the question.
    You have defined a virtual column as
    TO_DATE ("CEF_DATE", "MON ' JJ HH24:MI:SS")
    This format makes the function as non-deterministic and violates the restrictions for the query rewriting.
    If you can change the format of TO_DATE ("CEF_DATE", "MY DD YYYY HH24:MI:SS'"), it will work.

  • ORA-12028: type of materialized view is not supported by the main site

    Hi guys!

    We face a problem these days about the materialized view.

    We have upgraded database version 9.2.0.7 directly to 10.2.0.5 (RHEL4 x 86) on the same host. Database uses the driver dg4odbc to connect with remote SQL Server 2012 through data binding called MIKSERI. Our developer team would like to have replicated SQL server table data side Oracle using the materialized view.

    They created Materialized view, but it is not at all to refresh the data. I tried to study a little bit, and whenever I try to change the view anyway I hit error:

    ORA-12028: view type is not supported by the master site materialized @ 'MIKSERI '.

    ORA-06512: at line 22

    I looked at the solutions proposed and discovered that it is maybe the compatible database parameter, so I changed from previous 9.2.0.0.0 to 10.2.0.1.0 but still no luck. Just to emphasize this database is of course different clone of production to a different database, with db name retained and other parameters, but on another host computer and listening port. I even try to change global name, but still no luck.

    Main problem is that refresh the work does not at all. To be more precise, we have created MV on the side of the Oracle and FULL Refresh should be done every 3 minutes. MV uses HS db link to the sql server database.

    During the creation of MV, we can see currently given to sql server, but the problem is that we cannot do MV to refresh every 3 minutes. When I try to change MV and put the refresh interval I get above error.

    Any kind of help would be greatly appreciated,

    Thank you

    I found the reason why my MV update jobs failed, job_queue_processes parameter was equal to 0. I change this setting and now works fine.

    Thank you for your time!

  • What is the desertion of orderly materialized view with MLOG$.

    I have 11.2.4.0 Oracle enterprise edition.

    I want to remove completely the MATERIALIZED view and MATERIALIZED view logs.


    I need to do this on a production of databases.


    It's the right order?

    Thank you.

    You can drop the materialized view log first, then the materialized views.

    Because when you drop a materialized view log is therefore more available to fast refresh, however, it is available to rewrite, so drop materialized view log first, then materialized views. Additional information provided below may help Doc Oracle.

    If you delete a simple materialized view that is the least recently refreshed materialized view of a main table, then the database automatically purges the materialized master table see only connect the required lines to refresh the materialized view has fallen.

    If you delete a materialized view that was created on a predefined table, then the database removes the materialized view, and table preconstruitse returns to his identity in a table.

    When you delete a master table, the database does not automatically drop the materialized views based on the table. However, the database returns an error when it tries to refresh materialized view based on a main table that has been abandoned.

    If you delete a materialized view, then all the compiled queries that have been rewritten to use the materialized view will be invalidated and recompiled automatically. If the materialized view was preconstruitse on a table, then the table is not deleted, but it can no longer be maintained by the materialized view refresh mechanism.

  • The Materialized View - ORA-12052: is unable to fast refresh materialized view

    Hello

    I was hitting my head all day trying to create materialized views. I have made some progress, but have hit a brick wall, unfortunately!

    Basically, I have been invited to take a view and see if I can get the benefits of performance by transforming all or part of it in materialized views. Because the underlying tables of the config is updated quite frequently, I want to fast refresh materialized views on commit. However, when I try to create a materialized view containing an outer join in an aggregated materialized view table, I get ORA-12052: is unable to fast refresh materialized view.

    I went through the documentation and also Rob van Wijkvery useful series of blogs on the topic (especially http://rwijk.blogspot.co.uk/2009/09/fast-refreshable-materialized-view.html) but have not found anything that matches. Maybe I missed something somewhere along the line, or maybe I'm asking just something completely impossible?

    My db is 11.2.0.2.

    Here's the test scripts, I've worked with that:

    drop materialized view test1_test2_mv;
    Drop materialized view test2 journal;
    drop table test2;
    Drop materialized view test1_mv newspaper;
    drop materialized view test1_mv;
    Drop materialized view test1 journal;
    drop table test1;

    create table test1 (identification number,
    type varchar2 (10),
    number of Val,
    update_time date,
    constraint t1_pk primary key (id, type, val));

    Insert into test1
    Select 1, 'a', 1001, sysdate - 10/24 Union double all the
    Select 1, 'b', 1003, sysdate - 9/24 Union double all the
    Select 1, 'c', 1002, sysdate - 8/24 Union double all the
    Select 1, had ', 1004, sysdate - 7/24 Union double all the
    Select 1, 'e', 1005, sysdate - 6/24 Union double all the
    Select 1, 'c', 1006, sysdate - 5/24 Union double all the
    Select 2, 'a', 1002, sysdate - 4/24 Union double all the
    Select 2, 'b', 1005, sysdate - 3/24 Union double all the
    Select 3, 'a', 1001, sysdate - 2/24 Union double all the
    Select 3, 'c', 1006, sysdate - 1/24 Union double all the
    Select 3, 'e', 1008, sysdate - 2/24 Union double all the
    Select option 4, has ', 1004, sysdate - 3/24 Union double all the
    Select 5, 'b', 1002, sysdate - 4/24 Union double all the
    Select 5, 'g', 1001, sysdate - 5/24 Union double all the
    Select 6, 'h', 1004, sysdate - 6/24 Union double all the
    Select 7, 'b', 1007, sysdate - 7/24 Union double all the
    Select 7, had ', 1001, sysdate - 8/24 double;

    commit;

    Select * from test1;


    CREATE MATERIALIZED VIEW LOG ON test1
    WITH rowid, primary key (update_time)
    including the new values;


    Test1_mv CREATE MATERIALIZED VIEW
    IMMEDIATE CONSTRUCTION
    COOL OFF QUICKLY ON COMMIT
    Did YOU SELECT id,
    MAX (case when type = "there" end of val) THAT col_a,.
    MAX (case when type = 'b', then val end) AS col_b,.
    MAX (case when type = 'c' then end val) AS col_c,.
    MAX (case when type = ' then end of val) AS col_d,
    MAX (update_time) AS update_time
    OF test1
    WHERE TYPE in ('a',
    « b »,
    « c »,
    a ')
    GROUP BY id;

    CREATE MATERIALIZED VIEW LOG ON test1_mv
    WITH rowid
    including the new values;


    create table test2 (identification number,
    col2 number,
    COL3 varchar2 (10),
    number of COL4,
    constraint t2_pk primary key (id));

    Insert into test2
    Select 1, 1, 'bob', 1 double Union all
    Select 2, 1, "sue", 1 double Union all
    Select 3, 1, 'tom', 1 double Union all
    Select 4, 1, 'jay', 1 double Union all
    Select 5, 1, 'art', 1 double Union all
    Select 6, 1, 'kay', 1 double Union all
    Select 7, 1, 'max', 1 double Union all
    Select 8, 1, 'tim', 1 double Union all
    Select 9, 1, "liz", 1 from dual;

    commit;


    CREATE MATERIALIZED VIEW LOG ON test2
    WITH rowid, primary key
    including the new values;


    Test1_test2_mv CREATE MATERIALIZED VIEW
    IMMEDIATE CONSTRUCTION
    COOL OFF QUICKLY ON COMMIT
    LIKE SOME t2.rowid,.
    T1.ID,
    T1.col_a,
    T1.col_b,
    T1.col_c,
    T1.col_d,
    T1.update_time,
    T2.col2,
    T2. COL3
    OF test1_mv t1,.
    Test2 t2
    WHERE (+) t1.id = t2.id; -symbol of outer join is not correctly displayed on the forums without space, grr!

    ORA-12052: is unable to fast refresh materialized view TEST1_TEST2_MV

    Y at - it any way I can get the materialized view fast refresh on commit or I asking the impossible?

    Add t1.rowid:

    SQL > CREATE MATERIALIZED VIEW test1_test2_mv

    2 BUILD IMMEDIATE

    3 QUICK REFRESH YOU COMMIT

    4 AS t2.rowid SELECT rid2,

    5 t1.rowid rid1,

    6 t1.id

    T1.col_a 7,.

    T1.col_b 8,.

    T1.col_c 9,.

    T1.col_d 10,

    T1.update_time 11,

    T2.col2 12,

    13 t2.col3

    14 OF test1_mv t1,

    15 test2 T2

    16 WHERE t1.id = t2.id

    17.

    Materialized view created.

    SQL > select * from test1_test2_mv

    2.

    RID2 RID1 ID COL_A, COL_B, COL_C COL_D UPDATE_TIME COL2 COL3

    ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ------------------- ---------- ----------

    AAAYB6AANAAAANDAAA AAAYB/AANAAAAN/AAA 1 1001 1003 1006 1004 25 / 06 / 2014 12:54:16 1 bob

    AAAYB6AANAAAANDAAB AAAYB/AANAAAAN/AAB 2 1002 1005 25 / 06 / 2014 1 sue 14:54:16

    AAAYB6AANAAAANDAAC AAAYB/AANAAAAN/AAC 3 1001 1006 25 / 06 / 2014 16:54:16 1 tom

    AAAYB/AANAAAAN/AAD AAAYB6AANAAAANDAAD 4 1004 25/06/2014 14:54:16 1 jay

    AAAYB6AANAAAANDAAE AAAYB / AANAAAAN / AAE 5 1002 2014/06/25 13:54:16 1 art

    AAAYB6AANAAAANDAAF AAAYB/AANAAAAN/AAG 7 1007 1009 25 / 06 / 2014 10:54:16 max 1

    AAAYB/AANAAAAN/AAH                                                                                                        1 tim

    AAAYB/AANAAAAN/AAF                                                                                                        1 kay

    AAAYB/AANAAAAN/AAI                                                                                                        1 liz

    9 selected lines.

    SQL > update of test2

    2 set col3 = "fly."

    3 where id = 7

    6 m

    1 line update.

    SQL > validation

    2.

    Validation complete.

    SQL > select * from test1_test2_mv

    2.

    RID2 RID1 ID COL_A, COL_B, COL_C COL_D UPDATE_TIME COL2 COL3

    ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ------------------- ---------- ----------

    AAAYB6AANAAAANDAAA AAAYB/AANAAAAN/AAA 1 1001 1003 1006 1004 25 / 06 / 2014 12:54:16 1 bob

    AAAYB6AANAAAANDAAB AAAYB/AANAAAAN/AAB 2 1002 1005 25 / 06 / 2014 1 sue 14:54:16

    AAAYB6AANAAAANDAAC AAAYB/AANAAAAN/AAC 3 1001 1006 25 / 06 / 2014 16:54:16 1 tom

    AAAYB/AANAAAAN/AAD AAAYB6AANAAAANDAAD 4 1004 25/06/2014 14:54:16 1 jay

    AAAYB6AANAAAANDAAE AAAYB / AANAAAAN / AAE 5 1002 2014/06/25 13:54:16 1 art

    AAAYB/AANAAAAN/AAH                                                                                                        1 tim

    AAAYB/AANAAAAN/AAF                                                                                                        1 kay

    AAAYB/AANAAAAN/AAI                                                                                                        1 liz

    AAAYB6AANAAAANDAAF AAAYB/AANAAAAN/AAG 7 1007 1009 25 / 06 / 2014 10:54:16 1 rob

    9 selected lines.

  • Pivot can be used in fast refresh materialized view?

    Hi, I have a question about materialized view nested mode fast refresh on Oracle 11 g (It support function of pivot, but oracle 10 g doesn't support).

    When I created, he throws "ORA-12015: cannot create a view fast refresh materialized by a complex query.
    Then I used dbms_mview.explain_mview to see reason, and it tell me the following
    REFRESH_FAST_AFTER_INSERT ' view inline or subquery in LIST not supported for this type of MV.

    Can someone help me, any suggestions will be appreciated
    create table empX as select * from scott.emp;
    alter table empX add constraint PK_empX_empno primary key (empno);
    
    --drop  MATERIALIZED VIEW LOG ON empX;
    CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno);
    
    --drop MATERIALIZED VIEW mv_empX;
    CREATE MATERIALIZED VIEW mv_empX
    REFRESH FAST START WITH SYSDATE
    NEXT  SYSDATE + 1/1440
    AS   
      select * from
      (
       select rowid emp_rowid, deptno, job, sal from empX
      )
      PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3));
     
    --select * from mv_capabilities_table
    declare
      lv_sqltext varchar2(4000);
    begin
      execute immediate 'truncate table mv_capabilities_table';
      lv_sqltext := 'select * from
      (
       select deptno, job, sal from empX
      )
      PIVOT( max(sal) for job IN (''ANALYST'' job1, ''CLERK'' job2, ''MANAGER'' job3))
      ';  
      dbms_mview.explain_mview(lv_sqltext,'nested=>TRUE');
      commit;
    end;
    /

    Let me help you...
    I have done following and it run/view updated because I just replaced quickly with a complete word, because there are limitations for quickly updatable views:

    SQL> show user;
    USER is "SCOTT"
    SQL> create table empX as select * from scott.emp;
    
    Table created.
    
    SQL> alter table empX add constraint PK_empX_empno primary key (empno);
    
    Table altered.
    
    SQL>
    SQL> --drop  MATERIALIZED VIEW LOG ON empX;
    SQL> CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno);
    
    Materialized view log created.
    
    SQL>
    SQL> --drop MATERIALIZED VIEW mv_empX;
    SQL> CREATE MATERIALIZED VIEW mv_empX
      2  REFRESH COMPLETE WITH rowid
      3  START WITH sysdate
      4  NEXT  SYSDATE + 1/1440
      5  AS
      6    select * from
      7    (
      8     select rowid emp_rowid, deptno, job, sal from empX
      9    )
     10    PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3));
    
    Materialized view created.
    
    SQL> select * from mv_empx;
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAN         10                  1300
    AAAShcAAEAAAATTAAE         30
    AAAShcAAEAAAATTAAJ         30
    AAAShcAAEAAAATTAAC         30
    AAAShcAAEAAAATTAAA         20                   800
    AAAShcAAEAAAATTAAK         20                  1100
    AAAShcAAEAAAATTAAM         20       3000
    AAAShcAAEAAAATTAAD         20                             2975
    AAAShcAAEAAAATTAAB         30
    AAAShcAAEAAAATTAAI         10
    AAAShcAAEAAAATTAAL         30                   950
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAF         30                             2850
    AAAShcAAEAAAATTAAG         10                             2450
    AAAShcAAEAAAATTAAH         20       3000
    
    14 rows selected.
    
    SQL> begin
      2  dbms_mview.refresh('SCOTT.mv_empx');
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from mv_empx;
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAN         10                  1300
    AAAShcAAEAAAATTAAE         30
    AAAShcAAEAAAATTAAJ         30
    AAAShcAAEAAAATTAAC         30
    AAAShcAAEAAAATTAAA         20                   800
    AAAShcAAEAAAATTAAK         20                  1100
    AAAShcAAEAAAATTAAM         20       3000
    AAAShcAAEAAAATTAAD         20                             2975
    AAAShcAAEAAAATTAAB         30
    AAAShcAAEAAAATTAAI         10
    AAAShcAAEAAAATTAAL         30                   950
    
    EMP_ROWID              DEPTNO       JOB1       JOB2       JOB3
    ------------------ ---------- ---------- ---------- ----------
    AAAShcAAEAAAATTAAF         30                             2850
    AAAShcAAEAAAATTAAG         10                             2450
    AAAShcAAEAAAATTAAH         20       3000
    
    14 rows selected.
    
    SQL>
    

    So, the answer is Yes, we can use Pivot with Materialized view but:
    1 MV must be full refresh.
    2 oracle version should be 11 g; of course the pivot is available in Oracle 11 g.

    If this answers your question, please close the message, otherwise continue.

    These links may also be of interest:
    http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007028
    http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007007

    http://rwijk.blogspot.in/2009/06/fast-refreshable-MATERIALIZED-view.html

    And:

    Please see if (Note: 179466.1 - view to fast refresh materialized diagnose ORA-12015 / complex queries) help.

    Concerning
    Girish Sharma

  • Materialized view refresh issue

    Hi all

    Oracle Version 11.1.0.7

    I created a materialized view with 'FORCE' of the Refresh method and created Materialized view logs all the master tables (which are remote DB). I want to refresh this view mast too FAST. After the creation of view mast I want to manually update QUICKLY. But he gives me errors...
    ORA-12008: error in materialized view refresh path
    ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2545
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2751
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2720
    ORA-06512: at line 2
    But he made a FULL refresh. This time I don't get any errors. How is it, I get this error ("ORA-00942: table or view does not exist" "")... because it can successfully refreshed (COMPLETE).

    y at - it something wrong with Mat view logs... ? How hard to pull of this scenario. ?... guide me.



    Thank you
    Mike

    Your MV using a DBLink to connect to the remote DB. Should what account I use to connect remote DB? This account has right to SELECT on the MV log on the source table? A SELECT on the journal of MV in the source table must be granted explicitly.

    Hemant K Collette

  • Materialized view rebuild to change size of column

    We have changed the size of a varchar2 column in an OLTP table... The matte view in the warehouse pointing to this table/column complains... Is there an argument to 'rebuild' for materialized views in Oracle as I've seen in other databases? Or should I remove mast view create view Matt, create indexes and collect the tablestats to get it to pick up the new size of the column.

    The following statement compiles the matte view but does not pick up the new size and the matte view guard Plains.
    alter materialized view sms_ar.mv_sufficiency compile;
    I tried to put the argument of the 'reconstruction' on it but could not operate.

    Hi Mark,

    What is

    SQL> create table t(x varchar2(5))
    Table created.
    
    SQL> create materialized view mv
    as
      select x from t
    Materialized View created.
    
    SQL> alter table t modify x varchar2(10)
    Table altered.
    
    SQL> desc t
    TABLE t
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------
     X                                                  VARCHAR2(10)
    
    SQL> desc mv
    TABLE mv
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------
     X                                                  VARCHAR2(5)
    
    SQL> alter materialized view mv modify x varchar2(10)
    Materialized View altered.
    
    SQL> desc mv
    TABLE mv
     Name                                      Null?    Type
     ----------------------------------------- -------- -----------
     X                                                  VARCHAR2(10)
    

    Concerning
    Peter

Maybe you are looking for

  • MacBook 2016 cannot read an My Passport Slim external

    Hello everyone My new 2016 MacBook has only a single USB - C port that connects to Western Digital My Passport Slim disk external DRIVE via a USB HooToo multiport adapter. OS X in it just cannot read HARD drive even through it will make a sound when

  • How to stop the module loading bar?

    I see a few other similar questions without answers, so thought that I post the question to see if someone has thought of it. I DON'T want the bar the module at the bottom of my browser window... so why should I do? Firefox does a wonderful job in al

  • HP LaserJet P1006 does not print

    From my HP LaserJet P1006 to connect to my wireless router's USB port. When I tried to print my computer went on the Net to download the printer driver. I tried to print again. I have received the print dialog box, choose the printer that was connect

  • HP p1606

    I have a HP P1606dn which was printing automatically on 2 sides if I chose - until today.  Suddenly, after some updated HP asked me to install it, my printer prints on one side and told me to reinstall the book, so it can print the second side.  It i

  • screen / font size too big!

    my screen policy / bigger because I move my finger on the mousepad... but it's not smaller... it's so big I can't read it... what I can do?...