Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Run command on sqlplus repetitively without reconnection.
Hi Siva,
I thanked to everybody in my earlier response. Once again thanks a lot to you.
regards,
Ajay
From: Siva Valiveru [mailto:SValiveru_at_looksmart.net]
Sent: Wednesday, May 09, 2007 6:34 PM
To: Ron.Reidy_at_arraybiopharma.com; Thotangare, Ajay (GTI); Jared Still
Cc: Pal, Raj; oracle-l_at_freelists.org
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_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Reidy, Ron
Sent: Wednesday, May 09, 2007 2:37 PM
To: Ajay_Thotangare_at_ml.com; Jared Still
Cc: Pal, Raj; oracle-l_at_freelists.org
Subject: RE: Run command on sqlplus repetitively without reconnection.
You should pay him :D
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 2:29 PM
To: Jared Still
Cc: Pal, Raj; oracle-l_at_freelists.org
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_at_gmail.com]
Sent: Wednesday, May 09, 2007 3:55 PM
To: Thotangare, Ajay (GTI)
Cc: Pal, Raj; oracle-l_at_freelists.org
Subject: Re: Run command on sqlplus repetitively without reconnection.
On 5/9/07, Thotangare, Ajay (GTI) <Ajay_Thotangare_at_ml.com> 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 EvangelistReceived on Wed May 09 2007 - 19:26:31 CDT
_____
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. -- http://www.freelists.org/webpage/oracle-l