setupDatabase() {
runStr="
cd $BASE_INSTALL_DIR/database
nohup ./runInstaller -silent -force -responseFile \(repFile " su - oracle -c "\)runStr"
while true
do
echo -n "."
sleep 3s
grep "Successfully Setup Software" $BASE_INSTALL_DIR/databasehup.out >> /dev/null
if [ $? -eq 0 ]; then
${ORACLE_INVENTORY_LOCATION}/orainstRoot.sh
${ORACLE_HOME}/root.sh
break
fi
done
}
设置的是临时环境变量~ 永久的放到.bash_profile文件里去
刚才的oracle居然在su - oracle -c 'cd ~;source .bash_profile'这句卡住了 明明提取出来执行是可以的啊
修改下etc的profile就可以了
改进以下代码
su - oracle <<!
/opt/database/runInstaller -silent -responseFile /home/oracle/enterprise01.rsp \
UNIX_GROUP_NAME="oinstall" ORACLE_NAME="/uyun-app/oracle/product/10.2.0_1" \
ORACLE_HOME_NAME="OraDb10g_home1" s_nameForDBAGrp="dba" s_nameForOPERGrp="dba" n_configurationOption=3
echo 'runInstaller success'
!