title: DBMS scheduler oracle - how to execute a procedure
body: <p>I'm loosing my mind. I have a procedure named foo() which takes no arguments. I'd like to execute it, let's say, every 3 minutes. The code I wrote looks like:</p>
  
  <pre><code>BEGIN
      dbms_scheduler.create_job(job_name =&gt; FooJob,
                                    job_type =&gt; 'PLSQL_BLOCK',
                                    job_action =&gt; '
                                                   BEGIN 
                                                    foo();
                                                    END;',
                                    start_date =&gt; SYSTIMESTAMP,
                                    repeat_interval =&gt; 'FREQ=MINUTELY;INTERVAL=3;BYHOUR=17;BYMINUTE=35;',
                                    enabled =&gt; TRUE
                                    comments =&gt; 'A comment.');
  END;
  /
  </code></pre>
  
  <p>This gives me an error: identificator 'applyjobpenalities' should be defined.</p>
  
  <p>I based on this example: <a href="https://stackoverflow.com/questions/1769906/how-to-execute-a-procedure-with-dbms-scheduler-create-job-procedure">How to execute a procedure with DBMS_SCHEDULER.CREATE_JOB procedure</a></p>
  
  <p>Also:</p>
  
  <p>1) How to execute <code>dbms_output.put_line()</code> after execution of foo();? Is it possible to just put this line strightly away?</p>
  
  <p>2) How to check if procedure <code>foo()</code> is (was) executing on behalf of scheduler?</p>
  
  <p><strong>UPDATE:</strong>
  Ok so what I've done is:</p>
  
  <p>1) I typed in SQL Plus 'set serveroutput on'</p>
  
  <p>2) I made a procedure:</p>
  
  <pre><code>create or replace procedure proc1
  IS
  BEGIN
  dbms_output.put_line('sth');
  end;
  /
  </code></pre>
  
  <p>3) I changed scheduler code to:</p>
  
  <pre><code>BEGIN
  dbms_scheduler.create_job(  job_name    =&gt; 'JustATest',
                                  job_type    =&gt; 'PLSQL_BLOCK',
                                  job_action  =&gt; 
                                                      'BEGIN 
                                                      proc1();
                                                      END;',
                                  start_date  =&gt; systimestamp + interval '10' second,
                                  repeat_interval =&gt; 'FREQ=SECONDLY',
                                  enabled     =&gt; TRUE);
  END;
  /
  </code></pre>
  
  <p>But I can't see any result in SQL Plus. What am I missing? Both procedures compiled succesfully and I can see this job when I type:</p>
  
  <pre><code>SELECT * FROM DBA_SCHEDULER_JOBS;
  </code></pre>