E
Oracle. executublespecified in external jobDirectly, i.e. without a shell and an empty environment.
From https://ru.stackoverflow.com/questions/558541/%d0%9d%d0%b5-%d0%b7%d0%b0%d0%bf%d1%83%d1%81%d0%ba%d0%b0%d0%b5%d1%82%d1%81%d1%8f-sqlplus-%d1%87%d0%b5%d1%80%d0%b5%d0%b7-external-jobs-linux-oracle11-2-0-4/562665#comment724350_558541 : Replaced sqlplus on the scruple softball, which sets variables and starts a real sqlplus. I don't want to leave such a crutch, I want a beautiful solution.That's the right thing to do.Or it is possible to create a universal task of launching a squeak login reading, and then to launch the desired programme (or even built-in, function, etc.): begin
dbms_scheduler.create_job (
job_name => '"SH1"."shell_exec"',
job_type => 'EXECUTABLE',
job_action => '/bin/bash',
number_of_arguments => 2,
start_date => to_date('2099','yyyy'),
repeat_interval => NULL,
end_date => NULL,
enabled => false,
auto_drop => false,
comments => 'execute some command in bash');
dbms_scheduler.set_job_argument_value(
job_name => '"SH1"."shell_exec"',
argument_position => 1,
argument_value => '-lc');
dbms_scheduler.set_job_argument_value(
job_name => '"SH1"."shell_exec"',
argument_position => 2,
argument_value => 'env > ~/env.out; echo "env ok" >/dev/stderr; exit 0');
dbms_scheduler.enable('"SH1"."shell_exec"');
end;
/
exec sys.dbms_scheduler.run_job('"SH1"."shell_exec"');
B ~/env.out Removal of the full user environment, not interactive logic.Another example of launching and looking at the venting of errors: begin
dbms_scheduler.set_job_argument_value(
job_name => '"SH1"."shell_exec"',
argument_position => 2,
argument_value => 'echo "try some command here" >/dev/stderr ; exit 0');
dbms_scheduler.run_job('"SH1"."shell_exec"');
end;
/
select additional_info from dba_scheduler_job_run_details where job_name = 'shell_exec';
ADDITIONAL_INFO
STANDARD_ERROR="env ok"
STANDARD_ERROR="try some command here"
Chapter https://docs.oracle.com/cd/B28359_01/server.111/b28310/schedover004.htm#BGBDCCCE other things describe how to identify the user and group with which the task will be launched.