Check Database availability?


 
Thread Tools Search this Thread
Operating Systems Solaris Check Database availability?
# 1  
Old 11-07-2008
Check Database availability?

Hi All,
My script gets aborted as it is connecting as a remote database through a DB link on every 3rd sunday.As the remote DB is down for more than 6 hours.

Can TNSPING DBNAME inside my script ensure the database is up???


Then how can i check the database is up or down ?


Regards
Megh

Last edited by megh; 11-08-2008 at 12:12 AM..
# 2  
Old 11-07-2008
Code:
tnsping instance_name 2>&1 > /dev/null
if [[ $? -eq 0 ]] ; then
    echo "instance_name is up"
else
    echo "not up"
fi

# 3  
Old 11-07-2008
Quote:
Originally Posted by megh
[...]
Can TNSPING DBNAME inside my script ensure the database is up???
No,
it only shows that the listener is accessible and running.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check file availability and place flag file

I have to check a directory on Linux (via shell Script which I am trying to build) for about 20 different source files with file patterns and if the files are made available in the directory, I should place flag files for which my other ETL jobs are waiting on to kick off. If the source files are... (6 Replies)
Discussion started by: dhruuv369
6 Replies

2. Shell Programming and Scripting

Script to check the health of a database

need a script to check the health of a session server database. It must read the data base and send an alert if the database is unavailable. If its unavailable, we will want to bring down the database listener to force failover. can u guyz help me in doing this. what information do i need... (1 Reply)
Discussion started by: remo999
1 Replies

3. UNIX for Dummies Questions & Answers

For loop to check the files availability

Hi, I need a help with my script. Below is my script. What I am doing here is finding the date of the file which I need to process and then finding the list of file names. Based on the list of file names, check has to be done to see if all the files are there and log the details to a error... (3 Replies)
Discussion started by: Vijay81
3 Replies

4. Shell Programming and Scripting

Check File availability

Hi, I have a task to write a script , which will run everyday to check whether my system has received 2 files from source system. It should mail me ( using mailx preferably ) if the files has not arrived from the source. The scenario is everyday I get 2 files from source system.,... (3 Replies)
Discussion started by: cratercrabs
3 Replies

5. Shell Programming and Scripting

To Check Oracle Database Status

I have to check the oracle database status using ksh, if the database is down then i need to send my dba an email saying database is down and wait for 10 mins and check for the status again and so on. once the database is up then should continue to the next step in the script. Any help is... (1 Reply)
Discussion started by: vpv0002
1 Replies

6. Shell Programming and Scripting

how to check availability of data of one file in other

hi all i have two files in unix 1.table.name 2.all.tables i need to check the availability of all data of table.name in all.tables.both the table contains n number of data.i need a script which will check one by one whether the data exist in table.name or not.I want this in SH. (1 Reply)
Discussion started by: alisha
1 Replies

7. Shell Programming and Scripting

How do I check using shell-script if an item is available in a database?

Input for the program is a text file consisting of n no. of items. I want search each item in a database and the existing parts should go to FOUND folder and the others should go to NOTFOUND folder. Pls help me in this. Thank u. (1 Reply)
Discussion started by: smarty86
1 Replies

8. Shell Programming and Scripting

How to check if database exists?

Hi folks! First off I'm working with a Sybase DB. I'm using you're basic ISQL command to connect to my Sybase DB... isql -S$DB_SERVER -D$DB_NAME -U$DB_USR -P$DB_PWD <<!EOF > $log_file My question is, is there a way to determine if a database exists using shell script? For example, if... (2 Replies)
Discussion started by: Fatbob
2 Replies
Login or Register to Ask a Question