Sponsored Content
Top Forums Shell Programming and Scripting Check the connectivity of the DB through script, exit if no connection Post 302725223 by only4satish on Friday 2nd of November 2012 12:38:20 AM
Old 11-02-2012
when it is trying to connect to DB2 , but it is taking more but output is not displaying anything................and it is not moving to DB3


Code:
 
for DB in 1 2 3 4 5
do
var=`sqlplus -s ${USERNAME}/${PASSWORD}@${dbname} << EOF
set echo off;
set head off;
set feedback off;
set pagesize 0;
set trimspool on ;
select 'OK'  from dual;
exit;
EOF`
if [ "$var" = "OK" ]
then
echo " connectivity for $dbname is OK.............."
else
echo " Connection for $dbname is FAILED............... "
fi

output is :

Code:
 
connectivity for DB1 is OK..............

but not moving to DB3 DB4 DB5 ???
please help
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to check exit status in awk script

Hi, I have a main program which have below lines - awk -f test.awk inputFileName - I wonder how to check status return from awk script. content of awk script: test.awk --- if ( pass validation ) { exit 1 } else { (1 Reply)
Discussion started by: epall
1 Replies

2. Shell Programming and Scripting

check exit status - Expect Script

from my main script, i am calling an expect script. there are a lot of conditions in the Expect script and it can have any exit value based on success or failure of the Expect Script. how can i check the exit status of Expect scritp in the main script. (1 Reply)
Discussion started by: iamcool
1 Replies

3. Shell Programming and Scripting

Script to check connectivity

I want to write a script to check if a unix box say abc.tdc.cin.net can be connected or not on certain port say 22. right know i have to telnet them manually from DOS prompt and if it is successful then isay it is connected. Also to check Database connectivity I am using tnsping From DOS prompt.... (3 Replies)
Discussion started by: kukretiabhi13
3 Replies

4. Shell Programming and Scripting

Linux: Writing a tricky script to check connectivity

So, first and foremost, I'm having issues with my internet connection. Periodically, the connection drops across the network. The fix is simple enough: restart the modem. However, this gets old when the connection dies out every hour. I can hit my surfboard on 192.168.100.1, and navigate to a... (5 Replies)
Discussion started by: kungfujoe
5 Replies

5. Shell Programming and Scripting

Check file and if it doesnt exist , exit script

Hi, Another problem, here is my code #!/bin/sh dir='/opt/apps/script/CSV' datadir='/opt/apps/script/data' while : ; do ls -1rt $dir/*.csv > /dev/null 2>&1 if ;then cp $datadir/weekly.txt $dir/weekly.csv else exit 0 fi done (10 Replies)
Discussion started by: tententen
10 Replies

6. Shell Programming and Scripting

Check connectivity script

This past weekend I had some issues with my ISP. So for future purpose I'm going to have some logging on my internet so I'm able to attach log files to my complaint email if this issue reoccurs. Decided to do a simple ping script that runs every 5 or 10 min with crontab if ping fail write date... (5 Replies)
Discussion started by: chipmunken
5 Replies

7. Solaris

Sybase Connectivity Check through Shell Script

Hi, I need to check the sysbase database connectivity through the Unix Shell Script. Can you help me on the how to write the script to test the sysbase database connection. Thanks in Advance Nandha (0 Replies)
Discussion started by: nandha2387
0 Replies

8. Shell Programming and Scripting

Help with shell script to check the tcp network connectivity between server

Hello, I have a requirement to check the tcp network connectivity between server it's running on and the list of host's and ports combination. i have written the below code but it doesn't work, but when i execute the nc command outside the script it works fine. please help me where i am... (8 Replies)
Discussion started by: sknovice
8 Replies

9. Shell Programming and Scripting

Check connectivity with multiple hosts - BASH script available here

Hi everyone! Some time ago, I had to check connectivity with a big list of hosts, using different formats (protocol://server:port/path/, server:port, ....). I developed a script that checks the connectivity using different commands (ping, telnet, nc, curl). It worked for me so I'm sharing it... (9 Replies)
Discussion started by: Fr3dY
9 Replies

10. Shell Programming and Scripting

Need Script to check the FTP connection

Hi, I need a script which check the FTP connections, if its working fine then no issue. Incase not working fine then Trigger the mail. Please help on this. Thanks (4 Replies)
Discussion started by: Keshav Kalra
4 Replies
IBDISCOVER.PL(8)						OpenIB Diagnostics						  IBDISCOVER.PL(8)

NAME
ibdiscover.pl - annotate and compare InfiniBand topology SYNOPSIS
ibdiscover.pl DESCRIPTION
ibdiscover.pl uses a topology file create by ibnetdiscover and a discover.map file which the network administrator creates which indicates the nodes to be expected and a ibdiscover.topo file which is the expected connectivity and produces a new connectivity file (dis- cover.topo.new) and outputs the changes to stdout. The network administrator can choose to replace the "old" topo file with the new one or certain changes in. The syntax of the ibdiscover.map file is: <nodeGUID>|port|"Text for node"|<NodeDescription from ibnetdiscover format> e.g. 8f10400410015|8|"ISR 6000"|# SW-6IB4 Voltaire port 0 lid 5 8f10403960558|2|"HCA 1"|# MT23108 InfiniHost Mellanox Technologies The syntax of the old and new topo files (ibdiscover.topo and ibdiscover.topo.new) are: <LocalPort>|<LocalNodeGUID>|<RemotePort>|<RemoteNodeGUID> e.g. 10|5442ba00003080|1|8f10400410015 These topo files are produced by the ibdiscover.pl tool. USAGE
ibnetdiscover | ibdiscover.pl SEE ALSO
ibnetdiscover(8) AUTHOR
Hal Rosenstock <halr@voltaire.com> OpenIB September 21, 2006 IBDISCOVER.PL(8)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy