Excuse me,
i have a problem with shell unix .
I write this script :
set -x
. /application/oracle/cfg/env_reporter.sh
ORACLE_SID=$1
TABLESPACE=$2
PATH_WORK=/export/home/oracle/script
PATH_WORK_LOG=/export/home/oracle/script/log
export ORACLE_SID CONNESSIONE_SYSTEM USER PWSD
$ORACLE_HOME/bin/sqlplus -s $USER/$PSWD@$1 << EOF
set head off
spool $PATH_WORK_LOG/rebuild_$1_$2.log
@$PATH_WORK/select_index.sql $2
exit
EOF
cat $PATH_WORK_LOG/rebuild_$1_$2.log |grep ORA-
echo $?
ls -l $PATH_WORK_LOG/rebuild_$1_$2.log
echo $?
for file in `cat $PATH_WORK_LOG/rebuild_$1_$2.log`
do
$ORACLE_HOME/bin/sqlplus -s $USER/$PSWD@$1 << EOF
* $PATH_WORK/rebuild.sql `$file` *
EOF
done
I have a problem with the "for" cicle because the shell doesn't give a value at variable "$file" .
The script rebuild.sql is :
set head off
set time off
set timing off
set feedback off
set verify off
alter index &file rebuild;
spool off;
exit
In the $PATH_WORK_LOG/rebuild_$1_$2.log
there are all the list of indexes that i want to rebuild .
Help me this a problem for me.
Thank you
Best regards
Francesco
Edit: Mahesh Rajendran
Added CODE tags
[Updated on: Thu, 12 February 2009 09:43] by Moderator
Report message to a moderator