TClevel
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and does the folder /opt/logs exists?
ASKER
Yes I have permissions.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 .... "
--------------------------
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 .... "
ASKER
thanks
ASKER
thanks