1

Oracle データベースは IRECSDEV、ユーザーは FTREC、PC 名は DEVSERVER1、Windows ユーザーは WWLSERVER、Oracle Remote Agent を使用して DBMS_SCHEDULER から calc.exe を実行しようとしています。
Oracle Remote Agent をインストールしました。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 と追加情報で失敗します: EXTERNAL_LOG_ID="job_145518_24",USERNAME="WWLSERVER"

私が間違ったことをしたアイデアはありますか?
Oracle バージョン:11.2.0.1.0 OS Windows Server 2008

4

0 に答える 0