Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    13

    Question Unanswered: 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

  2. #2
    Join Date
    Jan 2004
    Posts
    12
    from the unix command line, you can issue "db2 get instance"

  3. #3
    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

  4. #4
    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 ?

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •