problems integrating sql in shell [message #8050] |
Wed, 23 July 2003 08:50 |
Uwe
Messages: 260 Registered: February 2003 Location: Zürich, Switzerland
|
Senior Member |
|
|
Hi,
I just try to integrate a sql-backup script into a shell script. By now the generation works but I got the source code also in my destination file.
If I try it from sqlplus it works.
My file looks like :
oracleSids=$(cat /var/opt/oracle/oratab | grep -v "#" | grep -v '^$' |grep -v "*
" |grep ${ORACLE_HOME} | awk -F: '{print $1}')
cd /usr/local/bin/backup
for i in $oracleSids
do
export ORACLE_SID=$i
sqlplus usr/passwd <<EOF
set serveroutput on
set feedback off
set echo off
set trimspool on
set line 500
set head off
set feed off
spool backup.sql
declare
.....<backupscript>
EOF
done
I imagine that it should be an OS problem (Solaris 9) but I can't figure out why the coplete sql-script is send to spoolfile. When I try only the sql-part from sqlplus I got only the result.
any hints welcome
Uwe
|
|
|
|
|