If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to Determine if Instance is Running !!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-07, 08:43
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
How to Determine if Instance is Running !!

i want to create a taskCenter Script which will mail me whenever any server instance is down.
i was thinking of using

select db2_status from table(snapshot_dbm(0)) as dbm

However the problem is it needs to be connected to a DB to run this command
Is there any way through which i can get the status without connecting to a DB .

--Rahul Singh
Reply With Quote
  #2 (permalink)  
Old 01-02-07, 09:04
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
down

we check the instance up/down from db2diag.log and db2diag command
each 15min we start db2diag -t last_timestamp -g ..
with filter on ADM...W message indicating instance has stopped - db2 instance has been started
we save last run timestamp and use this as start for next check
output if any is mailed
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 01-02-07, 09:58
nitingm nitingm is offline
Registered User
 
Join Date: Jul 2003
Location: Austin, TX, USA
Posts: 278
Unix

Another way is to do a ps -ef | grep <instance name> and see if the db2sysc process are running.

For e.g.

$ ps -ef | grep dumfsa1
dumfsa1 299058 1110180 0 11:30:51 - 0:00 db2tcpcm 0
dumfsa1 360624 1110180 0 11:30:51 - 0:00 db2tcpcm 0
dumfsa1 475162 839726 0 11:31:10 - 0:15 db2agent (idle) 0
dumfsa1 626862 995474 0 11:30:52 - 0:00 db2spmlw 0
dumfsa1 700500 995474 0 11:31:10 - 0:00 db2cart 0
dumfsa1 733378 1110180 0 11:30:52 - 0:00 db2spmrsy 0
dumfsa1 741606 356554 3 0:00 <defunct>
dumfsa1 757888 1110180 0 11:30:51 - 0:00 db2tcpcm 0
makern 823454 614600 0 14:57:17 pts/5 0:00 grep dumfsa1
dumfsa1 839726 1110180 0 11:30:51 - 0:00 db2ipccm 0
dumfsa1 995474 1110180 0 11:30:51 - 0:00 db2gds 0
dumfsa1 1065138 995474 0 11:30:52 - 0:00 db2srvlst 0
dumfsa1 1073332 1110180 0 11:30:52 - 0:00 db2resync 0
dumfsa1 1093814 512146 0 14:01:17 pts/6 0:00 -ksh
dumfsa1 1110180 815340 0 11:30:50 - 0:00 db2sysc 0
dumfsa1 1175686 299058 0 11:35:50 - 0:00 db2agent (idle) 0
$
__________________
HTH

Nitin

Ask the experienced rather than the learned
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On