I have a requirement like this:A shell script will check a table column if the column name "value" is 'N' then main script start and keep checking within 30 minute whether the column value has changed to 'y'. or not if it has changed to 'y' then stop the server.Please help me to get the shell script for this logic.Table can be accessed from the script by select statement.
val=`sqlplus -s <<ESQL
${DB_LOGON}
set serveroutput off
set heading off
set feedback off
set verify off
set define off
select col_name from table;
exit
ESQL`
while true; do
if [ $val == "N" ]; then
start_main_script
sleep 1800
else
stop_server
break;
fi
done
Note start_main_script & stop_server functions must be written above this code