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 get the instance id for a db2 instance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-06, 11:31
subramanyamp subramanyamp is offline
Registered User
 
Join Date: Mar 2006
Posts: 13
Question how to get the instance id for a db2 instance

hi

Any idea how we can get the instance id for a db2 instance.instance id could be a unique number like a wwn.

do we have a snapshot function for getting this info.

Thanks
Subramanyam
Reply With Quote
  #2 (permalink)  
Old 04-03-06, 16:04
cbreiner cbreiner is offline
Registered User
 
Join Date: Jan 2004
Posts: 12
from the unix command line, you can issue "db2 get instance"
Reply With Quote
  #3 (permalink)  
Old 04-03-06, 16:09
GertK GertK is offline
Registered User
 
Join Date: Nov 2003
Location: Netherlands
Posts: 96
Starting with DB2 V8 FP9 you can use the ENV_GET_INST_INFO table function:

SELECT INST_NAME FROM TABLE(SYSPROC.ENV_GET_INST_INFO()) AS INSTANCEINFO
Reply With Quote
  #4 (permalink)  
Old 04-04-06, 03:27
subramanyamp subramanyamp is offline
Registered User
 
Join Date: Mar 2006
Posts: 13
The problem I am facing is:

1. I have two instances on two different machines.
2. Both the instances have the same name.
3. I am running a program to collect all the instances in a Network.
Since the instance names are coming same for both the instances, I am not able to differentiate between them.

So the question is: Is there a property/arttribute which uniquely identifies a UDB instance in a network, even if multiple instances in the network have the same name ?
Reply With Quote
  #5 (permalink)  
Old 04-04-06, 03:57
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Run these queries and you will likely find the information needed (including hostname) to uniquely identify the instance:

SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO()) AS INSTINFO;
SELECT * FROM TABLE(SYSPROC.ENV_GET_PROD_INFO()) AS PRODINFO;
SELECT * FROM TABLE(SYSPROC.ENV_GET_SYS_INFO()) AS SYSTEMINFO;
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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