SQL> drop materialized view test_tb;
drop materialized view test_tb
*
第 1 行出现错误:
ORA-01422: 实际返回的行数超出请求的行数为什么删不了呢?

解决方案 »

  1.   

    可能是因为dual表的记录超过了一条。
    看看:
     select count(*) from dual;是否大于1
     
    如果大于1
    就执行命令:
    delete from dual;
    commit;
      

  2.   

    SQL> create materialized view log on test1;Materialized view log createdSQL> create materialized view view_test
      2  refresh fast on commit with primary key as select * from test1;Materialized view createdSQL> select * from view_test;A                                                                                         B          C
    -------------------------------------------------------------------------------- ---------- ----------
    2                                                                                         2          2
    3                                                                                         3          3
    4                                                                                         1          1
    1                                                                                         1          1
    5                                                                                         5          5SQL> drop materialized view view_test;Materialized view droppedSQL> 
      

  3.   

    这样建立的视图我可以删除.我建立的步骤如下:
    1.在数据库db1上:
      create materialized view log on com_sql;
    2.在数据库db2上:
      create public database link t32_dblin
      connect to techline identified by techline
      using 'fttest';
    3.在数据库db2上基于com_sql建立物化视图
      create materialized view com_sql on prebuilt table
      refresh fast as select * from com_sql@t32_dblink;
      
      alter materialized view com_sql refresh fast
      start with sysdate next sysdate+30/(24*60*60);4.这时再删除就会报错,像这样的物化视图该如何如何删除?