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
CSolver(3U)						    InterViews Reference Manual 					       CSolver(3U)

NAME
CSolver - enforces connector semantics SYNOPSIS
#include <Unidraw/csolver.h> DESCRIPTION
A CSolver object defines and implements a model for specifying connectivity semantics that connector subclasses can build upon to implement their specialized semantics. Normally, only one CSolver instance is used per application, and only connector subclasses need access it. The Unidraw class constructor initializes the csolver global to point to a CSolver instance it creates. Thus applications should not instantiate CSolver directly. CSolver models a connection between two connectors (regardless of their particular subclass or semantics) as a pair of generic connectors with a piece of CGlue interposed. The CGlue characterizes the relationship between the connectors' centers in terms of a natural size (which corresponds to the distance between the centers), elasticity, and deformation limits. Connector subclasses specify their connectiv- ity behavior with a CGlue instance and subsequently rely on the CSolver to reorient them to conform to that behavior. For example, when a pin is told to connect itself to another pin, it registers with the global csolver a connection containing the two connectors (the pins themselves) and a piece of CGlue having zero natural size, elasticity, and deformation limits. This specification effectively constrains the connectors' centers to coincide. The connectivity semantics of other connector combinations, including those involving application- specific connectors, must be specified using CGlue. PUBLIC OPERATIONS
CSolver() Create a new instance. Application programs do not normally instantiate CSolver explicitly. virtual void Connect(Connector*, Connector*, CGlue* = nil) Specify a connection between two connectors, optionally with a piece of CGlue interposed. Omitting the CGlue parameter is equiva- lent to specifying a connection with CGlue having zero natural size, elasticity, and deformation limits. void Disconnect(Connector*, Connector*) void Disconnect(Connector*) Destroy the connection(s) established between two connectors (the two-parameter form), or destroy all connections to a given connec- tor (the one-parameter form). void Solve() Solve instructs the CSolver to reorient connected connectors to conform to their connectivity semantics as reflected by its connec- tion specifications. Normally this function is called automatically and only in response to Unidraw::Update. CSolverState* GetState(Connector*) void SetState(CSolverState*) CSolverState is a class that encapsulates all the information about the connections in which a connector participates. Only CSolver can create or do anything with a CSolverState instance. GetState initializes and returns a CSolverState instance for the given con- nector, and SetState establishes the connections that a CSolverState instance specifies without disturbing existing connections. These operations are useful when it is necessary to reestablish a connector's connections after they have been lost, for example, by removing the connector from the component hierarchy (as caused by a command to delete the component). void Read(istream&) void Write(ostream&) Explicitly read/write the csolver's contents from/to disk. Normally only a catalog calls these operations. SEE ALSO
Catalog(3U), GGlue(3U), Connector(3U), globals(3U) Unidraw 20 November 1990 CSolver(3U)
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy