Home » RDBMS Server » Server Administration » DBMS_SCHEDULER Problem
DBMS_SCHEDULER Problem [message #208564] Mon, 11 December 2006 06:00 Go to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
I am trying to schedule a export a test schema by using batch file which contains the following entry in 10g Win2000 environment

expdp system/gateway dumpfile=expfile:test.dmp schemas=test logfile=expfile:log1.log

i want to schedule the job by dbms_scheduler

begin
dbms_scheduler.create_job
(
job_name => 'JOB1',
job_type => 'EXECUTABLE',
job_action => 'c:\backup.bat',
enabled => true,
start_date => trunc(sysdate,'HH'),
repeat_interval =>'FREQ=HOURLY;interval=1',
comments => 'Run shell-script'
);
end;

i got the Error

ORA-12012: error on auto execute of job 53318
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.

then i tried the following

begin
dbms_scheduler.create_job
(
job_name => 'JOB1',
job_type => 'EXECUTABLE',
job_action => 'c:\backup.bat>nul',
enabled => true,
start_date => trunc(sysdate,'HH'),
repeat_interval =>'FREQ=HOURLY;interval=1',
comments => 'Run shell-script'
);
end;
The error is disappeared but the job is still not running and then i tried the following
begin
dbms_scheduler.create_job
(
job_name => 'JOB1',
job_type => 'EXECUTABLE',
job_action => 'c:\windows\system32\cmd.exe /c c:\backup.bat>nul',
enabled => true,
start_date => trunc(sysdate,'HH'),
repeat_interval =>'FREQ=HOURLY;interval=1',
comments => 'Run shell-script'
);
end;

Errors in file d:\oracle\product\10.2.0\admin\orcl\bdump\orcl_j000_2132.trc:
ORA-12012: error on auto execute of job 53369
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with status: 233
ORA-27301: OS failure message: No process is on the other end of the pipe.
ORA-27302: failure occurred at: sjsec 9
ORA-27303: additional information: No process is on the other end of the pipe.

I had also tried this
begin

dbms_scheduler.create_job('test_job',
job_action=>'C:\WINDOWS\SYSTEM32\CMD.EXE',
number_of_arguments=>3,
job_type=>'executable', enabled=>false);
dbms_scheduler.set_job_argument_value('test_job',1,'/q');
dbms_scheduler.set_job_argument_value('test_job',2,'/c');
dbms_scheduler.set_job_argument_value('test_job',3,'c:\backup.bat');
dbms_scheduler.enable('test_job');
end;

i had tried all the possibilities but still not succeeded
i am hopful to get the solution by putting the query on this forum
Can anybody help me in this regard
Thanx in advance
Re: DBMS_SCHEDULER Problem [message #208609 is a reply to message #208564] Mon, 11 December 2006 09:20 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member


Try something like this and see if you still have the same problem

begin
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'cmd_test',
job_type => 'executable',
job_action => 'C:\WINNT\SYSTEM32\cmd.exe /c dir c:\ > c:\test.out',
start_date => systimestamp,
enabled => true
);
end;
/

[Updated on: Mon, 11 December 2006 09:21]

Report message to a moderator

Re: DBMS_SCHEDULER Problem [message #208614 is a reply to message #208564] Mon, 11 December 2006 09:26 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

oops sry about the cmd path
Re: DBMS_SCHEDULER Problem [message #208619 is a reply to message #208564] Mon, 11 December 2006 09:36 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Also

Since I can't reproduce this, havent got a windows install.
But I have read that there should be an Job Scheduler as a service in windows that must be started(services.msc).

Can you verify that ?
Re: DBMS_SCHEDULER Problem [message #209008 is a reply to message #208619] Tue, 12 December 2006 22:36 Go to previous messageGo to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
Dear Sir
JobScheduler is running fine
Re: DBMS_SCHEDULER Problem [message #209009 is a reply to message #208609] Tue, 12 December 2006 22:39 Go to previous messageGo to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
tahpush wrote on Mon, 11 December 2006 09:20

Try something like this and see if you still have the same problem

begin
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'cmd_test',
job_type => 'executable',
job_action => 'C:\WINNT\SYSTEM32\cmd.exe /c dir c:\ > c:\test.out',
start_date => systimestamp,
enabled => true
);
end;
/



can u give me explaination about c:\test.out'
Sorry i was unable to understand

Best Regards,
Re: DBMS_SCHEDULER Problem [message #209047 is a reply to message #209009] Wed, 13 December 2006 01:27 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member


if you run commandprompt
go to c:\windows\system32\
and type "dir" you get a list of all the files and folder

that will go into the test.out file
Previous Topic: Intermediate Commit
Next Topic: ORA-04052: error occurred when looking up remote object REPADMIN.SYS@DB
Goto Forum:
  


Current Time: Thu Dec 08 18:12:37 CST 2016

Total time taken to generate the page: 0.08511 seconds