0

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?

1 Answer 1

3

I would recommend running scripts using Sql*Plus. You would use

WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK 

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.