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: Parameter to teh spool command

Re: Parameter to teh spool command

From: S. Anthony Sequeira <Sequeira_at_lineone.net>
Date: Thu, 1 Jun 2000 21:55:35 +0100
Message-Id: <10515.107477@fatcity.com>


Witold,

    As you use Unix you can employ a 'here' document:

tonys_at_ajp_laptop2[SAS1]:~/tmp
$ export SPOOL=spool
tonys_at_ajp_laptop2[SAS1]:~/tmp
$ svrmgr30 <<EOF
> connect internal
> spool $SPOOL
> show sga
> spool off
> exit
> EOF
Oracle Server Manager Release 3.0.5.0.0 - Production

(c) Copyright 1997, Oracle Corporation. All Rights Reserved.

Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production With the Partitioning and Objects options PL/SQL Release 8.0.5.0.0 - Production

SVRMGR> Connected.
SVRMGR> SVRMGR> Total System Global Area 25001984 bytes

Fixed Size                                          49152 bytes
Variable Size                                    22626304 bytes
Database Buffers                                  2252800 bytes
Redo Buffers                                        73728 bytes
SVRMGR> SVRMGR> Server Manager complete. tonys_at_ajp_laptop2[SAS1]:~/tmp
$ cat spool.log
Total System Global Area                         25001984 bytes
Fixed Size                                          49152 bytes
Variable Size                                    22626304 bytes
Database Buffers                                  2252800 bytes
Redo Buffers                                        73728 bytes
tonys_at_ajp_laptop2[SAS1]:~/tmp
$

    HTH     Regards.

Tony

--
S. Anthony Sequeira

Wait for the ricochet

Opinions expressed herein are my own and do
not necessarily represent those of my employer
----- Original Message -----
From: A. Bardeen <abardeen1_at_yahoo.com>
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Sent: 01 June 2000 12:44
Subject: Re: Parameter to teh spool command



> Witold,
>
> The & substitution parameter doesn't work in server
> manager as you noticed.
>
> If you have to use svrmgrl, I think the only way you
> can do this is to dynamically build a script which
> contains the spool filename.
>
> For example the following allows a user to specify the
> password for system at the command prompt, rather than
> hardcoding it into a script. You could easily modify
> it to specify the spool file name instead or in
> addition. I'm not a Unix person so my example is on
> NT, but it should be enough to give you an idea.
>
> TEST.CMD - main batch file
> MAKECONNECT.CMD - batch file to create CONNECT
> statement file
> CONNECTSTMT.SQL
> SCRIPT.SQL - sample script to run in svrmgr30
>
> This will:
> 1. Create two files: CONNECTSTMT.SQL and
> FINALSCRIPT.SQL
> 2. Run FINALSCRIPT.SQL in svrmgr30 which creates
> spool file FINALSCRIPT.LOG
> 3. Deletes CONNECTSTMT.SQL and FINALSCRIPT.SQL
>
> -----
>
> TEST.CMD:
>
> REM Usage: TEST.CMD <sid> <password_for_system>
> SET ORACLE_SID=%1
> call makeconnect %2
> copy connectstmt.sql+script.sql finalscript.sql
> svrmgr30 @finalscript.sql
> del connectstmt.sql
> del finalscript.sql
>
> MAKECONNECT.CMD:
>
> echo CONNECT SYSTEM/%1 > connectstmt.sql
>
>
> HTH,
>
> -- Anita
>
> --- Witold Iwaniec <wiwaniec_at_novalistech.com> wrote:
> >
> > Thanks, but it works only in SQL*Plus.
> > In a simplest test - I created a two line script
> > test.sql:
> >
> > spool off
> > spool &1
> >
> > when called from server manager prompt, on SUN
> > Solaris:
> >
> > SVRMGRL> @test.sql my_log.txt
> >
> > creates spool file &1.log. And similar if I use $1 -
> > it creates file
> > $1.log. The same happens when I call the script from
> > server
> > manager in DOS.
> >
> > I guess I have to live with SQL*Plus
> >
> > Thanks
> >
> > Witold
> >
> >
> > On 30 May 2000, at 7:37, Steve Boyd wrote:
> >
> > > Very simple indeed. Just use &1 for the first
> > argument, &2 for the second,
> > > etc.
> > >
> > > Of course, you can set define to something other
> > than &, but why?
> > >
> > >
> > > >From: "Witold Iwaniec" <wiwaniec_at_novalistech.com>
> > > >Reply-To: ORACLE-L_at_fatcity.com
> > > >To: Multiple recipients of list ORACLE-L
> > <ORACLE-L_at_fatcity.com>
> > > >Subject: Parameter to teh spool command
> > > >Date: Tue, 30 May 2000 06:16:40 -0800
> > > >
> > > >Hi all
> > > >
> > > >I guess it is very simple but I must be missing
> > something...
> > > >
> > > >I would like to use a parameter for the spool
> > filename so that I can
> > > >run my script number of times and keep all spool
> > files.
> > > >But using:
> > > >
> > > >spool $1.log
> > > > (or spool %1.log in Windows)
> > > >does not do it.
> > > >
> > > >Can I do it in the sql script or do I have to go
> > for other tools to
> > > >generate the file name and open it?
> > > >
> > > >Regards
> > > >
> > > >Witold
> > > >======================================
> > > >Witold Iwaniec
> > > >Senior Software Developer
> > > >NovaLIS Technologies
> > > >wiwaniec_at_novalistech.com
> > > >http://www.novalistech.com
> > > >--
> > > >Author: Witold Iwaniec
> > > > INET: wiwaniec_at_novalistech.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
> > > >also send the HELP command for other information
> > (like subscribing).
> > >
> > >
> >
>
________________________________________________________________________
> > > Get Your Private, Free E-mail from MSN Hotmail at
> > http://www.hotmail.com
> > >
> > > --
> > > Author: Steve Boyd
> > > INET: pimaco_oracle_at_hotmail.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
> > > also send the HELP command for other information
> > (like subscribing).
> >
> >
> > --
> > Author: Witold Iwaniec
> > INET: wiwaniec_at_novalistech.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
> > also send the HELP command for other information
> > (like subscribing).
>
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
> --
> Author: A. Bardeen
> INET: abardeen1_at_yahoo.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
Received on Thu Jun 01 2000 - 15:55:35 CDT

Original text of this message

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