Oracle11g DBMS_调度程序运行exe

Oracle11g DBMS_调度程序运行exe,oracle11g,job-scheduling,dbms-scheduler,Oracle11g,Job Scheduling,Dbms Scheduler,我的oracle数据库名为IRECSDEV,即用户FTREC 我的电脑名是DEVSERVER1,Windows用户是WWLSERVER 我正在尝试使用Oracle远程代理从DBMS_调度程序运行calc.exe。 我已经安装了Oracle远程代理,我将其命名为schagent,并将其端口设置为15021 对于数据库端口,我设置了16021: DBMS_XDB.sethttpport(16021); 我注册数据库: set ORACLE_SID=IRECSDEV cd C:\app\WWLS

我的oracle数据库名为IRECSDEV,即用户FTREC 我的电脑名是DEVSERVER1,Windows用户是WWLSERVER 我正在尝试使用Oracle远程代理从DBMS_调度程序运行calc.exe。 我已经安装了Oracle远程代理,我将其命名为schagent,并将其端口设置为15021 对于数据库端口,我设置了16021:

DBMS_XDB.sethttpport(16021);
我注册数据库:

 set ORACLE_SID=IRECSDEV
 cd C:\app\WWLSERVER\product\11.2.0\tg_1\bin schagent -registerdatabase DEVSERVER1 16021
schagent.conf是:

# This is the configuration file for the Oracle Scheduler Agent.
#
# The agent will look first for schagent.conf in {EXECUTION_AGENT_DATA} and then
# in {EXECUTION_AGENT_HOME}. It will only use whichever is found first and
# throw an error if none is found.
#
# You can change these values to suit your environment.

# network port to listen on for requests (between 1 and 65536)
PORT=15021

# host name of the host the agent is running on. If this is not specified,
# the resolved name of the local address will be used
HOST_NAME = DEVSERVER1

# if this is set, then databases will use this as the name of the agent
# destination object for this agent. This must be a valid database object name.
# If this is not set then databases will use the first part of the hostname
# (before the first period) or an automatically generated name.
# AGENT_NAME=schagent

# maximum number of jobs to run simultaneously (between 1 and 1000)
MAX_RUNNING_JOBS=5

# if this is set to TRUE, the agent will reject put_file requests   
DISABLE_PUT_FILE=FALSE

# if this is set to TRUE, the agent will reject get_file requests
DISABLE_GET_FILE=FALSE

# if this is set to TRUE, the agent will reject job execution requests
DISABLE_JOB_EXECUTION=FALSE

# the agent will reject any attempt to use any user on this list.
# This list should be comma-separated and is case-insensitive.
DENY_USERS=root,administrator,guest

# if this list is not empty, the agent will only allow use of a user on this
# list. This list should be comma-separated and is case-insensitive.
# ALLOW_USERS=

# if this is set to TRUE, only registered databases will be allowed to submit
# jobs and the agent will only be able to register with database versions 11.2
# or higher. This enforces a higher level of security including encryption of
# job results.
SECURE_DATABASES_ONLY=FALSE

# types of logging to do. Zero or more of the following options:
# OVERVIEW, WARNINGS, ALL, ERROR_STACKS, MILLISECONDS
LOGGING_LEVEL=OVERVIEW,WARNINGS


# There is no need to set these two parameters if you are only using this
# agent to run jobs of type EXECUTABLE.
# If this agent is used to run remote database (PL/SQL block or stored
# procedure) jobs then you can set the following two parameters to
# point to a default database. If a database job is received with no connect
# info, this database will be used to run the job. 
# ORACLE_SID=
# ORACLE_HOME=
所以我创建了凭证

DBMS_SCHEDULER.CREATE_CREDENTIAL('WWLSERVER','WWLSERVER','myPassword',null,null,null);
然后我创造了一份工作

 BEGIN
   DBMS_SCHEDULER.create_job
 (
  job_name => 'EXE3',
  job_type => 'EXECUTABLE',
  number_of_arguments => 2,
  job_action => 'C:\windows\system32\cmd.exe',
  auto_drop => FALSE,
  enabled => FALSE
 );
 DBMS_SCHEDULER.set_job_argument_value('EXE3',1,'/c');
 DBMS_SCHEDULER.set_job_argument_value('EXE3',2,'C:\Users\WWLSERVER\Desktop\test.bat');
 DBMS_SCHEDULER.set_attribute('EXE3', 'credential_name','WWLSERVER');
 DBMS_SCHEDULER.set_attribute('EXE3', 'destination','DEVSERVER1:15021');
 DBMS_SCHEDULER.enable('EXE3');
 END;
test.bat文件是:

 echo off  
 SET ORACLE_HOME=C:\app\WWLSERVER\product\11.2.0\dbhome_1  
 SET ORACLE_SID=IRECSDEV  
 c:\windows\System32\calc.exe  
 echo on  
当我尝试启用或运行作业EXE3时,它正在运行,但失败,出现错误255和其他信息:外部日志ID=job\u 145518\u 24,用户名=WWLSERVER

你知道我做错了什么吗? Oracle版本:11.2.0.1.0
OS Windows Server 2008

是否确实要从数据库启动GUI?您是否已选中“允许服务与桌面交互”以获得相关服务?我不想使用服务,原因有几个。我认为这是无法避免的,Oracle作为服务运行。我构建了一个服务,使用不同的方法几乎可以正常工作。但我想使用图书馆的一些图形特征,而使用服务是不可能的。所以我想运行一个exe。它不会有一个可视化的界面,但它会做我想要的