Hello everybody. I have a little question. Im creating a script for checking the status of different servers, and everything is running fine except for one thing. I have to check if certain DBs are connectables, I dont care anything else, nor running querys nor updating tables, the only thing I need to know is if the DB is connectable. It should be an easy task but frankly Im not very sure how to do it, so I tried the code below. And the problem I got with it is an "sqlplus : not found" from the unix shell. If anyone could help me itd be great. Thanks in advance.
Here goes what I have until now. If anyone knows another way thats great, I really dont care HOW to do it, just that it works.
And It worked. The only issue is that I got the sql prompt and its supposed to be a automatization so, do u know if there is a third command I can use for exiting sql in the same line. I used "sqlplus quit" and didnt work. Maybe some flag in the first command to turn it promptless?
Why you want to test connectivity remotely using ssh?
I would suggest you to create your own tnsnames.ora with database address for establishing connection.
Then point TNS_ADMIN variable to the path where tnsnames.ora is placed and test connectivity locally.
Because I really dont know much about managing DBs, Im working just testing the status of many many servers and this was the way I do it manually, so I think that it would be very simple to just convert it to an script. I have no idea how to create a .ora file, and honestly, I dont want to learn. haha. I jsut need to make this fast and efficient. Thanks for your advices. If this doesnt work I will try to do what u just told me, but ill have to read a little bit first.
---------- Post updated at 06:49 PM ---------- Previous update was at 06:20 PM ----------
Quote:
Originally Posted by SeaSoul
Because I really dont know much about managing DBs, Im working just testing the status of many many servers and this was the way I do it manually, so I think that it would be very simple to just convert it to an script. I have no idea how to create a .ora file, and honestly, I dont want to learn. haha. I jsut need to make this fast and efficient. Thanks for your advices. If this doesnt work I will try to do what u just told me, but ill have to read a little bit first.
I was able to do it. Tnak you very much for your help!!!!!
I want to check for rows in a table where all values (except the key) is empty. I am using MySQL 5.5.
I plan to do this mechanically, so the approach should work for any table in my database schema.
Suppose for illustration purposes I start with the following table:
CREATE TABLE `sources` (
... (4 Replies)
Hi, (i'm sorry for my english)
I'm a problem on boot sco unix 5.0.5 open server.
this stop at "Checking protected password and checking subsystem databases"
(See this image )
I'm try this:
1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094
2) SCO: SCO Unix - Server hangs... (9 Replies)
Hi,
I want my script to check for availability of few files contineously for some time.
Lets say from 10:00 AM to 10:30 AM script should keep checking on a particular location for each file one by one. If all the files are available then only it should complete the next processing part, else... (2 Replies)
I'm writing a KSH shell script that's using SQL though DB2.
If I have a table defined and populated
db2 "create table tb(num int,letter char(4))"
db2 "insert into tb values(111,a)
db2 "insert into tb values(112,b)
db2 "insert into tb values(111,c)
How can I check if a letter user... (0 Replies)
hi,
i am using a sqlplus connection in one of my shell scripts. i want to check if the connection is set properly or not.. can i use '$?' to check the status of the sql connectivity..? or is there any other option to do that..?
thanks, (1 Reply)
Hi, Im new in shell programming.
I need to know the availability for specific printers. We send requests from solaris to printers located at an NT server. My idea is creating a shell that will monitor availbaility and send an email when something is wrong.
I have a file with printers and its... (2 Replies)
Hi Guru's,
I need to check the availability of a web page for every one hour through a script. Following is the requirement.
1. Go to http://vsn.srivsn.com
2. If any error encountered in openeing the home page, it should trigger an email with the appropriate error message.
3. If page opens... (6 Replies)
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be... (4 Replies)
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be... (1 Reply)