Failed using DBMS_PIPE (calls to shell scripts)
I have failed to execute UNIX commands from ORACLE using DBMS_PIPE.
When I am attempting to run the following code (nothing too cleaver):
p_command := ‘cp /rims/live/bespoke/a.lis /rims/live/bespoke/a.lis.copied’;
dbms_pipe.pack_message (dbms_pipe.unique_session_name); -- return pipe
l_status := dbms_pipe.send_message ('host_command');
IF l_status <> 0 THEN
erm := 'Error : ' || TO_CHAR (l_status) || ' sending on pipe';
nothing happened, i.e. UNIX copy command does not generated the new file ‘a.lis.copied’.
I have been granted execute access to DBMS_PIPE.
I am on Oracle8i 126.96.36.199.0.
What am I doing wrong?
To step further, I am bit puzzled how oracle knows am I requesting the execution of a system command, PL/SQL procedure or a SQL query (syntax wise)?
How can we see in which session would show up the result of our piped PL/SQL or SQL commands?
Could I send DBMS_ALERT’s directly to UNIX or have to call implicitly DBMS_PIPE?
Followed it to the letter, copied and passed it, without success. Being silly may be, but this could more serious DBA issue?
where is your program that is reading the stuff from the pipe?
As soon as someone says have somethig outside the DB server you loose me
This is what I do: http://www.oracle-base.com/articles/...sFromPLSQL.php
Simple Java stored procedure. Job done!
If you are using 10g you can just create a one-off job using DBMS_SCHEDULER to run an OS executable, script or command.
Job done another way!
Last edited by TimHall; 06-30-2005 at 02:48 AM.
This time copied and passed everything from this web site
http://www.uaex.edu/srea/daemon.sql the daemon package.
Run it on the server again without any success.
ERROR at line 1:
ORA-20011: Execute_system: Error while receiving.
Status = 1
ORA-06512: at "RIMS.DAEMON", line 26
ORA-06512: at line 30
I tested with this script the daemon.execute_system function :
SET SERVEROUTPUT ON SIZE 100000
SET PAGES 5000
SET LINESIZE 160
l_line := 'cp /rims/live/bespoke/viktor/bloomberg/a.lis /rims/live/bespoke/viktor/bloomberg/a.lis.de';
l_status := daemon.execute_system (l_line);
Click Here to Expand Forum to Full Width