RE: Run command on sqlplus repetitively without reconnection.

  • From: "Thotangare, Ajay \(GTI\)" <Ajay_Thotangare@xxxxxx>
  • To: "Siva Valiveru" <SValiveru@xxxxxxxxxxxxx>, <Ron.Reidy@xxxxxxxxxxxxxxxxxx>, "Jared Still" <jkstill@xxxxxxxxx>
  • Date: Wed, 9 May 2007 20:26:31 -0400

Hi Siva,

 

I thanked to everybody in my earlier response. Once again thanks a lot
to you.

 

regards,

Ajay

  _____  

From: Siva Valiveru [mailto:SValiveru@xxxxxxxxxxxxx] 
Sent: Wednesday, May 09, 2007 6:34 PM
To: Ron.Reidy@xxxxxxxxxxxxxxxxxx; Thotangare, Ajay (GTI); Jared Still
Cc: Pal, Raj; oracle-l@xxxxxxxxxxxxx
Subject: RE: Run command on sqlplus repetitively without reconnection.

 

I did not get my 'Thanks' :-)

 

Looks like my response to oracle-l is not coming thru. Let me try one
more time.

 

------------------

 

There are several flaws in my script(no exception block etc) I am just
trying to give you skeleton script, you can improve the script from
here.

 

create or replace directory dir_temp as '/var/tmp/';

 

declare
f utl_file.file_type;
begin
f := utl_file.fopen('DIR_TEMP', 'system_events.log', 'w');
while ( 1=1) loop
utl_file.put_line(f,to_char(sysdate,'YYYY/MON/DD HH24:MI:SS')||chr(10));
for x in ( select event,count(*) acount from v$session group by event)
loop
  utl_file.put_line(f, x.event||' --> '||x.acount);
end loop;
utl_file.fflush(f);
dbms_lock.sleep(60);
utl_file.put_line(f,to_char(sysdate,'YYYY/MON/DD HH24:MI:SS')||chr(10));
for x in ( select event,count(*) acount from v$session group by event)
loop
  utl_file.put_line(f, x.event||' --> '||x.acount);
end loop;
end loop;
utl_file.fclose(f);
end;
/

 

  _____  

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Reidy, Ron
Sent: Wednesday, May 09, 2007 2:37 PM
To: Ajay_Thotangare@xxxxxx; Jared Still
Cc: Pal, Raj; oracle-l@xxxxxxxxxxxxx
Subject: RE: Run command on sqlplus repetitively without reconnection.

You should pay him :D

 

  _____  

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

 

Sorry for me not being specific in explaining my problem. Also sorry if
my language gave same wrong impression.

I think the latest solution using UTL_FILE from Siva Valiveru works for
me.

Thanks everybody for your support.

 

  _____  

From: Jared Still [mailto:jkstill@xxxxxxxxx] 
Sent: Wednesday, May 09, 2007 3:55 PM
To: Thotangare, Ajay (GTI)
Cc: Pal, Raj; oracle-l@xxxxxxxxxxxxx
Subject: Re: Run command on sqlplus repetitively without reconnection.

 

 

On 5/9/07, Thotangare, Ajay (GTI) <Ajay_Thotangare@xxxxxx> wrote:

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.


Most knowledgeable folks are willing to help.

They usually are not willing however to guess about your 
intent, platform, Oracle versions, etc..

http://www.catb.org/~esr/faqs/smart-questions.html


-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist 

  _____  

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: