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: passing variable from sqlplus to korn scripts ..

RE: passing variable from sqlplus to korn scripts ..

From: Thapliyal, Deepak <DThapliyal_at_ea.com>
Date: Wed, 13 Sep 2000 18:48:24 -0700
Message-Id: <10618.116923@fatcity.com>


hi alex .. ya i ended up doing somethng very similar ...

#!/bin/ksh
export SPOOL_LOG=/tmp/$ORACLE_SID.$$
export FNAME=alert_$ORACLE_SID
$ORACLE_HOME/bin/sqlplus -s / 2>&1 <<ENDSQL define SPOOL_LOG='$SPOOL_LOG'
define FNAME='$FNAME'
spool &SPOOL_LOG
select ltrim(rtrim(value)) || '/&FNAME' from v\$parameter where name = 'background_dump_dest';
spool off
exit
ENDSQL
walertfile=`cat $SPOOL_LOG` #*** this is where i get value from sqlplus into my shell script

Thx for ur help all the same

Rgds
Deepak

-----Original Message-----
From: Afanassiev, Alex [mailto:Alex.Afanassiev_at_team.telstra.com] Sent: Wednesday, September 13, 2000 5:41 PM To: 'DThapliyal_at_ea.com'
Cc: 'ORACLE-L_at_fatcity.com'
Subject: RE: passing variable from sqlplus to korn scripts ..

Hi Deepak

Maybe something like this will do for you ?

#!/bin/ksh
#
#JOBNAME="$0"
#JOBNAME_SHORT=`basename $JOBNAME`

OUT=/tmp/out.log
$ORACLE_HOME/bin/sqlplus -s / > $OUT <<__EOF1 set serveroutput on feed off echo off verify off declare

        bdump varchar2(1000);
begin

        select value
                into bdump
                from v\$parameter
                where name ='background_dump_dest';
        dbms_output.put_line(bdump);

end;
/
exit
__EOF1
DIR=`cat $OUT`
echo $DIR
exit

With regards
Alex Afanassiev
Oracle DBA, TOC OPS/Internet.Operations

Tel:	(03) 8 661 20 61
Fax:	(03) 9 650 36 74



> -----Original Message-----
> From: Thapliyal, Deepak [SMTP:DThapliyal_at_ea.com] > Sent: Thursday, September 14, 2000 10:02 AM > To: Multiple recipients of list ORACLE-L > Subject: passing variable from sqlplus to korn scripts .. > > Hi guys > > goin thru a brain freeze here .. ur help appreciated in advance > here is the deal ... > > #!/bin/ksh > # > .. > .. ksh code > .. ksh code > .. ksh code > .. > > $ORACLE_HOME/bin/sqlplus -s / <<__EOF1 > declare > bdump varchar2(1000); > begin > select value > into bdump > from v$parameter > where name ='background_dump_dest'; > end; > / > exit > __EOF1 > > ** how to accesss bdump variable value from sql*plas here in shell script > ??************** > > .. ksh code > .. ksh code > .. > > > Thx > deepAk > -- > Author: Thapliyal, Deepak > INET: DThapliyal_at_ea.com > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may Received on Wed Sep 13 2000 - 20:48:24 CDT

Original text of this message

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