Creating job—targeting Unix
There is much similarity between the familiar local external jobs and the new remote external jobs. The main difference is the destination attribute that has to be used for remote external jobs. Here we simply specify the HOST_NAME:PORT
combination that we used at the agent's installation time. Let's see what happens when we run the first script to see what is in the job's environment:
--/ BEGIN DBMS_SCHEDULER.create_job( job_name => 'env', job_type => 'EXECUTABLE', job_action => '/tmp/test.sh', auto_drop => FALSE, enabled => FALSE ); DBMS_SCHEDULER.set_attribute('env', 'credential_name', 'JOBS_CRED2'); DBMS_SCHEDULER.set_attribute('env', 'destination', 'pantzer:15021'); DBMS_SCHEDULER.enable('env'); END; /
As soon as we enable the job, it is executed. In the schedulerjob_run_details
view, the ADDITIONAL_INFO column displays the filename where the agent stored the output for the job as shown in the following screenshot:
This job output can be found...