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: Wolfson Larry - lwolfs <lawrence.wolfson_at_acxiom.com>
Date: Wed, 23 May 2007 16:22:27 -0500
Message-ID: <B39B7B7D8C8CEA419D0ED45FD7FA4C530230BC65@CWYMSX06.Corp.Acxiom.net>


So do I!  

    I did change
sqlplus -s /nolog |& # Open a pipe to SQL*Plus  

    and
    print -p -- '/'
to

    print -p -- "@$1"  

    as now I can have a $1 sql that  

can be changed like:
--@$DBS/uptime
--@$DBS/VS
@$DBS/VRL       so if we need to run a different script we can.  

If say, you get
00020, 00000, "maximum number of processes (%s) exceeded"  

    Thanks, Philip, Jared, et. al.  

    Larry


From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Jared Still Sent: Wednesday, May 23, 2007 1:23 PM
To: philipsd_at_gmail.com
Cc: oradbt054_at_gmail.com; cichomitiko_at_gmail.com; oracle-l_at_freelists.org Subject: Re: Run command on sqlplus repetitively without reconnection

On 5/22/07, Philip Douglass <philipsd_at_gmail.com> wrote:

        Here's what I've been using for awhile now to accomplish the repetitive monitoring script in SQL*Plus pattern:         

        #!/bin/ksh         

        sqlplus -s / |& # Open a pipe to SQL*Plus         

        cat <& p &         

        print -p -- "exec
dbms_application_info.set_client_info(client_info => '${USER}@${HOSTNAME}');"
        print -p -- "exec dbms_application_info.set_module(module_name
=> '$(basename $0)', action_name => '$1');"
        

        print -p -- "@$1"         

	while (true); do
	        sleep $2
	        print -p -- '/'
	done
	
	


Thanks, this is clever.
Just now I have a use for it. :)

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

*************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be
legally privileged.

If the reader of this message is not the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank you.
*************************************************************************

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 23 2007 - 16:22:27 CDT

Original text of this message

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