oracle ORA-04045: 重新编译/重新验证期间出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9623769/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 04:01:51  来源:igfitidea点击:

ORA-04045: errors during recompilation/revalidation

oracle

提问by Mike

I just suddenly started getting this error when trying to query the table AVC.

尝试查询表 AVC 时,我突然开始收到此错误。

ORA-04045: errors during recompilation/revalidation of PUBLIC.AVC
ORA-04098: trigger 'TTMS.ALTERED_TTMSDB_TABS_TRIGGER' is invalid and failed re-validation

select * from avcdoesnt work but select * from exfc.avcdoes work.

select * from avc不起作用,但select * from exfc.avc确实有效。

Can anyone tell me what is going on?

谁能告诉我这是怎么回事?

回答by Dave Costa

Presumably there is not an object in your schema named AVC. When you reference AVCwithout a schema qualifier, it is therefore accessing the PUBLICobject with that name. To find out what kind of object that is, SELECT object_type FROM all_objects WHERE object_name='AVC' AND owner='PUBLIC'.

据推测,您的架构中没有名为AVC. 当您在AVC没有模式限定符的情况下引用时,它因此正在访问PUBLIC具有该名称的对象。要找出那是什么类型的对象,SELECT object_type FROM all_objects WHERE object_name='AVC' AND owner='PUBLIC'.

Whatever it is, querying it is for some reason causing a trigger to fire. Maybe this is some sort of auditing function. But currently the trigger is invalid. This could mean that someone modified the trigger itself but made an error; or it could mean that someone dropped or modified some other object that the trigger depends on, in such a way that the trigger code is no longer valid.

无论是什么,查询它都是出于某种原因导致触发器触发。也许这是某种审计功能。但目前触发器无效。这可能意味着有人修改了触发器本身但犯了错误;或者这可能意味着有人删除或修改了触发器所依赖的其他对象,从而使触发器代码不再有效。

So, whoever's responsible for that trigger needs to find out what error is occurring in its compilation and resolve it.

因此,负责该触发器的人需要找出其编译中发生的错误并解决它。

When you explicitly query EXFC.AVC, you are bypassing the PUBLICobject and going directly to some underlying object, probably an actual table. It seems very odd that you would have access to this, since the whole point of routing access through a public synonym is usually to prevent direct access to the object. And if, in fact, the purpose of the trigger is to audit accesses to the table, then allowing you to bypass it entirely is a pretty big design flaw.

当您显式查询时EXFC.AVC,您将绕过该PUBLIC对象并直接转到某个底层对象,可能是一个实际的表。您可以访问它似乎很奇怪,因为通过公共同义词路由访问的整个点通常是为了防止直接访问对象。事实上,如果触发器的目的是审计对表的访问,那么允许您完全绕过它是一个相当大的设计缺陷。

回答by kite_runner90

Yes, it basically tells you that the trigger mentioned has an error. Easiest way I could fix this since I was working on SQL developer was,

是的,它基本上告诉您提到的触发器有错误。自从我从事 SQL 开发人员工作以来,我可以解决此问题的最简单方法是,

Open up 'Triggers' tab and search for this trigger. Compile it and run your query again. works perfectly fine :)

打开“触发器”选项卡并搜索此触发器。编译它并再次运行您的查询。工作得很好:)