Home » SQL & PL/SQL » SQL & PL/SQL » Running Shell Scripts through Pl/Sql Procedures
Running Shell Scripts through Pl/Sql Procedures [message #187395] Sun, 13 August 2006 06:00 Go to next message
sarfraz_attari
Messages: 123
Registered: July 2005
Senior Member
Dear all

I have one Shell script on my linux server which is as follows :

Repl_Order.sh

#!/usr/bin/ksh

sqlplus -s whadmin/whadminpass@prttest << EOF
set pagesize 0
set linesize 200
set head off
set timing on

execute repl;

exit;

EOF

Is it possible to run this script through PL/SQL procedure
or from SQL Prompt of clients

Thanks

Sarfraz

Re: Running Shell Scripts through Pl/Sql Procedures [message #187407 is a reply to message #187395] Sun, 13 August 2006 12:56 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>Is it possible to run this script through PL/SQL procedure
Yes, by using External Procedures
>or from SQL Prompt of clients
yes, by using HOST command

But WHY?????????????? go outside the database just to invoke a script that interacts with the DB (again)?????
Re: Running Shell Scripts through Pl/Sql Procedures [message #187430 is a reply to message #187407] Mon, 14 August 2006 00:23 Go to previous messageGo to next message
sarfraz_attari
Messages: 123
Registered: July 2005
Senior Member
Write me the exact host command to run the following linux command from sql prompt as i want to run this script as a background process

$ nohup sh repl_order.sh &

thanks

Re: Running Shell Scripts through Pl/Sql Procedures [message #187468 is a reply to message #187430] Mon, 14 August 2006 02:38 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you want to run it as a background process, just run it using DBMS_JOB.
There really is no point adding complexity to your problems.
Re: Running Shell Scripts through Pl/Sql Procedures [message #187504 is a reply to message #187468] Mon, 14 August 2006 04:36 Go to previous message
sarfraz_attari
Messages: 123
Registered: July 2005
Senior Member
Can u give me some example of how i can run my stored procedure as background process of linux from any client
Previous Topic: XMLQuery bug?
Next Topic: TRUNCATE
Goto Forum:
  


Current Time: Thu Dec 08 19:55:28 CST 2016

Total time taken to generate the page: 0.11636 seconds