Home » RDBMS Server » Server Administration » Remote external jobs on Windows (11.2.0.2, Windows)
Remote external jobs on Windows [message #511751] Tue, 14 June 2011 20:35 Go to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
I cannot run a Scheduler remote external job on Windows. Here's what I'm doing:
--Check that XDB isinstalled:
desc resource_view

--Check that MTS is running
sho parameters dispatcher
sho parameters shared_Server

--Setup an http listening port:
exec dbms_xdb.sethttpport(8080)

--Check that the port has registered with the listener
lsnrctl status

--Install the remote scheduler code
@?\rdbms\admin\prvtrsch.plb

--Set a password for the agent
exec DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('mypassword');

--Install the Scheduler agent, from the client CD (default port, 1500)
-- check details in %agenthome%\schagent.conf

--Register the agent with the Scheduler DB:
%agenthome%\bin\schagent -registerdatabase jwdell 8080

--Check that the DB can talk to the agent:
select dbms_scheduler.get_agent_version('jwdell') from dual;

--Create a credential for the remote job:
exec dbms_scheduler.create_credential('my_cred','jwdell\john','pass')

--Create a job:
exec dbms_scheduler.create_job(-
job_name=>'tryit',-
job_type=>'executable',-
job_action=>'dir',-
destination_name=>'jwdell',-
enabled=>false,-
auto_drop=>false,-
credential_name=>'my_cred')

--Run it
exec dbms_scheduler.enable('tryit')

This is the error:
orcl> select job_name, status, error#, actual_start_date, additional_info
  2  from user_scheduler_job_run_details where job_name='TRYIT';

TRYIT
FAILED                         -1.074E+09
15-JUN-11 02.16.54.583000 EUROPE/LISBON
EXTERNAL_LOG_ID="job_75874_7",
USERNAME="jwdell\john",
STANDARD_ERROR="Exception 0xc0000005 encountered at address 0x774D5684
Generating core file .\core_jssu_201161521654.dmp"

I am certain that the communications and the credentials are correct, I've tried variants and get different errors. I think the problem is the job action. I've tried running batch files as well as OS commands, same result. THere is nothing useful in the core dump.
Is there perhaps a Windows specific technique for running external jobs? Some way of nominating the batch file, or specifying a command interpreter?
Any other suggestions?
Re: Remote external jobs on Windows [message #511752 is a reply to message #511751] Tue, 14 June 2011 21:20 Go to previous message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Following a suggestion, I've tried this syntax where I nominate a file:
exec dbms_scheduler.create_job(-
job_name=>'tryit',-
job_type=>'executable',-
job_action=>'c:\windows\system32\cmd.exe',-
number_of_arguments => 2,-
destination_name=>'jwdell',-
enabled=>false,-
auto_drop=>false,-
credential_name=>'my_cred')

exec dbms_scheduler.set_job_argument_value('tryit',1,'/c');
exec dbms_scheduler.set_job_argument_value('tryit',2,'dir');

This syntax corresponds to note 1074141.1.
But still the same error.
I also get the same error when running this as a local external job.
Does anyone have a working example of external jobs for Windows? I had no problem with this on Linux.
Previous Topic: SCN CYCLE
Next Topic: Simple editing of initDB.ora
Goto Forum:
  


Current Time: Wed May 01 23:36:05 CDT 2024