赞
踩
select LinxRUNCMD('/data05/sql/exec.sh /data05/sql/test.sql') cmd from dual;
exec.sh
- #!/usr/bin/bash
- source ~/.bash_profile
- echo $1
- date>$1.log
- /usr/bin/nohup /u01/app/oracle/product/12.1.0/db_1/bin/sqlplus hsa_lzjbsi/hsa_lzjbsi@192.168.217.192/ORCLPDB1 @$1 >>$1.log 2>&1 &
- cat $1.log
-
test.sql
- set serveroutput on
- declare
- prm_appcode number;
- prm_errmsg varchar2(1000);
- begin
- -- Call the procedure
- dbms_output.put_line(sysdate);
- end;
- /
-
linux
- create or replace and compile java source named "LinxUtilvivi" as
- import java.io.*;
- public class LinxUtilvivi extends Object
- {
- public static String getExceptionText(Exception e){
- String text = "" ;
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- e.printStackTrace(pw);
- text = sw.toString();
- return text;
- }
- public static Stri
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。