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 server_name or IP address of computer from select statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-20-07, 09:01
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #2 (permalink)  
Old 04-20-07, 10:44
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
select INBOUND_COMM_ADDRESS from SYSIBMADM.SNAPAPPL
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 04-21-07, 05:16
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #4 (permalink)  
Old 04-23-07, 01:38
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #5 (permalink)  
Old 04-23-07, 05:34
rahul_s80 rahul_s80 is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 04-23-07, 06:26
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
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