Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with spool command in svrmgrl

SOLVED
Go to solution
Donald Whitaker
Occasional Contributor

Problem with spool command in svrmgrl

I have just recently migrated from a HPUX 10.20 to a HPUX 11.11 box and my backup script is giving a problem. I execute the command from a backup script running out of root scheduled in cron:

su oracle -c /home/root/cold3.sh
this script in turns runs (from the oracle user)
.
. (other commands)
.
export ORACLE_HOME=/usr/oracle/product/8.0.6
$ORACLE_HOME/bin/svrmgrl << EOF
spool shutdown_PILOT.log;
connect internal
desc partmaster
spool off;
EOF

The system is not creating the log file though. Here is the message that I get:

Oracle8 Enterprise Edition Release 8.0.6.0.0 - Production
PL/SQL Release 8.0.6.0.0 - Production

SVRMGR> MGR-01507: unable to open file "shutdown_PROD.log"
SVRMGR> Connected.
SVRMGR> Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> MGR-00308: no spool file opened
SVRMGR>

The OS is not letting me create the file. I have checked the persions on /home and and on /home/root where I am creating the file and they are 777. When I run this on-line from a session it works fine. I have looked at the umask but it doesn't seem to matter what it is set to. This used to work fine on my old HPUX machine. Any help would be appreciated.
Thanks, dw
3 REPLIES
Abdul Rahiman
Esteemed Contributor
Solution

Re: Problem with spool command in svrmgrl

I think since you haven't used the explicit path to the spool fiel that you wanted to create, the script is trying to create the spool file on the root direcotry.
Try using the full directory path name with the spool output file as follows and see if it works.

spool /home/root/shutdown_PILOT.log;

HTH,
Abdul.
No unix, no fun
twang
Honored Contributor

Re: Problem with spool command in svrmgrl

It may be because of permission problem, try to spool the logfile in /tmp:
spool /tmp/shutdown_PILOT.log;
Donald Whitaker
Occasional Contributor

Re: Problem with spool command in svrmgrl

Abdul you were correct. When I fully qualified the directory it worked and I didn't have permissions for the root.
Thank You so much I spent way too much time on that.