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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-07, 13:05
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
how to get server name

Is there a SQL statement I can execute in db2 that will give me the name of the server the statement is hitting?

It would be the equivalent of "select @@servername" in mssql.

also, are there some catalog views I can go to get various other server configuration details? I found the SYSCAT.SERVEROPTIONS catalog view, but it has no rows in it on my server.

Thanks!
__________________
elsasoft.org
Reply With Quote
  #2 (permalink)  
Old 01-16-07, 15:41
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
What about db2 "SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1"
__________________
mota
Reply With Quote
  #3 (permalink)  
Old 01-16-07, 17:24
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by dbamota
What about db2 "SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1"
That returns the current SQLID. If you want the host name of the server, see this link:
http://publib.boulder.ibm.com/infoce...n/r0012552.htm
__________________
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
  #4 (permalink)  
Old 01-17-07, 20:20
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
excellent, thanks!
__________________
elsasoft.org
Reply With Quote
  #5 (permalink)  
Old 01-23-07, 10:41
vini_srcna vini_srcna is offline
Registered User
 
Join Date: May 2006
Posts: 82
Quote:
That returns the current SQLID. If you want the host name of the server, see this link:
I think that gives the SERVER name of the local machine. CURRENT SQLID register would give the value of current sqlid right..? I Think if one has to find the SERVER name of the Remote database where the queries are executed then we need ot query the catalog SYIBM.SYSLOCATION, SYSIBM.SYSLUNAME. This catalog tables contains the DDF or CDB details.

Please feel free to correct me

Vinay
IBM CERTIFIED DB2V8.1 APPLICATION DEVELOPER.
Reply With Quote
  #6 (permalink)  
Old 01-23-07, 10:42
vini_srcna vini_srcna is offline
Registered User
 
Join Date: May 2006
Posts: 82
The location names, LU names will be defined while installing and enabling the DDF.
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