| |
|
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.
|
 |

03-09-09, 04:39
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 131
|
|
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?
|
|

03-09-09, 05:51
|
|
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.
|
|

03-09-09, 06:22
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 131
|
|
|
|
but this is not the IP where the application is runnig.
|
|

03-09-09, 12:25
|
|
Registered User
|
|
Join Date: Mar 2006
Location: Bogota, Colombia
Posts: 6
|
|
|
|

03-09-09, 13:53
|
|
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
|
|

03-09-09, 15:04
|
|
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
|
|

03-10-09, 01:11
|
|
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.
|
|

03-10-09, 05:14
|
|
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.
|

03-10-09, 06:24
|
|
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'
|
|

03-10-09, 06:57
|
|
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.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|