Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Cold backups shell script
Steven Alfisi wrote:
> I am still having problems getting the shell script listed below to
> work. I have tried putting the $controlfile between single quotes,
> double quotes and just about everything else. I thought this would
> work with the \ based on other people's posts but that is not the
> case. I have tried both the bash shell on linux and ksh on Solaris
> 2.6. What is going on here? Anyone?
>
> logFile='/tmp/logFile.log'
> listFile='/tmp/listFile.log'
> tmpFile='/tmp/tmpFile.log'
>
> su oracle 2>>$logFile >>$logFile <<EOF_SQLPLUS
> /opt/oracle/OraHome1/bin/sqlplus /nolog <<EOF_CONTROLFILE
> connect / as sysdba
> set echo off
> set heading off
> spool $listFile
> select 'cp '||name|| ' /data/oracle/os_backups/homedb' from
> v\$controlfile;
> spool off
> exit
> EOF_CONTROLFILE
> EOF_SQLPLUS
>
It's sqlplus, not the shell, that's giving you trouble. Within sqlplus,
you need to do 'set escape on' (by default, sqlplus does not check for
escape characters).
Received on Mon Nov 25 2002 - 14:50:04 CST