- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to find if 3 databases are up and running ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:12 AM
тАО05-03-2004 06:12 AM
How to find if 3 databases are up and running from UNIX shell
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:16 AM
тАО05-03-2004 06:16 AM
Re: How to find if 3 databases are up and running from UNIX shell
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:19 AM
тАО05-03-2004 06:19 AM
Re: How to find if 3 databases are up and running from UNIX shell
Can do it this way...
DBS="inst1 inst2 inst3"
#!/usr/bin/sh
for DATABASE in $DBS
do
tnsping inst1
done
(You'll want to check the syntax of that tnsping command... we don't run Oracle at my new job. It also assumes you have ${ORACLE_HOME} in your path.)
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:20 AM
тАО05-03-2004 06:20 AM
Re: How to find if 3 databases are up and running from UNIX shell
It depends on how and from where you would like to check your database instances. For example, would you like to check from the host level or database level or ???
In any case, the following are some ways in which you can check
1. Ping the instance name (if there is a host entry for the instance)
2. Write a simple script that would log into
your database instance and check for the
dB availability
3. You could also monitor for the database
processes to determine the availability
of each of the database instance
regards
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:20 AM
тАО05-03-2004 06:20 AM
Re: How to find if 3 databases are up and running from UNIX shell
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:31 AM
тАО05-03-2004 06:31 AM
Re: How to find if 3 databases are up and running from UNIX shell
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
OK (40 msec)
DO I need to grep for OK?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:36 AM
тАО05-03-2004 06:36 AM
Re: How to find if 3 databases are up and running from UNIX shell
How about,
ps -ef |grep pmon |grep -v grep |wc -l
This should give "3" as the return value if the three oracle databases are running on the system.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 06:38 AM
тАО05-03-2004 06:38 AM
Re: How to find if 3 databases are up and running from UNIX shell
You can try this
DBS="inst1 inst2 inst3"
for INST in $DBS
do
tnsping $INST 1>/dev/null 2>&1
if [[ $? -eq 0 ]]
then
echo "Instance $INST is running"
else
echo "Instance $INST is not running"
fi
done
The above example will work fine as long as tnsping is not failing for any other reason.
-- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 10:28 AM
тАО05-03-2004 10:28 AM
Re: How to find if 3 databases are up and running from UNIX shell
Just grep for your oracle DB name by doing a ps -ef
edit a file in /etc/db and specify your dbnames in it. Save the file
for dbname in $(cat -v /etc/db)
ps -ef | grep dbname
if [ $? = 0 ]; then
echo "dbname database is up"
else
echo "dbname database is not running"
fi
done
-Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 10:59 AM
тАО05-03-2004 10:59 AM
Re: How to find if 3 databases are up and running from UNIX shell
for dbname in $(cat -v /etc/db)
ps -ef | grep $dbname
if [ $? = 0 ]; then
echo "$dbname database is up"
else
echo "$dbname database is not running"
fi
done
-Anil