Hi All,
OS:AIX 5.3 L
My shell script using ssh remains connected at primary site and ssh doesn't get disconnected.What should be typed and where in the shell script below to do it.
Shell script
========
#!/usr/bin/ksh
v_standby=`sqlplus -s /nolog <<END
@standby.sql
END`
echo $v_standby
ssh
abc@hostname.domain
v_primary=`sqlplus -s /nolog <<END
@primary.sql
END`
echo $v_primary
if [ $v_standby < $v_primary - 2 ]
then
mailx -s "Standby lagging behind;"
xyz@yahoo.com
fi
primary.sql
===========
set lines 500 pages 500
set verify off
set head off
connect / as sysdba
select /*+ rule */ max(h.sequence#) logseq_on_primary
from v$log_history h,
v$parameter p
where h.thread# = to_number(decode(p.value,'0',1,p.value))
and p.name = 'thread';
exit;
standby.sql
===========
set lines 500 pages 500
set verify off
set head off
connect / as sysdba
select /*+ rule */ max(h.sequence#) logseq_on_standby
from v$log_history h,
v$parameter p
where h.thread# = to_number(decode(p.value,'0',1,p.value))
and p.name = 'thread';
EXIT;