Skip to Main Content

Chinese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00604 触发器导致无法插入数据

dla001Oct 17 2012 — edited May 7 2013
数据库版本:11.2.0.3.3 x64
操作系统:CentOS5.7 x64

触发器代码如下:
create or replace trigger trig_owner_alter_priv
     before drop or truncate or alter on database
   begin
     if upper(ora_login_user) in ('WMS') then
           raise_application_error(-20001,'不能进行操作请联系管理员');
        end if;
   end;
症状:向一个表中无法插入数据。只有这一个表插入数据时有问题。表上无触发器。
命令报错如下:
在行 1 上开始执行命令时出错:
insert into adjust_detail(ADJUST_DETAIL_ID) select 111 from dual
错误报告:
SQL 错误: ORA-00604: 递归 SQL 级别 2 出现错误
ORA-20001: 不能进行操作请联系管理员
ORA-06512: 在 line 3
00604. 00000 -  "error occurred at recursive SQL level %s"
*Cause:    An error occurred while processing a recursive SQL statement
           (a statement applying to internal dictionary tables).
*Action:   If the situation described in the next error on the stack
           can be corrected, do so; otherwise contact Oracle Support.
出现错误后,执行的命令如下:
alter trigger TRIG_OWNER_ALTER_PRIV disable;
alter trigger TRIG_OWNER_ALTER_PRIV enable;
然后故障消失。可以正常插入数据。

问题:
1.是什么原因导致的这个问题? 触发器代码有问题?还是其它的问题?
2.下次再出现这个问题应该怎么做?

谢谢
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2013
Added on Oct 17 2012
3 comments
4,341 views