Is there any way to flush output from PL/SQL in Oracle?

后端 未结 6 1092
情深已故
情深已故 2020-11-29 06:02

I have an SQL script that is called from within a shell script and takes a long time to run. It currently contains dbms_output.put_line statements at various po

6条回答
  •  伪装坚强ぢ
    2020-11-29 06:55

    If you have access to system shell from PL/SQL environment you can call netcat:

     BEGIN RUN_SHELL('echo "'||p_msg||'" | nc '||p_host||' '||p_port||' -w 5'); END;
    

    p_msg - is a log message v_host is a host running python script that reads data from socket on port v_port.

    I used this design when I wrote aplogr for real-time shell and pl/sql logs monitoring.

提交回复
热议问题