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: <rajendra.pande_at_ubs.com>
Date: Wed, 9 May 2007 13:00:21 -0400
Message-ID: <5AA6C5BF38D0DA429D0D7B1A07B217480201121D@NSTMC601PEX.ubsamericas.net>


Ajay

If reconnection is your only issue you should the sleep procedure inside sqlplus.
I think it is part of dbms_utility. Not sure. If no one else replies I will in a while.

Thanks

Rajendra Pande
Corporate Center
IT Infrastructure (ITI)
Distributed System Services (DSS)
Database Services  

Tel: +1-201-352 1415
Internal: 19 422 1415

Fax        +1-201-352 68 61  
email      rajendra.pande_at_ubs.com

http://bw.ubs.com/iti/oracle

-----Original Message-----
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 12:11 PM
To: Thomas A. La Porte
Cc: oracle-l_at_freelists.org
Subject: RE: Run command on sqlplus repetitively without reconnection.

It will still do reconnection

regards,
Ajay

-----Original Message-----
From: Thomas A. La Porte [mailto:Thomas.LaPorte_at_dreamworks.com] Sent: Wednesday, May 09, 2007 12:03 PM
To: Thotangare, Ajay (GTI)
Cc: oracle-l_at_freelists.org
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/
> --------------------------------------------------------
>

--
http://www.freelists.org/webpage/oracle-l



























Please do not transmit orders or instructions regarding a UBS account by e-mail. The information provided in this e-mail or any attachments is not an official transaction confirmation or account statement. For your protection, do not include account numbers, Social Security numbers, credit card numbers, passwords or other non-public information in your e-mail. Because the information contained in this message may be privileged, confidential, proprietary or otherwise protected from disclosure, please notify us immediately by replying to this message and deleting it from your computer if you have received this communication in error. Thank you.



UBS Financial Services Inc.

UBS International Inc.

UBS Financial Services Incorporated of Puerto Rico
--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 09 2007 - 12:00:21 CDT

Original text of this message

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