Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle spool location

I'm using SQL Developer to spool the DDL for some packages, but I cannot identify the location where the server is spooling. Oracle is installed on AIX, but I don't know the user it's using to connect to the OS.

Basically, when I run:

spool test.lst

select 1 from dual;

spool off

I get a confirmation message in console

1                      
---------------------- 
1          

and whenever I try to give a path, I'd get an error, probably because of user rights:

spool /tmp/test.lst
select 1 from dual;
spool off


Cannot create SPOOL file /tmp/test.lst 
1                      
---------------------- 
1             

So my question is where is test.lst?

like image 737
Vlad Cozma Avatar asked Jul 27 '12 10:07

Vlad Cozma


People also ask

Where is spool file stored?

Advantage: Spool files are protected by the backup and recovery mechanisms of the database system. G: Spool requests are stored in the standard SAP "global" directory: /usr/sap/C11/SYS/global/ (UNIX Systems).

Where are Oracle spools created?

Spool is a client activity, not a server one; the . lst file will be created on the machine that SQL Developer is on, not the server where the database it's connecting to resides. You can spool to a specific directory, e.g. spool c:\windows\temp\test.

What is spool file in Oracle?

The "spool" command is used within SQL*Plus to direct the output of any query to a server-side flat file. SQL> spool /tmp/myfile.lst. Becuse the spool command interfaces with the OS layer, the spool command is commonly used within Oracle shell scripts.

How do I get the spool in SQL Developer?

In order to execute the Spool, you'll need to run it as a script (for example, if you are using Oracle SQL Developer, you may press F5 to run the Spool as a script). Your CSV file will then get created at your specified path.


1 Answers

Spool is a client activity, not a server one; the .lst file will be created on the machine that SQL Developer is on, not the server where the database it's connecting to resides.

Under Windows 7 and SQL Developer 3.1, by default for me that seems to store the .lst in %APPDATA%\Sql Developer\

You can spool to a specific directory, e.g. spool c:\windows\temp\test.lst, and if you have it set up can use something like spool \\<aix-server>\<dir>\test.lst. Paths vary according to your client OS, of course.

like image 132
Alex Poole Avatar answered Oct 16 '22 09:10

Alex Poole