run shell script from oracle store procedure


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting run shell script from oracle store procedure
# 1  
Old 08-09-2006
run shell script from oracle store procedure

hi,

this is urgent..can i run a shell script from store procedure without using java.
# 2  
Old 08-09-2006
You can with external procedure calls but it's not as simple as invoking a built-in system procedure.
  1. Create a shared library with C (.so file)
  2. Create a library in PL/SQL (e.g. CREATE OR REPLACE LIBRARY xyz AS '/path/your.so')
  3. Create a PL/SQL interface that uses the library (e.g. CREATE OR REPLACE FUNCTION ... RETURN ... EXTERNAL LIBRARY xyz NAME "your_c_function" LANGUATE C;
  4. Update your TNSNAMES.ORA to allow external procedure calls
  5. Update your listener.ora to allow for external procedure calls
However, having said that, it's probably easier using Java.

Last edited by tmarikle; 08-09-2006 at 01:16 PM..
# 3  
Old 08-10-2006
can i do this without any lang..
# 4  
Old 08-10-2006
check out these links....where you will get no of methods...

shell script from oracle
other one
# 5  
Old 08-10-2006
The Java solution is simply the best cut it requires specific grants to run various UNIX commands. The first solution using DBMS_PIPE requires that you keep sqlplus resident on a UNIX server for however long that you wish to access UNIX OS commands.
# 6  
Old 08-14-2006
Yes tmarikle you are right Java solution can be considered as best solution and widely used.
# 7  
Old 08-16-2006
Thanx for reps...
but i need to execute this without any help of java or c..
can it possible?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to execute Oracle procedure and trigerring email on success and failure

Here is the shell script which need to trigger a stored procedure and when the record count is 0 then it should capture in the log that 0 duplicate records are found and if it's more than 0 then log with no of records. Also if there is any sqlerror then it should write the same in the log file and... (17 Replies)
Discussion started by: senmng
17 Replies

2. Shell Programming and Scripting

Need to run Oracle stored procedure from UNIX env

Hi Everyone, I want to create a script where i need to run the oracle stored procedure from unix script and get the output(sequence number ) into a variable which i will pass in my datastage job. Below is my stored procedure:- DECLARE P_TRANSTYPE VARCHAR2(20); ... (4 Replies)
Discussion started by: prasson_ibm
4 Replies

3. Shell Programming and Scripting

Run stored procedure from shell script

Hello all, I am trying to run stored procrdure from shell script which takes one argument. And also I want to verify in the script whether the script executed successfully. However the Stored procedure is not running from shell script. Manually if I run it update the data in the table. Can... (29 Replies)
Discussion started by: PriyaSri
29 Replies

4. Shell Programming and Scripting

Execute a shell script from Oracle procedure

Hi Gurus, Want to execute a shell script from a oracle procedure and get the status of the same, any assistance in this regard will be appreciated. proc_data.sh is script name which I want to execute from oracle procedure It should work something like below procedure test begin... (1 Reply)
Discussion started by: palanisvr
1 Replies

5. Shell Programming and Scripting

run oracle procedure in unix scripts

for j in $(du -h $1| awk '{printf("%100-s \n",$2)}') do for a in $(ls -time $(find $j -name '*.txt') | awk '{printf("\n%s %s %s %s %s",$4,$7,$8,$10,$11)}') do echo "$a">output.txt done done exit 0 echo "Password : xxxxxx " > LOG/BGH_$3.out (0 Replies)
Discussion started by: utoptas
0 Replies

6. Shell Programming and Scripting

how to store the return values of stored procedure in unix shell script.

hi i am calling a oracle stored procedure(in the database) from unix shell scripting (a.sh). the called stored procedure returns some values through OUT variables i want to assign the return values of stored procedure in to unix shell script variable. can you provide me the code. ... (1 Reply)
Discussion started by: barani75
1 Replies

7. Shell Programming and Scripting

Shell Script for call a procedure in Oracle DB

Hi everyone! I'm new with Shell Scripting, and I have to do a shell script to call a procedure, which have 2 input parameters, the directory(from server) and the txt file (which have informations to update/insert in DB). I have to create a shell script to execute that procedure for each txt... (5 Replies)
Discussion started by: renatoal
5 Replies

8. Shell Programming and Scripting

Invoking Oracle stored procedure in unix shell script

Here's a shell script snippet..... cd $ORACLE_HOME/bin Retval=`sqlplus -s <<eof $TPDB_USER/april@$TPD_DBCONN whenever SQLERROR exit 2 rollback whenever OSERROR exit 3 rollback set serveroutput on set pages 999 var status_desc char(200) var status_code... (1 Reply)
Discussion started by: hidnana
1 Replies

9. Shell Programming and Scripting

Calling an Oracle Stored Procedure from Unix shell script

hai, can anybody say how to call or to execute an oracle stored procedure in oracle from unix... thanks in advance.... for ur reply.... by, leo (2 Replies)
Discussion started by: Leojhose
2 Replies

10. Shell Programming and Scripting

Store return code of shell script in oracle table

Hi friends, I have to do the following things : 1) there should be a shell script returning the returning the return code of the script. and i have to add some more details like on which machine is has run , at what time and other details and then using plsql i have to add a row to Oracle... (3 Replies)
Discussion started by: sveera
3 Replies
Login or Register to Ask a Question