ibm-db2 >> SQL Query to retrieve Server Hostname/IP address

by 4.spam » Tue, 28 Apr 2009 19:42:22 GMT

> Is there a SQL query to retrieve server full hostname or IP address.
>
> Something like
> select current server as server from sysibm.sysdummy1
>
> Thanks.

SELECT HOST_NAME FROM TABLE(SYSPROC.ENV_GET_SYS_INFO()) T

Sincerely,
Mark B.

ibm-db2 >> SQL Query to retrieve Server Hostname/IP address

by Sawan » Tue, 28 Apr 2009 19:54:41 GMT



Thanks. It gives me the hostname, Is there a way to retrieve domain as
well ?

ibm-db2 >> SQL Query to retrieve Server Hostname/IP address

by Sawan » Tue, 28 Apr 2009 19:56:59 GMT


Against z/OS it gives
SQL0104N An unexpected token "<EMPTY>" was found following "".
Expected
tokens may include: "CORRELATION NAME". SQLSTATE=42601

Similar Threads

1. Querying the WAN IP Address of a Linksys Router

OK, quick summary:

I have DSL connected to a Linksys wireless router. The WAN IP adress
is dynamic (changes every so often).  I need to query the router for
its WAN IP address from an internal machine and write it to a text
file which will then be sent to my hotmail account.

The automated sending of the info once it is contain within a text
file is simple.  What I don't know how to do from a windows platform
is write a simple batch file or .vbs script that will retrieve the
information from the router itself.  I thought I'd be able to run a
scheduled tracert from an internal machine, but when I do this the
output skips over the external interface of the Linksys and jumps
right to my gateway.

Any hints?  All the info I have found for this type of operation is
related to the UNIX platform.  At the risk of alienating potential
help let me say this, UNIX has never been my friend.  ;)

Thanks in advance.

Wren

2. mac address and ip address

3. can not start db2 after changing hostname in db2nodes.cfg file to service IP alias

> change the hostname value in db2nodes.cfg of instance to service IP
> alias ( say srv1 ) which is nothing but another resolvable hostname

I think you mean the virtual IP address which is failing over when one node
goes down, right?
service ip addresses are usually used to connect directly to one of the nodes.

You need to make sure that the reverse lookup points to the correct IP.
Please add the virtual IP to your hosts file. Furthermore you have to change
your .rhosts file to include the new hostname/ip.

Here are the correct steps:

install DB2 on both machines, with their physical machine names and service ip
addresses.
add virtual hostname / ip address to your resource group or use a new resource
group (depending on your env)
change the entries in db2nodes.cfg to the virtual hostname
add virtual hostname / ip address to /etc/hosts
add the virtual addresses to your .rhosts file

that should do it.

-- 
Helmut K. C. Tessarek
DB2 Performance and Development

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/

4. can not start db2 after changing hostname in db2nodes.cfg file to service IP alias

5. query sql server/oracle table from Db2 or join db2 table with sqlserver table

My application connects to a DB2 V8.2 EE database running on AIX. I
need to now lookup a table in SQL SERVER via the DB2 connection.   I
also need to run an sql that joins a DB2 table with an Oracle table.
How can I accomplish this ?  Do i need a seperate product ?
I also have license for Db2 v8 connect that I use for connecting to
db2 on the mainframe.

TIA

Roger

6. query sql server/oracle table from Db2 or join db2 table with sqlserver table

7. Retrieving Mac address of remote

I've seen all of the threads about getting the MAC address of the local
AS/400 adaptor and remote system IP addresses. Has anyone tripped
across a way to retrieve the MAC address of the remote telnet session??

I have a situation that I can't rely on the IP address as the devices
are configured up for DCHP (reconfiguring is a nightmare!). If I can
retrieve the remote MAC address, I can link the MAC address to a data
set.

8. NETBIOS: Retrieve Windows Computer name/Workgroup via AS/400 from IP - AS/400