sul-dlss / libsys-webforms

Rails applications for various Symphony reporting & updating tools.
1 stars 2 forks source link

Ability to kick off an Oracle job #405

Closed dlrueda closed 7 years ago

dlrueda commented 7 years ago

The procedure is REPORTS_MISC.schedule_proc_run_now:


procedure schedule_proc_run_now(

 -- For the equivalent of running an exec command from the SQL command
 -- prompt, cmd_to_exec is exactly all the text that would be after "exec "
 -- DO NOT INCLUDE PARENTHESES IN cmd_to_exec IF NOT NEEDED FOR ARGS.
 cmd_to_exec    in varchar2)

If from the SQL prompt you would run: SQL> exec circ_stats_rpt.daily_processing then the web forms app would run: reports_misc.schedule_proc_run_now('circ_stats_rpt.daily_processing');

If from the SQL prompt you would run: SQL> exec delphi_pay.debug_run('regular') then the web forms app would run: reports_misc.schedule_proc_run_now('delphi_pay.debug_run(''regular'')');

Those are consecutive single quotes around regular above, as SQL's escape. I don't know if the quotes need to be handled differently in Rails. You can experiment, and if the quotes format doesn't work for the scheduler, look in VND_RUNLOG for the error message; the NOTE will show what cmd_to_exec string was actually delivered to the procedure.

I had to test this on LTRXPRD1/Bodoni, because ORA_SUL on LTRXDEV1/Morison doesn't have permission to add Oracle scheduler entries. Testing will be easier if Julian can make LTRXDEV1's scheduler available (but first make sure it doesn't have any jobs scheduled).

dlrueda commented 7 years ago

Each job will have a "band" on the main libsys-webforms page. Each job has a list of specific SUNetIDs that can run it.

Consider using a settings file so easy to add when new jobs are needed.

jgreben commented 7 years ago

closed by #408