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 > Application ID

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-09, 04:39
nittal nittal is offline
Registered User
 
Join Date: Jul 2008
Posts: 131
Question 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?
Reply With Quote
  #2 (permalink)  
Old 03-09-09, 05:51
angoca angoca is offline
Registered User
 
Join Date: Mar 2006
Location: Bogota, Colombia
Posts: 6
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.
Reply With Quote
  #3 (permalink)  
Old 03-09-09, 06:22
nittal nittal is offline
Registered User
 
Join Date: Jul 2008
Posts: 131
but this is not the IP where the application is runnig.
Reply With Quote
  #4 (permalink)  
Old 03-09-09, 12:25
angoca angoca is offline
Registered User
 
Join Date: Mar 2006
Location: Bogota, Colombia
Posts: 6
Hi,

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

Take a look at these other forums:
how to indetify the TCP/IP or Node from db2 list applications
DB2 application ID: Conver hex IP address to decimal address

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.
Reply With Quote
  #5 (permalink)  
Old 03-09-09, 13:53
nick.ncs nick.ncs is offline
Registered User
 
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


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

Quote:
SELECT INBOUND_COMM_ADDRESS FROM TABLE( SNAPSHOT_APPL( 'DB_NAME', -1 )) as t
__________________
IBM Certified Database Associate, DB2 9 for LUW
Reply With Quote
  #6 (permalink)  
Old 03-09-09, 15:04
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #7 (permalink)  
Old 03-10-09, 01:11
nittal nittal is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 03-10-09, 05:14
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
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 05:34.
Reply With Quote
  #9 (permalink)  
Old 03-10-09, 06:24
nittal nittal is offline
Registered User
 
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'
Reply With Quote
  #10 (permalink)  
Old 03-10-09, 06:57
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
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