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.

Similar Messages

  • A Characteristci appears twice under the Rows Column on the left hand side.

    Hi All,
    According to the requirement , there are 2 Material Numbers ,1 of them is used for Compounding,which is not required in the Report,but as it is used for Compounding ,we need to place that in the rows.
    We have put tat in "NO DISPLAY" mode,but  Material Number appears twice under the Rows  column, on the left hand side of the screen, in the Portal when we execute the Report.How Can we have to display only 1 Material Number on the left hand side of the screen?
    Thanks in Advance,
    Sravani

    the left hand side of the screen is reakky vague....you should be more specific...
    Probably you need to filter out the compounding characteristics in the global filter area.
    Thanks...
    Shambhu

  • My iPhone appears twice under 'Manage Devices'.  Will I lose anything by deleting one of them?

    My iPhone 4S appears twice under 'Manage Devices'.  Will I lose anything by deleting one of them?

    If you reset the device, it will have absolutely no effect whatsoever on the other device. You will need her Apple ID and password if find my iPad is turned on on your device, before you can totally erase the iPad. Read this first.
    What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support

  • Switched fromgs3 to a 5s.now all my music appears twice in itunes and on phone. How to correct

    switched fromgs3 to a 5s.now all my music appears twice in itunes and on phone. How to correct

    Hello aldesi,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/ht2905
    Have a nice day,
    Mario

  • Material View Refresh Slow under 10.2.0.4?

    I have several material views that refreshed in minutes under 9.2.0.6, but are now taking hours under 10.2.0.4. I'm thinking it's in my initialization parameters. I remember the upgrade process making at least one of the HASH parameters obsolete.
    Can anyone point me in a direction quickly?
    A little more info... If I drop and recreate the materialized view from scratch it take just a few minutes to build.
    Thank you.
    Edited by: golflover1 on Jan 3, 2009 7:32 AM
    Edited by: golflover1 on Jan 3, 2009 7:33 AM

    What type of refresh you use to refresh the Materialized Views? (COMPLETE, FAST, FORCE)
    Since you migrated to 10g there is a slight difference in how Oracle does the refresh.
    Prior to 10g, when a materialized view is completely refreshed the base table was truncated and then populated with a data.
    Starting from 10g, the default behavior is changed and truncate is replaced with delete which results in longer refresh times.
    This is expected behavior, even though there was a bug associated with it Bug#4132133 which was closed as NOT A BUG.
    However, if you still want to do a truncate instead of delete, you should set atomic_refresh=>FALSE in your DBMS_MVIEW.REFRESH command. This will do a truncate and refresh will complete faster.
    You should be careful about this since there will be a time when the MV will contain no data.
    golflover1 wrote:
    A little more info... If I drop and recreate the materialized view from scratch it take just a few minutes to build.
    This just confirms what I have written above. When you drop and recreate the MV, it doesn't do the DELETE so it completes faster.
    I would say, go ahead and try to refresh the view with atomic_refresh=>FALSE and compare the execution times.
    begin
             dbms_mview.refresh(list=>'your mv name',method=>'C',atomic_refresh=>FALSE);
    end;For more about DBMS_MVIEW.REFRESH check the reference docs on this link</link>.
    Cheers,

  • Can't delete songs & ipod appears twice under "devices" in itunes

    I have two problems that started at the same time and are probably related. [Note - The problems described here occur on two different machines with this particular ipod (mine) & does not with my other one (my wife's).]
    Problem #1
    I can not delete anyting from my ipod. If I try to delete anything from my ipod, itunes immediately shuts down and the songs remain on the ipod. No error message, warning, or anything. This problem started the happening at the same time as problem #2.
    Problem #2
    My ipod shows up twice under Devices in itunes. [See a screenshot at: http://home.nyc.rr.com/mindybrian/itunes.JPG. ] Again, I don't know what caused this to happen.
    Since this doesn't happen to my other ipod and occurs on all computers I connect this ipod too, it must be the ipod. Does anyone have any advice? I don't want to wipe the whole thing clean and start from scratch. Any and all help is appreciated. Thank you.
    click wheel ipod   Windows XP  
    click wheel ipod   Windows XP  

    iPhone 4S and Windows XP the first thing that jumps to mind is that the iPhone 4S needs a USB 2.0 connection to sync with iTunes. Check your computers user guide to see if the PC has a compatable USB 2.0 input.

  • Disk appears twice in Project and Event window

    There seems to be a bug in iMovie that causes the default disk to appear twice in the project and event viewer if you have a symbolic link in the path.
    For years I have used a symlink to allow me to locate my Users area onto a second drive. This keeps all my user data separate from the more generic system data. Occasionally an application gets confused by this link and this seems to be the case with iMovie.
    I think what is happening is that iMovie is trying to list my home directory which by default is usually on Macintosh HD/Users/louie but when it hits the symlink at /Users -> /Volumes/DataDisk/Users it sees this is actually on drive DataDisk. Then I think it looks for all mounted volumes and it finds DataDisk again and doesn't realize that this is already recorded and includes it again.
    Other than this odity it seems to work just fine. If I add a project or event, initially it appears in only one of the DataDisk entries in iMovie. Then if I restart iMovie the new project and/or event will show under both entries. The actual project and events are correcty created in my ~/Movies directory.
    -louie

    I don't know an easy way to fix that if you are using a symlink.
    Click on this link for some good information about how to set up your home folder in a different location. You can set it up on OSX where you will not need a symlink. On the other hand, if its working well for you, may be best to leave it alone.
    http://pondini.org/OSX/SetupOther.html

  • Materialized view issue with spatial index and UNION all.

    Hi guys,
    I'm trying to build the following materialized view:
    create materialized VIEW MV_ElectricalStuffs
      refresh fast
      AS
      SELECT jb.ROWID,
        jb.FID,
        JB.NAME_NUMBER
      FROM EL_BUS_BAR jb
      UNION ALL
      SELECT INC.ROWID,
        INC.FID,
        NULL,
        INC.NAME_NUMBER
      FROM EL_INTERNAL_CELL INC;
    I have this error showing up:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    This is because the table EL_INTERNAL_CELL has a SDO_GEOMETRY column that has a spatial index, whose ddl is
    CREATE INDEX EL_INTERNAL_CELL_S ON EL_INTERNAL_CELL (GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS('SDO_INDX_DIMS=2 TABLESPACE=USERS LAYER_GTYPE=COLLECTION');
    When I remove the spatial index from EL_INTERNAL_CELL column GEOM, Oracle is very happy and creates the view.
    Is there a mean however to keep the spatial index in the materialized view?

    I've managed to drop the spatial index prior to create the materialized view and it is ok. After the materialized view creation, I've recreated the spatial index on the table and all ran smooth. Hope nothing will go bad in the future because of this trick on spatial index..

  • Invalid views with missing underlying tables

    I have completed an import from one database, 8i version, to a new 10g database and in the process of the import a view was imported in the SYS schema. The table being accessed by the view has since been dropped during another import and now the view is listed as invalid but I am unable to delete the view. Since the import was completed 3 times this view appears 3 times as invalid. When I try to edit the view and include a valid select statement it will recompile but the invalid view still remains.
    Does anyone have an idea how to remove these 3 invalid views?
    Chicago

    Does anyone have an idea how to remove these 3 invalid views?
    select 'Drop view '||  object_name || ';' from dba_objects where object_name='VIEW_NAME' and object_type='VIEW' and status='INVALID'
    and OWNER=<OWNER where INVALID VIEW EXISTS';and execute the script.

  • How to get Materialized View to ignore unused columns in source table

    When updating a column in a source table, records are generated in the corresponding materialized view log table. This happens even if the column being updated is not used in any MV that references the source table. That could be OK, so long as those updates are ignored. However they are not ignored, so when the MV is fast refreshed, I find it can take over a minute, even though no changes are required or made. Is there some way of configuring the materialized view log such that the materialized view refresh ignores these updates ?
    So for examle if I have table TEST:
    CREATE table test (
    d_id NUMBER(10) PRIMARY KEY,
    d_name VARCHAR2(100),
    d_desc VARCHAR2(256)
    This has an MV log MLOG$_TEST:
    CREATE MATERIALIZED VIEW LOG ON TEST with rowid, sequence, primary key;
    CREATE MATERIALIZED VIEW test_mv
    refresh fast on demand
    as
    select d_id, d_name
    from test;
    INSERT 200,000 records
    exec dbms_mview.refresh('TEST_MV','f');
    update test set d_desc = upper(d_desc) ;
    exec dbms_mview.refresh('TEST_MV','f'); -- This takes 37 seconds, yet no changes are required.
    Oracle 10g/11g

    I would love to hear a positive answer to this question - I have the exact same issue :-)
    In the "old" days (version 8 I think it was) populating the materialized view logs was done by Oracle auto-creating triggers on the base table. A "trick" could then make that trigger become "FOR UPDATE OF <used_column_list>". Now-a-days it has been internalized so such "triggers" are not visible and modifiable by us mere mortals.
    I have not found a way to explicitly tell Oracle "only populate MV log for updates of these columns." I think the underlying reason is that the MV log potentially could be used for several different materialized views at possibly several different target databases. So to be safe that the MV log can be used for any MV created in the future - Oracle always populates MV log at any update (I think.)
    One way around the problem is to migrate to STREAMS replication rather than materialized views - but it seems to me like swatting a fly with a bowling ball...
    One thing to be aware of: Once the MV log has been "bloated" with a lot of unneccessary logging, you may perhaps see that all your FAST REFRESHes afterwards becomes slow - even after the one that checked all the 200000 unneccessary updates. We have seen that it can happen that Oracle decides on full table scanning the MV log when it does a fast refresh - which usually makes sense. But after a "bloat" has happened, the high water mark of the MV log is now unnaturally high, which can make the full table scan slow by scanning a lot of empty blocks.
    We have a nightly job that checks each MV log if it is empty. If it is empty, it locks the MV log and locks the base table, checks for emptiness again, and truncates the MV log if it is still empty, before finally unlocking the tables. That way if an update during the day has happened to bloat the MV log, all the empty space in the MV log will be reclaimed at night.
    But I hope someone can answer both you and me with a better solution ;-)

  • Materialized view to ensure data integrity over multiple tables

    Hello,
    I have a problem and I am not able to solve it. Partially, It is because of my poor SQL skills. I have three tables and I am using one sequence to enter data into them.
    What I am tying to do is to create a materialized view ( complete or fast, whichever) with refresh on commit option to check that each table contains unique data in comparison to other.
    I am posting code so you can get along:
    CREATE TABLE table_1 (
    ID NUMBER PRIMARY KEY
    CREATE TABLE table_2 (
    ID NUMBER PRIMARY KEY
    CREATE TABLE table_3 (
    ID NUMBER PRIMARY KEY
    INSERT INTO table_1 VALUES (1);
    INSERT INTO table_1 VALUES (2);
    INSERT INTO table_2 VALUES (3);
    INSERT INTO table_2 VALUES (4);
    INSERT INTO table_3 VALUES (5);
    INSERT INTO table_3 VALUES (6); I want to write create a materialized view that will give me output only in case that there are same values in two different tables. I got this far.
    CREATE MATERIALIZED view mv_test
    REFRESH COMPLETE ON COMMIT
    AS
    SELECT count(1) ROW_COUNT
    FROM dual
    WHERE EXISTS (
         SELECT a.id
         FROM table_1 a
         WHERE a.id IN(
             SELECT b.id
             FROM table_2 b))
    OR EXISTS (
        SELECT a.id
         FROM table_1 a
         WHERE a.id IN
                 (SELECT c.id
                 FROM table_3 c))
    OR EXISTS (
        SELECT b.id
             FROM table_2 b
        WHERE b.id IN
                 (SELECT c.id
                 FROM table_3 c));
        ALTER MATERIALIZED VIEW mv_test
        ADD CONSTRAINT cs_mv_test
        CHECK (row_count = 0) DEFERRABLE; This sql statement itself returns no rows if my logic is correct. And in case there were some duplicate rows in two different table, it would return 1 and constraint would throw an error.
    However, I cannot create this with ON COMMIT option. When I try to compile I get:
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view I went through documentation, tried creating mat_view logs etc.
    I know that one of the mistakes is that I am referencing dual table and I am not sure if I can use EXISTS.
    Unfortunately, my SQL wisdom ends here. I need help rewriting the sql, so it would work in materialized view with refresh on commit option. Please, help!!!
    I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.
    Thank you in advance.

    >
    I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.If you are certain that you control all the inputs to the table and you are definitely using one sequence to insert into all three tables then there is physically no possible way you will get duplicate values across tables.
    Writing something to check if this is the case would almost be like writing something to verify that 1+1 really does equal 2 in 100% of cases.
    if you must, however. consider something similar to the following which may be more performant:
    select *
      from table_1 t1
      full outer join table_2 t2 on (t1.id = t2.id)
      full outer join table_3 t3 on (t1.id = t2.id
                                     or
                                     t2.id = t3.id)
    where t1.id+t2.id+t3.id not in (t1.id,t2.id,t3.id);

  • Maintenance view:  how to read EXTRACT and TOTAL table

    Hi, All,
    I created a maintenance view, as stated in the documentation, there are 2 internal tables EXTRACT and TOTAL available in running environment. Now I want to read a record from the internal table by using "READ TABLE...."
    In my example: the table strucutre has  A, B, C 3 fields.
    So I tried to use "READ TABLE EXTRACT with key A=' xyz' assigning <fs>", in this case, the syntax check shows error saying that the specified type has no structure and no component can be called.
    So how can I search a row in the table EXTRACT and TOTAL by giving a field value? Is there any other way to get data from the table?
    Thank you!

    Hi Yongying,
    I know this is an old post, but, may be this is still helpful for you or for others with the same problem.
    Just add the option "CASTING" at the end of your READ statement:
    "READ TABLE EXTRACT with key A=' xyz' assigning  must be full typed or at least, be of the same type of the Z table from which is generated the itab EXTRACT.
    Regards,
    José Gabriel.

  • Creating view cluster for a header and detail table

    Hi all,
    I want to create a View cluster for maintaining 2 tables (one is the header table and other is the detail table)
    ....for each line in the header table there can be multiple detail line items...
    If anyone has worked on such requirement...please tell me how should i go about developing it.
    after creation i should be able to maintain the cluster using transaction SM34....
    Thanks ,
    Sushil.

    hi
    refer to following link
    http://help.sap.com/saphelp_nw04/helpdata/en/d0/999246b2aa11d1a5700000e82deaaa/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/d0/999246b2aa11d1a5700000e82deaaa/frameset.htm
    Cheers
    Snehi

  • Network User appearing twice in connection tab under file sharing

    I have one of my network users that appears twice under the connected Users tab in the File Sharing service (Lion Server).
    It only appears to be happening with one of the users.  When they log in they get shown twice with the same IP address although they can have different idle time.
    I can not seem to work out what is going on.
    Any thoughts/suggestions would be welcome.

    After a little bit of mucking around I have discovered the duplicate user appears when I mount a network volume (which is also a share) during login using a "mount drive" script.  I can disconnect the duplicate user which unmounts the network volume.
    Same thing happens when I connect to the server machine through the SHARED listing in Finder as it is set up to use my network account to connect.  ONce again I can disconnect which simply umounts the shared access.

  • 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

Maybe you are looking for