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 -> Re: host command in sql*plus

Re: host command in sql*plus

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 09 Apr 2002 18:08:50 +0200
Message-ID: <de46bug3khrkjshrgm33aue84orstqn9tf@4ax.com>


On 9 Apr 2002 02:20:47 -0700, gdas1_at_yahoo.com (gdas) wrote:

>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

The host command spawns a separate process. The separate process has NO interaction with the parent process. Also sql*plus is not a 3GL.

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Tue Apr 09 2002 - 11:08:50 CDT

Original text of this message

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