Check Database availability?


 
Thread Tools Search this Thread
Operating Systems Solaris Check Database availability?
Prev   Next
# 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
MAXDB_CHANGE_USER(3)							 1						      MAXDB_CHANGE_USER(3)

maxdb_change_user - Changes the user of the specified database connection

       Procedural style

SYNOPSIS
bool maxdb_change_user (resource $link, string $user, string $password, string $database) DESCRIPTION
Object oriented style bool maxdb::change_user (string $user, string $password, string $database) maxdb_change_user(3) is used to change the user of the specified database connection as given by the $link parameter and to set the current database to that specified by the $database parameter. In order to successfully change users a valid $username and $password parameters must be provided and that user must have sufficient per- missions to access the desired database. If for any reason authorization fails, the current user authentication will remain. Note Using this command will always cause the current database connection to behave as if was a completely new database connection, regardless of if the operation was completed successfully. This reset includes performing a rollback on any active transactions, closing all temporary tables, and unlocking all locked tables. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Object oriented style <?php /* connect database test */ $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } if ($result = $maxdb->query("SELECT * FROM dual")) { $row = $result->fetch_row(); printf("Result: %s ", $row[0]); $result->free(); } /* reset all and select a new database */ if (!$maxdb->change_user("DBADMIN", "SECRET", "DEMODB")) { printf("Database not running "); } else { printf("Database running "); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (!$link) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } if ($result = maxdb_query($link, "SELECT * FROM dual")) { $row = maxdb_fetch_row($result); printf("Result: %s ", $row[0]); maxdb_free_result($result); } /* reset all and select a new database */ if (!maxdb_change_user($link, "DBADMIN", "SECRET", "DEMODB")) { printf("Database not running "); } else { printf("Database running "); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: Result: a Database running SEE ALSO
maxdb_connect(3), maxdb_select_db(3). PHP Documentation Group MAXDB_CHANGE_USER(3)