[英]How to call a shell script from PLSQL program
能告诉我如何从PLSQL程序调用shell脚本吗?
You have a couple of options available: 您有几个选择:
And a forth way (on top of Pablo's) dbms_pipe 并且第四种方式(在Pablo的顶部) dbms_pipe
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:16212348050 http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:16212348050
In Oracle7.0 and up, we can use dbms_pipes to talk to a daemon running outside the database.
在Oracle7.0及更高版本中,我们可以使用dbms_pipes与在数据库外部运行的守护进程通信。 Here is a simple example that uses sqlplus to be the daemon:
这是一个使用sqlplus作为守护进程的简单示例:
create or replace procedure host( cmd in varchar2 )
as
status number;
begin
dbms_pipe.pack_message( cmd );
status := dbms_pipe.send_message( 'HOST_PIPE' );
if ( status <> 0 ) then raise_application_error( -20001, 'Pipe error' );
end if;
end;
/
Invoking a shell script from PL/SQL using DBMS_SCHEDULER: Please find the link below 使用DBMS_SCHEDULER从PL / SQL调用shell脚本:请在下面找到链接
http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm
Not listed above, but still applicable: C Code direct library from PL/SQL from Ask Tom . 上面没有列出,但仍然适用: 来自Ask Tom的 PL / SQL的C代码直接库。 Obviously it would be an execution of a C Wrapper to call out to the Shell script.
显然,执行C包装器来调用Shell脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.