如何从PLSQL程序调用shell脚本

Cha*_*han 9 oracle shell plsql

能告诉我如何从PLSQL程序调用shell脚本吗?

Pab*_*ruz 7

您有几个选择:

  1. 从PL/SQL包装器中调用Java方法.
  2. 从PL/SQL中调用C程序作为外部过程.
  3. 使用新的DBMS_SCHEDULER包.

这是与INFO的链接.


Har*_*son 3

还有第四条路(在巴勃罗的上面) dbms_pipe


http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:16212348050

在Oracle7.0及更高版本中,我们可以使用dbms_pipes与数据库外部运行的守护进程对话。这是一个使用 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;
/
Run Code Online (Sandbox Code Playgroud)