Run exe from DBMS_SCHEDULER

可紊 提交于 2020-01-04 14:11:12

问题


I am kind of new in DMBS_SCHEDULER and I face some problems.
I want to run an .exe
So I created a Job:

begin
   sys.dbms_scheduler.create_job(job_name            => 'FTREC.EXE_1',
                            job_type            => 'EXECUTABLE',
                            job_action          => 'C:\Windows\System32\calc.exe',
                            start_date          => to_date(null),
                            repeat_interval     => '',
                            end_date            => to_date(null),
                            job_class           => 'IRECS_JOB_CLASS',
                            enabled             => false,
                            auto_drop           => false,
                            comments            => '');
end;

I have also created credentials :

DBMS_SCHEDULER.CREATE_CREDENTIAL('WWLSERVER','WWLSERVER','1234',null,null,null);

And I applied the credentials to my job

dbms_scheduler.set_attribute('FTREC.EXE_1', 'credential_name', 'WWLSERVER');

But when I try to run my Job I get this error:

EXTERNAL_LOG_ID="job_255737_183883",
ORA-27369: job of type EXECUTABLE failed with exit code: The extended attributes are inconsistent.

What I am doing wrong?


回答1:


Credentials were not available in 10g. There are no mentions of the word "credential" in the DBMS_SCHEDULER documentation.

I was able to run your code in 12c. But running calc.exe created an un-killable session, I had to restart the database. Things went much better when I used a simple .bat file for testing.

This thread on the Oracle Forums has methods for running an external program on 10g.



来源:https://stackoverflow.com/questions/19710126/run-exe-from-dbms-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!