The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script not connecting to primary from standby site a1_win Shell Programming and Scripting 0 10-23-2008 05:22 AM
Shell script process remains after "exit 1" Squeakygoose Shell Programming and Scripting 4 10-21-2008 12:17 PM
Pulling a list of files from FTP site in a shell script spatra Shell Programming and Scripting 0 08-28-2008 08:03 AM
Passing the values to the secondary script when it invoked by primary script venu_eie UNIX for Advanced & Expert Users 2 07-03-2008 08:10 AM
Passing the values to the secondary script when it invoked by primary script venu_eie Shell Programming and Scripting 1 07-03-2008 07:16 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-23-2008
a1_win a1_win is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 33
Shell script using ssh remains connected at primary site

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;
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0