Search code examples
oracletimemaxprocedureexecution

ORACLE PL/SQL: Calling an external Oracle PL/SQL procedure with maximum execution time


Please suppose that in my Oracle database (release 12) I have an Oracle PL/SQL procedure, called A.

This procedure "A" calls the procedure "B" (we can see it as a "black box", this means it is not modifyable) stored in external Oracle database reachable through a database link.

How can we limit the execution time of the B procedure?

The goal is to execute B for maximum 10 minutes, for example, after then, return to procedure A and continue execution.

Please assume that you cannot modify the B Oracle PL/SQL procedure.

Any clues?

Thank you very much for considering my request.


Solution

  • I would suggest you to use DBMS_SCHEDULER to create a JOB which you can stop/kill. Just check out the documentation for DBMS_SCHEDULER