Oracle-任何错误后如何停止脚本执行?
例如,假设我们有以下在产品中执行的脚本。
drop index idx_test1;
drop index idx_test2;
但是,在执行第一个指令后,我们会得到错误:ora-00054:资源忙碌并使用NOTAIT指定或超时过期
获取。我想停止所有后续说明。有什么方法可以在SQLPLUS和SQLDEVEVER/PL/SQL开发人员中进行操作?
For example, let's say we have the following script to execute in prod.
drop index idx_test1;
drop index idx_test2;
But, after execute first instruction we get the error: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
. From here I'd like to stop all subsequent instructions. Is there any way to do it in sqlplus and sqldeveloper/PL/SQL Developer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用SQL*Plus运行脚本。您将使用
此功能可以成为
glogin.sql
的一部分,也可以作为生产脚本的标题。这还将将错误代码发送到您自己的日志记录的调用过程中,因此,如果您有一些编排者,则可以知道发生了什么。
I would recommend running scripts using Sql*Plus. You would use
This can be part of your
glogin.sql
or just as a header of your production script.This will also send the error code to the calling process for your own logging so if you have some orchestrator, it can know what's happened.