Failed using DBMS_PIPE (calls to shell scripts)
Hi there!
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
--
dbms_pipe.pack_message (p_command);
--
l_status := dbms_pipe.send_message ('host_command');
--
IF l_status <> 0 THEN
erm := 'Error : ' || TO_CHAR (l_status) || ' sending on pipe';
RAISE err;
END IF;
--
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 8.1.7.4.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?
Regards