Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313

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

  2. #2
    Join Date
    Sep 2003
    Posts
    237
    What about db2 "SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1"
    mota

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

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    excellent, thanks!

  5. #5
    Join Date
    May 2006
    Posts
    82
    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.

  6. #6
    Join Date
    May 2006
    Posts
    82
    The location names, LU names will be defined while installing and enabling the DDF.

Posting Permissions

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