今天公司开发在删除表时报错ora-12083,很是疑惑,数据字典记录的是表,而删除要用物化视图方式删除,如下:

SQL> DROP TABLE CODE_M_AGENCY;
DROP TABLE CODE_M_AGENCY
           *
ERROR at line 1:
ORA-12083: must use DROP MATERIALIZED VIEW to drop "EFMIS_36"."CODE_M_AGENCY"

SQL> DROP MATERIALIZED VIEW CODE_M_AGENCY;
DROP MATERIALIZED VIEW CODE_M_AGENCY
*
ERROR at line 1:
ORA-12003: materialized view "EFMIS_36"."CODE_M_AGENCY" does not exist

使用10046事件跟踪如下:

SQL>alter session set events '10046 trace name context forever,level 12';
SQL>drop table CODE_M_AGENCY;
SQL>alter session set events '10046 trace name context off';

查看跟踪文件报错的递归sql:

=================================================================================================================================================================
PARSING IN CURSOR #139894769163856 len=160 dep=1 uid=0 oct=3 lid=0 tim=1482995091131451 hv=2880999359 ad='e882b160' sqlid='gx4mv66pvj3xz'
select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),rowid,cols,nvl(defer,0),mtime,nvl(spare1,0),spare2,spare3 from cdef$ where obj#=:1
END OF STMT
BINDS #139894769163856:
Bind#0
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0001 frm=00 csi=00 siz=24 off=0
  kxsbbbfp=7f3bca04f3b8  bln=22  avl=04  flg=05
  value=451343
EXEC #139894769163856:c=0,e=54,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=2570921597,tim=1482995091131499
FETCH #139894769163856:c=0,e=4,p=0,cr=2,cu=0,mis=0,r=0,dep=1,og=4,plh=2570921597,tim=1482995091131508
CLOSE #139894769163856:c=0,e=0,dep=1,type=3,tim=1482995091131516
EXEC #139894770891880:c=17998,e=210770,p=0,cr=83,cu=3,mis=0,r=0,dep=0,og=1,plh=0,tim=1482995091131554
ERROR #139894770891880:err=12083 tim=1482995091131562
WAIT #139894770891880: nam='SQL*Net break/reset to client' ela= 1 driver id=1650815232 break?=1 p3=0 obj#=-1 tim=1482995091131628
WAIT #139894770891880: nam='SQL*Net break/reset to client' ela= 38 driver id=1650815232 break?=0 p3=0 obj#=-1 tim=1482995091131679
WAIT #139894770891880: nam='SQL*Net message to client' ela= 0 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1482995091131693

*** 2016-12-29 15:05:01.030
WAIT #139894770891880: nam='SQL*Net message from client' ela= 9898906 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1482995101030616
CLOSE #139894770891880:c=0,e=17,dep=0,type=0,tim=1482995101030778
=================================================================================================================================================================

可以看到是在执行sql(已经替换绑定变量):select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),rowid,cols,nvl(defer,0),mtime,nvl(spare1,0),spare2,spare3 from cdef$ where obj#=451343;

该sql在pl/sql devloper上执行结果为空。

好吧!我们来看一下正常情况下的drop table操作结果如何,步骤如下:

SQL> create table test01 as select * from user_objects;
SQL> alter session set events '10046 trace name context forever,level 12';
SQL> drop table test01;
SQL> alter session set events '10046 trace name context off';

取得跟踪文件后发现没有找到以上sql信息。

===================================

根据报错信息google查看,发现这是一个oracle bug,解释如下:

ISSUE CLARIFICATION
====================
After dropping the materialized view,while trying to drop the underlying table,
it failed with below error
When I try to drop the table it gives "ORA-12083: must use DROP MATERIALIZED
VIEW ..." .
.
ISSUE VERIFICATION
===================
Verified with error description above.
.
CAUSE DETERMINATION
====================
This is because of the Bug 4287115.
This is a known issue in 9i , which is fixed in 10g.
CAUSE JUSTIFICATION
====================
the bug description clearly matches the issue here.
.
POTENTIAL SOLUTION(S)
======================
To workaround the problem , connected as sys run the following update statement.
The following update should update only one row. In case if it updates more
than one row, then rollback the transaction, which means that this workaround
does not apply to your case.
connect sys/ as sysdba
update tab$ set property = property - 100663296 where
obj# in (select obj# from obj$ where name='OT_CR_ITEM_X' and
owner# in (select USER_ID from all_users where USERNAME=''));
commit;
alter system flush shared_pool;
alter system flush shared_pool;
alter system flush shared_pool;
connect /
Now try dropping the table & it should go through fine.

POTENTIAL SOLUTION JUSTIFICATION(S)
====================================
This is the recommended solution.
.
SOLUTION / ACTION PLAN
=======================
Hi Chunpeng,
This problem is not fixed in 9i,but you can try the workaround given above.
this is fixed in 10g.

安装步骤解决发现可以正常删除表,如下。

update tab$
   set property = property - 100663296
where obj# in
       (select obj#
          from obj$
         where name = 'CODE_M_DISTRICT'
           and owner# in (select USER_ID from all_users where USERNAME = 'EFMIS_36'));
commit;

oracle Bug 4287115(ora-12083)的更多相关文章

  1. 转:Oracle 执行计划(Explain Plan) 说明

    Oracle 执行计划(Explain Plan) 说明 原贴地址:http://blog.csdn.net/tianlesoftware/article/details/5827245   如果要分 ...

  2. oracle系统函数(日期函数)

    oracle系统函数(日期函数) 调用日期函数时,首先要明确两个概念,时间戳和日期是不同的,日期中包括年月日但不包括小时分钟秒,时间戳包括年月日小时分钟秒.在oracle中,一般情况下,函数中包含da ...

  3. 11g Oracle Rac安装(基于linux6)可能出现的问题

    11g Oracle Rac安装(基于linux6)可能出现的问题汇总: 7)使用"yum"命令执行节点的自动配置失败. 修改一下 /etc/resolv.conf,添加: nam ...

  4. 【Oracle】转:通过案例学调优之--Oracle Time Model(时间模型)

    转自:http://blog.51cto.com/tiany/1596012 通过案例学调优之--Oracle Time Model(时间模型) 数据库时间 优化不仅仅是缩短等待时间.优化旨在缩短最终 ...

  5. PLSQL Developer概念学习系列之登录连接Oracle时出现(没有登录) -PL / SQL Developer:ORA - 12541: TNS :无建听程序的错误解决办法(图文详解)

    不多说,直接上干货! 前期博客 PLSQL Developer概念学习系列之如何正确登录连接上Oracle(图文详解)   如用scott.scott_password进行登录,orcl是全局数据库 ...

  6. Oracle corrupt block(坏块) 详解

    转自:http://blog.csdn.net/tianlesoftware/article/details/5024966 一. 坏块说明 1.1 相关链接 在看坏块之前,先看几个相关的链接,在后面 ...

  7. 【转】Oracle 执行计划(Explain Plan) 说明

    转自:http://blog.chinaunix.net/uid-21187846-id-3022916.html       如果要分析某条SQL的性能问题,通常我们要先看SQL的执行计划,看看SQ ...

  8. Oracle 数据库重放(Database Replay)功能演示

    我们可以捕获生产环境的工作量,在测试环境上重放,从而在不影响生产环境的前提下做一些改动测试. 捕获:需要Oracle版本为10.2.0.4或更高. 重放:需要Oracle版本为11g Release ...

  9. Oracle触发器实例(网搜)

    触发器使用教程和命名规范 目  录触发器使用教程和命名规范 11,触发器简介 12,触发器示例 23,触发器语法和功能 34,例一:行级触发器之一 45,例二:行级触发器之二 46,例三:INSTEA ...

随机推荐

  1. JavaScript 学习笔记(二)

    学习内容: 一.变量的定义 二.JS的基本数据类型 三.JS的基本语法 1.变量的定义:   任何语言中最基本的东西就属于变量了,那么如何定义变量以及运用,其实是一件很简单的事情.. JS中提供了如何 ...

  2. mysql -- 重装mysql失败的解决办法

    最近遇到一些问题,将mysql卸载了重装,但总是出现安装不成功,应该是上一个mysql没卸载干净,于是各种找资料,前后弄了几个小时,终于给弄出来了,结合网上的资料,现总结如下: 1. 打开控制面板-添 ...

  3. JBPM——工作流概念

    一.概念          工作流(Workflow),就是"业务过程的部分或总体在计算机应用环境下的自己主动化",它主要解决的是"使在多个參与者之间依照某种提前定义的规 ...

  4. HDF5 文件格式简介

    三代测序下机的原始数据不再是fastq格式了,而是换成了hdf5 格式,在做三代数据的分析之前,有必要先搞清楚hdf5 这种文件格式; 官网的链接如下:https://support.hdfgroup ...

  5. 微服务 通过EnableFeignClients调用其他服务的api

    今天在项目上遇到一个问题,通过当前service服务要调用到其他service服务的api接口时,可通过EnableFeignClients调用其他服务的api,大概的步骤如下: 1.在springb ...

  6. Socket.BeginConnect 方法

    Socket.BeginConnect 方法 (IPAddress, Int32, AsyncCallback, Object) 开始一个对远程主机连接的异步请求. 主机由 IPAddress 和端口 ...

  7. linux中,通过crontab -e编辑生成的定时任务,写在哪个文件中

    环境描述: 操作系统:Red Hat Enterprise Linux Server release 6.6 (Santiago) 内核版本:2.6.32-504.el6.x86_64 需求描述: 一 ...

  8. 改善C#程序的建议5:引用类型赋值为null与加速垃圾回收

    http://www.cnblogs.com/luminji/archive/2011/04/07/2007205.html 在标准的Dispose模式中(见前一篇博客“C#中标准Dispose模式的 ...

  9. J2EE开发推荐工具

  10. Java精选笔记_Filter(过滤器)

    Filter(过滤器) Filter入门 什么是Filter Filter被称作过滤器或者拦截器,其基本功能就是对Servlet容器调用Servlet的过程进行拦截,从而在Servlet进行响应处理前 ...