473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DB2 equivalent for Oracle's PMON?

Greetings!

Imagine 2 hosts: host A runs Oracle 10g , host B runs IBM DB2 v9. I
have to write a shell script (bask/Korn...) that checks if a database
instance is up and running and does a bunch of other stuff.

For instance, I can do something like this on host A (the host for the
Oracle 10g database):

export ORACLE_SID=<instance name>
check_db=`ps -ef|grep ${ORACLE_SID}|grep pmon|wc -l`;
checkdb_retval=`expr $check_db` ...
if [ $checkdb_retval -lt 1 ]
then
echo "Database not running!"
exit 1
fi

This works like a charm with Oracle. However, DB2 is different: I
tried the following snippet of code on host B but to no avail:

export DB2=db2inst1
export DBNAME=<database name>
check_db=`ps -ef|grep ${DB2}|grep ${DBNAME}|wc -l`;
checkdb_retval=`expr $check_db`
if [ $checkdb_retval -lt 1 ]
then
echo "Database not running!"
exit 1
fi
This is not going to work : the result this code outputs is way too
verbose to tell what's what.

Is there a sure-fire way to tell in a shell script that a DB2 instance
is up and running, e.g. something similar to grep-ping for DB2's
equivalent of PMON???
Hope you can help. TIA,

Alan.
Mar 19 '08 #1
0 1468

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1",...
7
by: KingGreg | last post by:
All, Oracle 9i provides a "USING" clause option for inner joins, that allows me to say: SELECT * FROM TBL1 JOIN TBL2 USING KeyColumn assuming KeyColumn is in both TBL1 and TBL2. This is...
2
by: gimme_this_gimme_that | last post by:
Assuming data is being stored in a DB2 TIMESTAMP what is the equivalent of Oracle's to_date function : to_date('03/04/2005','MM/DD/YYYY') It's OK if MM/DD/YYYY is the only supported format....
8
by: gimme_this_gimme_that | last post by:
Is there something equivalent to Oracle's SELECT DBMS_LOB.GETLENGTH(COLUMN_NAME) FROM FOO where COLUMN_NAME is a CLOB in table FOO returning an integer with a count of the number of...
14
by: hilz | last post by:
Hi all, What is the equivalent of VARCHAR2 in access? thanks hilz
0
by: Doug Bloebaum | last post by:
In Oracle I can do this: SELECT h.transaction_number CURSOR(SELECT d.detail_number FROM detail d WHERE d.transaction_number=h.transaction_number) FROM header h WHERE...
2
by: ghe | last post by:
Good day to all, Does anyone here know how to convert the specified Oracle code below into PHP? Oracle Code: TYPE myTable IS TABLE OF varchar2(1) INDEX BY BINARY_INTEGER; If the Oracle code i...
1
DTV12345
by: DTV12345 | last post by:
Greetings! Imagine 2 hosts: host A runs Oracle 10g , host B runs IBM DB2 v9. I have to write a shell script (bask/Korn...) that checks if a database instance is up and running and does a bunch...
2
by: Ruslan A Dautkhanov | last post by:
Hello ! I'm about to install O9i on FreeBSD box. uname -a: FreeBSD stat2.scn.ru 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.