Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Having trouble getting a job to run using job scheduler

877378Jul 22 2011 — edited Jul 22 2011
I am using Oracle 11g. I run a sql script that schedules a job:
exec sys.dbms_scheduler.create_job( job_name => '"SYSTEM"."UCR"', job_type => 'EXECUTABLE', job_action => 'D:\UserCountReport\bin\ucr.bat', repeat_interval => 'FREQ=HOURLY;BYHOUR=3;BYMINUTE=0;BYSECOND=0',start_date => to_timestamp_tz('2011-07-21 US/Eastern', 'YYYY-MM-DD TZR'), job_class => 'DEFAULT_JOB_CLASS', auto_drop => FALSE,enabled => FALSE);
exec sys.dbms_scheduler.set_attribute( name => '"SYSTEM"."UCR"',  attribute => 'job_weight',  value => 1);
exec sys.dbms_scheduler.enable( '"SYSTEM"."UCR"' );
commit;
exit;
When I am connected to the database, I run these commands:
SQL> SELECT JOB_NAME, STATE, job_action, repeat_interval FROM DBA_SCHEDULER_JOBS
 where job_name='UCR';

JOB_NAME
--------------------------------------------------------------------------------

STATE
---------------------------------------------
JOB_ACTION
--------------------------------------------------------------------------------

REPEAT_INTERVAL
--------------------------------------------------------------------------------

UCR
SCHEDULED
C:\UserCountReport\bin\ucr.bat
FREQ=HOURLY;BYHOUR=9;BYMINUTE=0;BYSECOND=0


SQL> SELECT JOB_NAME, status FROM DBA_SCHEDULER_JOB_LOG where job_name = 'UCR';

JOB_NAME
--------------------------------------------------------------------------------

STATUS
--------------------------------------------------------------------------------

UCR
SUCCEEDED

UCR
SUCCEEDED

UCR
SUCCEEDED
However, I don't get any signs that the job has run even though Oracle says all the runs have succeeded. The batch file that the job is supposed to execute creates a file and writes stuff to it. However, the file is not written. When I run the batch file from command prompt, it executes correctly.

I have tried following instructions here:
648581

However, all three of these commands return errors:
SQL> select value from v$parameter where name='job_queue_processes';
select value from v$parameter where name='job_queue_processes'
                  *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select count(*) from dba_scheduler_running_jobs;
select count(*) from dba_scheduler_running_jobs
                     *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select count(*) from dba_jobs_running;
select count(*) from dba_jobs_running
                     *
ERROR at line 1:
ORA-00942: table or view does not exist
I've tried various other commands from that list and I get errors as well.

I'm not quite sure where to go from here to troubleshoot this problem. Any help would be appreciated. Thanks.

Edited by: 874375 on Jul 22, 2011 9:14 AM

Edited by: 874375 on Jul 22, 2011 9:18 AM
This post has been answered by Centinul on Jul 22 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2011
Added on Jul 22 2011
5 comments
900 views