ORA-00942 故障排除
在昨晚的自动化测试运行中,我的二十个工作线程之一崩溃了;应用程序正在尝试插入。 Springframework 报告 ORA-00942: 表或视图不存在。
通过企业管理器连接到数据库(11.1.0.6.0),我拉出一个 SQL 工作表并查询表,发现 (a) 该表现在存在 (b) 应该插入的行丢失了 (c ) 该线程之前插入的行存在 (d) 该表在错误发生之前和之后都有行。
对于缺乏 Oracle 经验的用户,如何验证错误是否源自此数据库服务器,以及如何从那里将错误追溯到根本原因?
In the middle of an automated test run last night, one of my twenty worker threads blew out; the application was attempting an INSERT. Springframework reports ORA-00942: table or view does not exist.
Connecting to the database (11.1.0.6.0) through the enterprise manager, I pull up a SQL worksheet and query the table, discovering (a) that the table exists now (b) the row that should have been inserted is missing (c) the row previously inserted by this thread is present (d) that the table has rows before and after the error in time.
For a user with little oracle experience, how do I verify that the error originated with this database server, and from there how do I walk the error back to a root cause?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会从尽可能靠近数据库的地方开始,以确认数据库本身执行、提交、回滚哪些 SQL。我将设置 TKPROF(查看文档,或访问 Tom Kyte 的网站 了解更多信息)并查看实际情况从您的应用程序执行。这至少可以帮助您了解您期望执行的内容是否确实“到达”了。
如果表对调用程序“不可见”,即权限不够,则会出现 ORA-00942。
I would start as close to the database as possible, to confirm what SQL is executed, committed, rolled back etc. in the database itself. I'd set up TKPROF (check the docs, or visit Tom Kyte's site for more info) and see what actually gets executed from your app. That will at least help you to see if what you expect to be executed is actually "arriving" as it should.
An ORA-00942 will occur if the table is "invisible" to the calling programme i.e. if the permissions are not sufficient.
正如 Dave K 所说,该表可能已经存在,但对您的进程来说“不可见”。
由于“昨晚”这个短语,我的想法导致可能存在夜间进程,例如备份或清理进程,导致表脱机。
As Dave K said, the table may have existed, but became "invisible" to your process.
Because of the phrase "last night", my thoughts lead that there may be a nightly process, like a backup or clean-up process, which caused the table to be taken offline.