Having trouble getting a job to run using Task Scheduler

I'm using Oracle 11 g. I run a sql script that schedules a task:
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 get no sign that the work was performed while Oracle said that all tracks have managed. The batch file that work is supposed to run creates a file and wrote something to him. However, the file is not written. When I run the command prompt batch file, it runs correctly.

I tried following the instructions here:
Answers to "why my jobs are not running?

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 tried several other commands in this list and I get errors as well.

I'm not quite sure where to go here to solve this problem. Any help would be appreciated. Thank you.

Published by: 874375 on July 22, 2011 09:14

Published by: 874375 on July 22, 2011 09:18

See the DBA_SCHEDULER_JOB_LOG view ADDITIONAL_INFO column.

You can also read my post. You will need to provide the cmd.exe to the JOB_ACTION parameter, but the name of the script and other command line parameters (like "/ C") should be added as arguments.

At least that's how I ran with it successfully in the past.

Tags: Database

Similar Questions

Maybe you are looking for