Results 1 to 10 of 10

Thread: Application ID

  1. #1
    Join Date
    Jul 2008
    Posts
    131

    Question Unanswered: Application ID

    Hi,

    Executing the 'LIST APPLICATIONS' command shows one of the application ID as: 050B97C8.C3505.C5F9F5F8C5F0

    How do I convert this value to know the IP address?

  2. #2
    Join Date
    Mar 2006
    Location
    Bogota, Colombia
    Posts
    21
    Hi,

    This is the representation of the IP address in Hexa:
    050B97C8
    You take the pairs of numbers and translate them into decimal:
    05 - 5
    0b - 11
    97 - 151
    c8 - 200
    The IP address is 5.11.151.200.
    Sometimes, if there is a G or K in the pairs, it means also 0.
    AngocA

  3. #3
    Join Date
    Jul 2008
    Posts
    131
    but this is not the IP where the application is runnig.

  4. #4
    Join Date
    Mar 2006
    Location
    Bogota, Colombia
    Posts
    21
    Hi,

    It's weird, but this is the interpretation of list applications.

    Take a look at these other forums:
    http://www.dbforums.com/db2/1003490-...lications.html
    http://www.dbforums.com/db2/1205496-...l-address.html

    And this is the interpretation for diaglogs (it is the same for IP addresses)
    DB2 Universal Database

    Finnally, if the IP address is other, I don't know what to say.
    AngocA

  5. #5
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    why dont you try the following queries which will give you the IP Address directly


    select INBOUND_COMM_ADDRESS from SYSIBMADM.SNAPAPPL
    OR [depending upon your version]

    SELECT INBOUND_COMM_ADDRESS FROM TABLE( SNAPSHOT_APPL( 'DB_NAME', -1 )) as t
    IBM Certified Database Associate, DB2 9 for LUW

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by nittal
    but this is not the IP where the application is runnig.
    It is where the connection is coming from. Is the application connecting through a remotely catalogued database on another machine, or something like a DB2 Connect gateway machine?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Jul 2008
    Posts
    131
    thanks nick,
    i can get the IP address from there. but it would be more helpful if we can find a way to convert 060B97C8.C3505.C5F9F5F8C5F0 into the actual IP what i am getting from the select statement you asked to execute.
    this is because, if there are 100 connections then an adminstrator needs to connect to each db first to know the IP whereas doing a simple 'list
    applications' will help get us all the information.

    Marcus,
    You are right! we are working on IBM rational Tools. In this, the machine where we catalog our databases is the expected IP result and my web server itself is the place where my databases are cataloged remotely. so the expected IP is of this web server which is not the same i am getting after converting the above hexadecimal outcome. but ya, what nick answered is giving me the correct output.

  8. #8
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Updated: Removed last RTRIM function.

    Here is a simple UDF to convert a hex value into IP address.

    Code:
    ------------------------------ Commands Entered ------------------------------
    CREATE FUNCTION Hex_to_IPaddress( in_hex VARCHAR(50) )
    RETURNS VARCHAR(15)
    LANGUAGE SQL
    READS SQL DATA
    DETERMINISTIC
    NO EXTERNAL ACTION
    RETURN
    SELECT RTRIM( CHAR( LOCATE( SUBSTR(u_hex, 1, 1), hexdigits ) * 16
                      + LOCATE( SUBSTR(u_hex, 2, 1), hexdigits )
                      )
                ) || '.'
        || RTRIM( CHAR( LOCATE( SUBSTR(u_hex, 3, 1), hexdigits ) * 16
                      + LOCATE( SUBSTR(u_hex, 4, 1), hexdigits )
                      )
                ) || '.'
        || RTRIM( CHAR( LOCATE( SUBSTR(u_hex, 5, 1), hexdigits ) * 16
                      + LOCATE( SUBSTR(u_hex, 6, 1), hexdigits )
                      )
                ) || '.'
        ||        CHAR( LOCATE( SUBSTR(u_hex, 7, 1), hexdigits ) * 16
                      + LOCATE( SUBSTR(u_hex, 8, 1), hexdigits )
                      )
      FROM (VALUES ( '123456789ABCDEF', UPPER(in_hex) ) )
            AS S( hexdigits, u_hex )
    ;
    ------------------------------------------------------------------------------
    DB20000I  The SQL command completed successfully.
    
    ------------------------------ Commands Entered ------------------------------
    VALUES Hex_to_IPaddress('050B97C8.C3505.C5F9F5F8C5F0');
    ------------------------------------------------------------------------------
    
    1              
    ---------------
    5.11.151.200   
    
      1 record(s) selected.
    Last edited by tonkuma; 03-10-09 at 06:34.

  9. #9
    Join Date
    Jul 2008
    Posts
    131
    >> db2 list applications
    application ID--------050B97C8.C3505.C5F9F5F8C5F0
    which turns out to be 5.11.151.200

    >>db2 select INBOUND_COMM_ADDRESS from SYSIBMADM.SNAPAPPL
    INBOUND_COMM_ADDRESS
    --------------------------------
    -
    aa.bb.cc.dd
    -
    -
    -
    aa.bb.cc.dd is the correct IP which i expected to get after converting the output of 'list applications, application ID column'

  10. #10
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Thanks tonkuma ... Added link to ur script to the Script Library.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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