从DBMS_SCHEDULER运行exe [英] Run exe from DBMS_SCHEDULER

查看:106
本文介绍了从DBMS_SCHEDULER运行exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是DMBS_SCHEDULER的新手,我遇到了一些问题.
我想运行一个.exe
所以我创建了一个工作:

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;

我还创建了凭据:

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

然后我将凭据应用于我的工作

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

但是当我尝试运行我的作业时,出现此错误:

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

我做错了什么?

解决方案

10g中没有凭据.没有提及凭证"一词. DBMS_SCHEDULER文档.

我能够在12c中运行您的代码.但是运行calc.exe创建了一个无法杀死的会话,我不得不重新启动数据库.当我使用简单的.bat文件进行测试时,情况会好得多.

Oracle论坛上的

此线程具有在10g上运行外部程序的方法.

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?

解决方案

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.

这篇关于从DBMS_SCHEDULER运行exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆