为什么Oracle不告诉你WHICH表或视图不存在? [英] Why doesn't Oracle tell you WHICH table or view does not exist?

查看:180
本文介绍了为什么Oracle不告诉你WHICH表或视图不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您使用Oracle,您可能得到了有用的消息ORA-00942:表或视图不存在。是否有合法的技术原因消息不包括缺少的对象的名称?

If you've used Oracle, you've probably gotten the helpful message "ORA-00942: Table or view does not exist". Is there a legitimate technical reason the message doesn't include the name of the missing object?

有关这个问题的论据是由于安全声音,因为它们是由TSA制作的。如果我是攻击者,我会知道我试图利用的表,并且能够轻松地解释这个无用的消息。如果我是一个开发人员通过几层应用程序代码处理复杂的连接,通常很难说。

Arguments about this being due to security sound like they were crafted by the TSA. If I'm an attacker, I'd know what table I just attempted to exploit, and be able to interpret this unhelpful message easily. If I'm a developer working with a complex join through several layers of application code, it's often very difficult to tell.

我的猜测是,当这个错误最初实现,有人忽视了添加对象名称,现在,人们害怕它会破坏兼容性来修复它。 (代码做的愚蠢的事情,如解析错误消息将被困惑,如果它改变。)

My guess is that when this error was originally implemented, someone neglected to add the object name, and now, people are afraid it will break compatibility to fix it. (Code doing silly things like parsing the error message will be confused if it changes.)

有一个开发人员友好(而不是招聘你的DBA)的方式来确定缺少的表的名称?

Is there a developer-friendly (as opposed to recruiting your DBA) way to determine the name of the missing table?

虽然我接受了一个与主题相关的答案, t真的回答我的问题:为什么不是错误信息的名称部分如果任何人能提出真正的答案,我会很乐意更改我的投票。

Although I've accepted an answer which is relevant to the topic, it doesn't really answer my question: Why isn't the name part of the error message? If anyone can come up with the real answer, I'll be happy to change my vote.

推荐答案

您可以在参数文件(纯文本或spfile)中设置EVENT以强制Oracle在user_dump_dest中转储详细的跟踪文件,

You can set an EVENT in your parameter file (plain text or spfile) to force Oracle to dump a detailed trace file in the user_dump_dest, the object name might be in there, if not the SQL should be.

EVENT =942 trace name errorstack level 12

EVENT="942 trace name errorstack level 12"

如果您使用纯文本文件,则需要将所有EVENT设置保存在连续的行中。不知道如何应用于spfile。

If you are using a plain text file you need to keep all your EVENT settings on consecutive lines. Not sure how that applied to spfile.

这篇关于为什么Oracle不告诉你WHICH表或视图不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆