It will still do reconnection regards, Ajay -----Original Message----- From: Thomas A. La Porte [mailto:Thomas.LaPorte@xxxxxxxxxxxxxx] Sent: Wednesday, May 09, 2007 12:03 PM To: Thotangare, Ajay (GTI) Cc: oracle-l@xxxxxxxxxxxxx Subject: Re: Run command on sqlplus repetitively without reconnection. Could you eliminate the 'exit;' statement and move the 'sleep 2' up before the EOF and call it as 'host sleep 2' ?? while true do sqlplus -S "/as sysdba" <<EOF select event,count(*) from v$session group by event; host sleep 2 EOF done On Wed, 9 May 2007, Thotangare, Ajay (GTI) wrote: > I want to run a command on sqlplus without making re-connection. At the > same time I also want to see the output. > > I can do this using UNIX but only problem is I have to make reconnection > after every interval(which I don't want) > > For e.g I run following script on unix prompt > > ######################################################### > > while true > > do > > sqlplus -S "/as sysdba" <<EOF > > select event,count(*) from v$session group by event; > > exit; > > EOF > > sleep 2 > > done > > ######################################################### > > I want to achive same functionality without making reconnection after > every 2 secs. > > I tried to use loop,spool file and dbms_lock.sleep() but spool file does > not display output till the procedure is completed > > Can anybody help to achive this functionality ? > > > > regards, > > Ajay > -------------------------------------------------------- > > If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ > -------------------------------------------------------- > -- //www.freelists.org/webpage/oracle-l