Home » SQL & PL/SQL » Client Tools » Spooling Output in Windows (Oracle 10g Express, Windows XP)
Spooling Output in Windows [message #455731] Wed, 12 May 2010 13:14 Go to next message
purerage
Messages: 3
Registered: May 2010
Junior Member
Hello All,

I am an IT auditor who has been using Oracle 10g Express to test some audit scripts we have created. I write the output of each query in the script to a separate file because it makes it easier for us to go through. However, I cannot get SQLPlus to spool the output files at all. I do not get any errors from running the script, and I can see the results in the SQLPlus window, but I cannot find where the files are actually spooling to, if they are spooling at all.

I didn't specify a network path for any of the spool files because the scripts need to be as generic as possible so they can run on any Windows or UNIX box. An example of my code is below:

spool Audit_Ver

SELECT * FROM V$VERSION;

spool off

But if I search my harddrive for "Audit_Ver" no such file can be found anywhere. Can anyone help me figure out where these files are actually going or how to fix it?
Re: Spooling Output in Windows [message #455734 is a reply to message #455731] Wed, 12 May 2010 13:17 Go to previous messageGo to next message
BlackSwan
Messages: 26588
Registered: January 2009
Location: SoCal
Senior Member
>Can anyone help me figure out where these files are actually going or how to fix it?

Are you logged directly onto DB server system itself?
Re: Spooling Output in Windows [message #455738 is a reply to message #455734] Wed, 12 May 2010 13:22 Go to previous messageGo to next message
purerage
Messages: 3
Registered: May 2010
Junior Member
Yes I believe so, I connect to the database (which is installed on my laptop) using SQLPlus in the command line.

SQLPlus system/password@IP/port/XE

This is just an XE database that I downloaded to my laptop to specifically to test/create this script so everything is located on my laptop's C: drive.
Re: Spooling Output in Windows [message #455740 is a reply to message #455731] Wed, 12 May 2010 13:24 Go to previous messageGo to next message
Michel Cadot
Messages: 66516
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Spool goes to your local local server (local to SQL*Plus), it goes to the working directory of SQL*Plus.
If you use Windows SQL*Plus then have a look at your shortcut, if none is given it is where resides your SQL*Plus (ORACLE_HOME\bin).

If you want to be sure where the spool will go then just give the full pathname of your spool file.

Regards
Michel
Re: Spooling Output in Windows [message #455741 is a reply to message #455738] Wed, 12 May 2010 13:25 Go to previous messageGo to next message
Littlefoot
Messages: 21493
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The result should be in working directory:
C:\temp>sqlplus scott/Tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Sri Svi 12 20:24:26 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production


Session altered.

SQL> spool abc.txt
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL> spool off
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

C:\temp>dir abc.txt
 Volume in drive C has no label.
 Volume Serial Number is F892-B9F1

 Directory of C:\temp

12.05.2010  20:24               905 abc.txt
               1 File(s)            905 bytes
               0 Dir(s)  21.439.901.696 bytes free

C:\temp>
Re: Spooling Output in Windows [message #455742 is a reply to message #455738] Wed, 12 May 2010 13:25 Go to previous messageGo to next message
BlackSwan
Messages: 26588
Registered: January 2009
Location: SoCal
Senior Member
search for AUDIT_VER* using Windoze file SEARCH
Re: Spooling Output in Windows [message #455744 is a reply to message #455742] Wed, 12 May 2010 13:34 Go to previous messageGo to next message
purerage
Messages: 3
Registered: May 2010
Junior Member
Thank you, I looked in C:\Temp and there was nothing but just reading your message made me realize the problem. Since I'm on my corporate network, my home directory is actually my personal network drive (M:) not C:. So the files were all in M:\Temp. Thank you for the help this had been bugging me for days and now I feel silly Smile
Re: Spooling Output in Windows [message #455746 is a reply to message #455744] Wed, 12 May 2010 13:59 Go to previous message
Littlefoot
Messages: 21493
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"C:\temp" was my working directory; it was just an illustration.
Previous Topic: Debugging PL/SQL Web Forms in Toad
Next Topic: History of sqlplus commands
Goto Forum:
  


Current Time: Thu Aug 22 10:29:26 CDT 2019