cancel
Showing results for 
Search instead for 
Did you mean: 

find if database is running.

Former Member
0 Kudos

Hi Gurus,

My environment is ECC6.0 on AIX 5.3 and my database is DB2. I would like to know how i can find if the database is running from the AIX level.

Thanks,

Sachin.

Accepted Solutions (0)

Answers (2)

Answers (2)

Thomas_Matthä
Employee
Employee
0 Kudos

Hi,

what you can also do is a test connect to the database.

Logon as user <sid>adm and run:

db2 connect to <sid>

When your instance is started, the testconnect will run through.

kind regards

Thomas

Former Member
0 Kudos

Hello,

if I've understood you right (you just want to check whether DB2 services are running), you can use the following command (as any user):

ps -ef | grep db2

As a result you should see lots of DB2 processes, like:

db2sysc

db2fmt

db2agent

db2loggw

<further processes>

If these processes are running, then you can be almost sure that DB2 database is running.

If you need additional checks, please specify more details for your question (which user do you have, etc...)

Kind regards,

Sergiy Malikov.

Edited by: Sergiy Malikov on Oct 6, 2008 1:23 PM

Former Member
0 Kudos

When i run the command you have asked me to do..the result is some what like this

$ ps -ef|grep db2

db2bwt 274630 1126642 0 Oct 03 - 10:08 db2stmm (BWT) 0

db2bwt 335890 1011946 0 21:44:18 - 0:03 db2loggr (BWT) 0

db2bwt 356382 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 360466 1011946 0 21:44:18 - 0:00 db2dlock (BWT) 0

db2bwt 364570 798748 0 Oct 03 - 0:00 db2resync 0

db2bwt 368724 1011946 0 Oct 05 - 0:00 db2taskd (BWT) 0

db2bwt 397362 1011946 0 21:44:18 - 0:11 db2loggw (BWT) 0

root 413914 798748 0 Oct 03 - 0:00 db2ckpwd 0

db2bwt 438378 1126642 0 Oct 05 - 0:00 db2evmgi (DB2DETAILDEADLOCK) 0

db2bwt 446472 1011946 0 21:44:18 - 0:00 db2logmgr (BWT) 0

root 454664 798748 0 Oct 03 - 0:00 db2ckpwd 0

root 503992 798748 0 Oct 03 - 0:00 db2ckpwd 0

db2bwt 540804 1011946 0 21:44:19 - 0:00 db2pclnr 0

root 549068 1 0 Oct 03 - 0:00 db2wdog 0

db2bwt 565392 798748 0 Oct 03 - 3:23 db2acd 0

db2bwt 589824 1126642 0 Oct 05 - 0:09 db2agent (idle) 0

db2bwt 602226 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 700662 1126642 0 Oct 03 - 46:51 db2agent (idle) 0

db2bwt 798748 549068 0 Oct 03 - 0:00 db2sysc 0

db2bwt 917550 1011946 0 21:44:18 - 0:00 db2pclnr 0

db2bwt 938008 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 991352 798748 0 Oct 03 - 0:00 db2tcpcm 0

root 1003644 1 0 Sep 11 - 4:56 /opt/IBM/db2/V9.1/bin/db2fmcd

db2bwt 1011946 798748 0 Oct 03 - 0:18 db2gds 0

db2bwt 1048616 798748 0 Oct 03 - 0:00 db2licc 0

db2bwt 1118368 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 1126642 798748 0 Oct 03 - 0:07 db2ipccm 0

db2bwt 1163486 1011946 0 21:44:19 - 0:00 db2pclnr 0

db2bwt 1167502 798748 0 Oct 03 - 0:23 db2fmp (C) 0

db2bwt 1171570 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 1192164 1011946 0 21:44:19 - 0:00 db2pfchr 0

db2bwt 1204458 1011946 0 21:44:18 - 0:06 db2logts (BWT) 0

db2bwt 1220714 798748 0 Oct 03 - 0:00 db2tcpcm 0

db2bwt 1269844 1011946 0 21:44:18 - 0:00 db2lfr (BWT) 0

db2bwt 1290360 798748 0 Oct 03 - 0:00 db2tcpcm 0

db2bwt 1310744 1011946 0 Oct 03 - 3:55 db2agent (idle) 0

Does this mean the DB2 is running?

What about the 0 (zeros) at the end of each entry.

Sachin.

Former Member
0 Kudos

Hello Sachin,

the output looks good (db2sysc and other processes are up&running).

However, to be 100% sure, you can execute the following command as user db2bwt or bwtadm :

db2 connect to BWT

(you can switch to the certain user by either entering a command " su - db2bwt " , or " su - bwtadm " )

If DB2 is running, you will get the similar output:

Database Connection Information

Database server = DB2/AIX64 9.1.0

SQL authorization ID = <userID>

Local database alias = <database_name>

If DB2 was NOT running, you will get an error:

SQL1032N No start database manager command was issued. SQLSTATE=57019

Hope this helps.

Kind regards,

Sergiy Malikov.

Edited by: Sergiy Malikov on Oct 6, 2008 3:31 PM

Former Member
0 Kudos

To respond to your unanswered question...The '0' at the end of each process indicates tha partition number. In a multipartitioned environment if you issue the command from another partition the value '0' will change to the current partition number.

Regards,

Adam