数据库
首页 > 数据库> > oracleshell执行新医保数据转换后台

oracleshell执行新医保数据转换后台

作者:互联网

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

标签:bin,log,text,sw,医保,oracleshell,sql,后台,public
来源: https://blog.csdn.net/viviliving/article/details/115026664