[oracle@testdb shell]$ vi file.sh
#! /bin/sh
export ORACLE_SID=orcl
VALUE=(`sqlplus -S "/ as sysdba" << EOF_SQLPLus
set pagesize 0 feedback off verify off heading off echo off
select member from v\\\$logfile union select name from v\\\$controlfile;
exit;
END`)
#echo "${VALUE[1]}"
for file_name in "${VALUE[@]}"
do
if [ -f "$file_name" ];
then
echo 'exist'
else
echo 'not exist:'"$file_name"
fi
done
~
~
以上脚本用于判断controlfile及logfile的物理文件是否都存在,目前正在学习shell,谨以此作为纪录
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28473562/viewspace-1815959/
,如需转载,请注明出处,否则将追究法律责任。