Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: How to get server_name or IP address of computer from select statement

    Hi,
    I would like to write SQL to get info about server name or IP address on DB2 v9 on Windows. Is there any way to get some operating system info from "select" statement.

    I have several testing databases and one production one. So it would be nice just to write "select server_name from..." or something like that. I would like to be 100% sure I am testing on test database.

    Any help is very appreciated.
    Thanks,
    Grofaty

  2. #2
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    select INBOUND_COMM_ADDRESS from SYSIBMADM.SNAPAPPL
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    We also wrote a UDF at some point in time that does exactly the same. You could have a look at the code if you like to understand how it works: http://www.ibm.com/developerworks/db...ein/index.html
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Quote Originally Posted by rahul_s80
    select INBOUND_COMM_ADDRESS from SYSIBMADM.SNAPAPPL
    Hi,
    this is db2 v9 specific. I also need the same solution for db2 v8 fp9. Is there any solution that works on v8 as well?
    Thanks,
    Grofaty

  5. #5
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    chk table function for application snapshot.
    i think its there also with same col name.
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    SELECT INBOUND_COMM_ADDRESS FROM TABLE( SNAPSHOT_APPL( 'DB_NAME', -1 )) as SNAPSHOT_BP
    The above command returns client IP's. I would like to get server IP - where DB is installed.
    Any idea?
    Thanks,
    Grofaty

Posting Permissions

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