ITPub博客

首页 > 数据库 > Oracle > ORA-00942 when deleting from an existing Table

ORA-00942 when deleting from an existing Table

Oracle 作者:xysoul_云龙 时间:2016-05-31 16:15:28 0 删除 编辑

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

SYMPTOMS

Delete from an existing table fails with ORA-942. The table exists in dba_objects view with valid status.

CAUSE

If a materialized view log table is dropped by a different method than "DROP MATERIALIZED VIEW LOG" it can cause DMLs over the source table to raise ORA-942 errors. 

 The call stack show the following functions :

kxtrcpy kntkca kntkcai kntclc

SOLUTION

Please use the below query to identify the Materialised view log:

 
SQL> select 'drop materialized view log on '||mvl.log_owner||'.'||mvl.master||';'  cmd  from dba_mview_logs mvl  where not exists  ( select table_name from dba_tables tab  where tab.owner = mvl.log_owner and tab.table_name = mvl.log_table  )  / 
  Sample output:
CMD -------------------------------------------------------------------------------- drop materialized view log on EDA_STD_REPORT_ADM.STATICREPORTS;
   

Drop the related materialized view log and then perform the other DML operation


PS:也可参考 老杨博客http://blog.itpub.net/4227/viewspace-617658/, 11.2.0.4 不可drop table 方式删除物化视图日志


ORA-00942 when deleting from an existing Table after dropping materialized view log table (Doc ID 1912363.1)

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29487349/viewspace-2109842/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
主要从事Oracle数据库 DBA相关工作,其他操作系统、中间件等也有涉及,热衷分享。岁月老将至,如有幸在江湖中留点踪迹,也是欣慰。 【文盲筱烨】好读书爱运动的IT技术爱好者 微博:文盲筱烨 微信公众号:筱烨视点

注册时间:2014-02-15

  • 博文量
    412
  • 访问量
    1104532