Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Beginner's ?

Re: Beginner's ?

From: Gary O'Keefe <gary_at_onegoodidea.com>
Date: Wed, 21 Jul 1999 10:33:34 GMT
Message-ID: <37959fc5.91810642@news.hydro.co.uk>


On Wed, 21 Jul 1999 01:01:06 -0400, Jack Zhu <jackzhu_at_monmouth.com> wrote:

>I want to write a bash shell script about Oracle database. In this
>scipt, I need to collect all the files in the v$logfile first, then
>process them. How can I collect these log files in my shell script?

A quick and dirty solution would be:

#!/usr/bin/bash # or whatever is appropriate for your setup

tempfile="tempfile.sql"
echo set heading off > $tempfile
echo set feedback off >> $tempfile
echo select member from v\$logfile";" >> $tempfile echo exit >> $tempfile

members=$(sqlplus -s <uname>/<pass> @$tempfile) for member in $members
do

        # do stuff
        echo $member

done
rm $tempfile

You need write access to the directory the script is executing in however.

Gary
--
Gary O'Keefe
gary_at_onegoodidea.com

You know the score - my current employer has nothing to do with what I post Received on Wed Jul 21 1999 - 05:33:34 CDT

Original text of this message

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