Link to home
Start Free TrialLog in
Avatar of TClevel
TClevelFlag for United States of America

asked on

SP2-0332: Cannot create spool file

SP2-0332: Cannot create spool file
I get this error when I run my unix script. I spool to /opt/logs/exception_file  and it gives me error SP2-0332:. when I spool just to the file name exception_file  it works. The problem with just the file name is it put the output in the directory of the script. I need for it to put it in the log directory.

${ORACLE_HOME}/bin/sqlplus -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s -s ${DBLOGIN} <<-EOF
SET HEADING OFF FEEDBACK OFF VERIFY OFF PAGESIZE 0 LINESIZE 120 SERVEROUTPUT ON SIZE 1000000
spool /opt/logs/exception_file
select process_date, status, change_log from billing_table
where trunc(process_date) = trunc(sysdate) and
status like 'EXCEP%';
spool off
EOF
ASKER CERTIFIED SOLUTION
Avatar of Jinesh Kamdar
Jinesh Kamdar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Guy Hengel [angelIII / a3]
and does the folder /opt/logs exists?
Avatar of TClevel

ASKER

Yes I have permissions.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TClevel

ASKER

I am using the application user and I can write to this directory. if I run the script from that directory and just spool filename it works. it ony error when I use the path name /opt/logs/filename
Oracle Documentation : -
-----------------------------

SP2-0332 Cannot create spool file

Cause: Possible causes:

* Insufficient privileges to create a file.
* A system error made it impossible to create a file.

Action: Take the following actions:

* Change privileges to allow creation of the file.
* Consult the operating system documentation or contact the System Administrator.

" .... and that means you basically are not allowed to create a file in that directory. Could be permissions, file system (disk) full, etc. Try doing a 'host pwd' after your connect to find out what directory you are using .... "
Avatar of TClevel

ASKER

thanks
Avatar of TClevel

ASKER

thanks