I need to get info about user connected to my DB2. How can I get (if I can) computer name/login or IP of that user? I can get host_name
, current user
and login to DB2, but I want more specific information like IP or computer name.
How I can do this?
相关问题
- What is the best way to handle BOOLEAN values in D
- SQL1032N No start database manager command was iss
- COBOL DB2 program
- SQL LIKE Column Value Plus Wildcard DB2
- copying a very large table from one DB2 to another
相关文章
- Escape percentage sign DB2 SQL
- DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703 [clo
- Extra rows being received when matching pairs in S
- How to check DB2 SYSADM or SYSCTRL authorization f
- Which is the Best database for Rails application?
- How do I get connection pooling working on a PHP-C
- Why can't my As400 select from a newly created
- Where do I download JDBC drivers for DB2 that are
You can obtain some useful data using the MetaData. For example the following code:
Should give you something close to this:
Edit # 2
The DB_MEMBERS table function returns basic member information about a DB2 instance.
This would output something like the following:
MEMBER_NUMBER-----------HOST_NAME--------------PARTITION_NUMBER------MEMBER_TYPE
0-------------------------member1.mycompany.com----------------0--------------------------D
1-------------------------member2.mycompany.com----------------0--------------------------C
7-------------------------member3.mycompany.com----------------0--------------------------D
You can select these columns:
I tested this on DB 10 and it's working, however I didn't test it on DB 9
db2
Output
341 record(s) selected.
You can get that information from the MON_GET_CONNECTION table function.
The table functions have change a lot in the last versions, so it depends on your DB2 version what values you can get.
For example CLIENT_HOSTNAME and CLIENT_IPADDR does not work in v9.7
http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.sql.rtn.doc/doc/r0053938.html