Oracle 堆栈跟踪行号与源代码不匹配!
我从 Oracle 得到堆栈跟踪,说第 299 行有问题。没问题,我查看了有问题的包中的该行,并说这是初始化块中将变量设置为 1 的行,但没有调用引发错误的过程。
根据堆栈跟踪中的行号,服务器正在执行的内容与我在查看包源代码时看到的内容之间似乎不匹配。
我如何查看包:我使用 PL/SQL Developer 并单击对象浏览器中包名称上的“View Pacakge”。当我在源代码管理中查看同一个包时,第 299 行的错误是有意义的(这是对失败过程的调用)。
所以我的问题是:这是怎么回事?当我向 Oracle 询问 pacakge 源代码时,为什么我得到的源代码似乎与堆栈跟踪行号不匹配?
(甲骨文10克)
I got a stack trace from Oracle saying there was a problem on Line 299. No problem, I looked at that line in the package in question, and say that it's a line in an initialization block that sets a variable to 1, and does not call the procedure that raised the error.
It looks like there's a mismatch between what the server is executing and what I am seeing when I view the package source, based on the line number in the stack trace.
How I looked at the package: I used PL/SQL Developer and clicked "View Pacakge" on the package name in the object browser. When I looked at the same package in source control, an error on Line 299 makes sense (it's a call to the procedure that failed).
So my question is: WTF is going on? Why do I get source code that doesn't seem to match the stack trace line numbers when I ask Oracle for the pacakge source?
(oracle 10g)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您已经在 PL/SQL Developer 中打开了该包的源代码。当您再次选择查看源代码时,它会激活之前打开的编辑器,而无需重新加载源代码。
I think you already got the source of that package opened in PL/SQL developer. When you choose View Source again, it activates the previously opened editor, without reloading the source.
事实证明,我的脚本引用了
API_USR.SOME_PACKAGE
并且我以READONLY_USR
身份登录,并且READONLY_USR
拥有旧版本的SOME_PACKAGE
。当我通过 READONLY_USR 查看 API_USR.SOME_PACKAGE 时,我得到了正确的源代码。脸掌
So it turns out that my script was referencing
API_USR.SOME_PACKAGE
and I was logged in asREADONLY_USR
andREADONLY_USR
owns an older version ofSOME_PACKAGE
. When I viewedAPI_USR.SOME_PACKAGE
viaREADONLY_USR
I got the right source code.face-palm