RE: Run command on sqlplus repetitively without reconnection.

  • From: "Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx>
  • To: <Ajay_Thotangare@xxxxxx>, "Pal, Raj" <Raj.Pal@xxxxxxxxxxxx>
  • Date: Wed, 9 May 2007 11:40:53 -0600

What is wrong with a PL/SQL loop like an earlier poster suggested?  Or
how about a daemon process written in Perl using DBI and DBD::Oracle?

 

rr

 

________________________________

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Thotangare, Ajay
(GTI)
Sent: Wednesday, May 09, 2007 10:29 AM
To: Pal, Raj
Cc: oracle-l@xxxxxxxxxxxxx
Subject: RE: Run command on sqlplus repetitively without reconnection.

 

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@xxxxxxxxxxxx] 
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@xxxxxxxxxxxx <mailto:RAJ.PAL@xxxxxxxxxxxx>  

________________________________

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Thotangare, Ajay
(GTI)
Sent: Wednesday, May 09, 2007 9:23 AM
To: oracle-l@xxxxxxxxxxxxx
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/

________________________________



This electronic message transmission is a PRIVATE communication which
contains information which may be confidential or privileged. The
information is intended to be for the use of the individual or entity
named above. If you are not the intended recipient, please be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited. Please notify the sender  of the delivery
error by replying to this message, or notify us by telephone
(877-633-2436, ext. 0), and then delete it from your system.

Other related posts: