Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Run command on sqlplus repetitively without reconnection.

RE: Run command on sqlplus repetitively without reconnection.

From: Thotangare, Ajay \(GTI\) <Ajay_Thotangare_at_ml.com>
Date: Wed, 9 May 2007 12:29:08 -0400
Message-ID: <C8C1CE9973039245BF52C0FC3DF02F60C5C83A@MLNYA222MB.amrs.win.ml.com>


Hi,  

I don't want constant re-connection. I want to use this logic and fire some queries every secs during certain period for proactive monitoring. making so many connections is not acceptable.  

regards,

Ajay


From: Pal, Raj [mailto:Raj.Pal_at_echostar.com] Sent: Wednesday, May 09, 2007 11:43 AM
To: Thotangare, Ajay (GTI)
Subject: RE: Run command on sqlplus repetitively without reconnection.  

I don't really know why you don't want to reconnect... but you might consider a plsql loop that includes a "!sleep" after your command.  

Does that make sense?



RAJ_at_EchoStar.com <mailto:RAJ.PAL_at_EchoStar.com>

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Thotangare, Ajay (GTI)
Sent: Wednesday, May 09, 2007 9:23 AM
To: oracle-l_at_freelists.org
Subject: Run command on sqlplus repetitively without reconnection.  

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 <http://www.ml.com/email_terms/> for important additional terms relating to this e-mail. http://www.ml.com/email_terms/


--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 09 2007 - 11:29:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US