This discussion is archived
1 Reply Latest reply: May 4, 2011 5:14 AM by user477000 RSS

Checking if Script is Already Running

850978 Newbie
Currently Being Moderated
Hello All:

I am writing a batch file that will fire off an Oracle Stored Procedure using something along these lines:
IF "%%~nxV" EQU "FILE1" sqlplus username/password@prod @c:\folder\sql\sqlfile.sql

If there some way to know if SQLFILE.SQL is already running so we don't call the process twice? Preferabbly from a batch file / command prompt.

Thanks
Andy
  • 1. Re: Checking if Script is Already Running
    user477000 Explorer
    Currently Being Moderated
    You might set specific action or client info in dbms_application_info and then eventually look for it.
    The other option is using global context or a table.

    BTW, I'd move it to procedure itself (to let it being processed just once) or consider using queues/scheduler_jobs.

    You have not mentioned which DB version you're using.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points