Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Beginner's ?
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
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
![]() |
![]() |