Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

Problem with spool command in svrmgrl

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/
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;

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

Oracle8 Enterprise Edition Release - Production
PL/SQL Release - 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

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
Abdul Rahiman
Esteemed Contributor

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;

No unix, no fun
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.