Creating a perpetually running scheduler job
Hello all
I am helping a colleague making a scheduler job run perpetually. It needs to be robust and restart gracefully after both local failures/errors and database restarts. And in case of failures, it needs to restart after not too long time (minutes, not more).
Right now, the job is started once manually and runs an infinite loop. My opinion is that this can/should be made much more robust.
Simplified pseudo-code is along these lines:
procedure Exec_remote /* This is on another database, called across a database link */
as
begin
dbms_aq.Dequeue (/* timeout = 10 */);
end;
/
declare -- this is run from scheduler job (which is run once)