Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> host command in sql*plus

host command in sql*plus

From: gdas <gdas1_at_yahoo.com>
Date: 9 Apr 2002 02:20:47 -0700
Message-ID: <7a4ed455.0204090120.359fa6c0@posting.google.com>


Hi,

Does anyone know if there is a way to gather feedback from a "host" command in sqplus? (Running 8.1.7 on Solaris).

I have a hot backup shell script that invokes sqlplus and does something like this:

set echo on;
set feedback on;

spool backup.log
alter tablespace ... begin backup
 host cp ... (for each datafile)
alter tablespace ... end backup

the above loops for each tablespace...
followed by some other things like backing up the control file and some administrative cleanup, moving and copying of archived redo log files...

In the end, backup.log contains a full log of the backup actions performed.
this works great except that there is no feedback on any of the host commands.

I want to schedule this to run nightly and then email me backup.log. The host commands show up in the log file, but I have no idea if they actually worked. If the target disk was full or if it failed for any reason, the os error does not show up in the spool file. I tested this by modifying one of my copy commands to copy to a non-existent directory. At run time, the console showed the error, however it was not captured in the log.

Instead of issueing a straight copy command I'm thinking about issueing a copy with redirection to a file (host cp source target >> os.log) and then at the very end of the shell script combine it all into one file (more os.log >> backup.log)...but I was wondering if anyone has a more elegant way of capturing os level feedback from sqlplus host commands?

Thanks in advance,
Gavin Received on Tue Apr 09 2002 - 04:20:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US