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
Received on Thu Jun 01 2000 - 05:31:39 CDT