简体   繁体   中英

How to identify remote Type 4 JDBC workload on IBM Mainframe zos DB2

I need to be able to identify Type 4 jdbc workload on an IBM mainframe DB2 v10 zos database.

Our mainframe db2 monitor can filter on the following fields

SYSTEM ID
DB2 SUBSYSTEM ID
DATA SHARING GROUP
AUTHORIZATION ID
PLAN NAME
CONNECTION ID
OPERATOR ID
CORRELATION ID
DBRM/PACKAGE ID
BUFFER POOL ID
COLLECTION ID
LOCAL LOCATION
REQUESTING LOCATION
OTHER LOCATION
DATABASE.PAGESET
LOCK RESOURCE

I am guessing many of these values are not available to be changed.

However these items seems likely candidates

CONNECTION ID
CORRELATION ID
REQUESTING LOCATION
OTHER LOCATION

my questions are:-

i). Can the "likely candidates" be set in my java client jdbc code?

ii). How can I set these "likely candidates"?

If i cannot use any of these fields, then I have managed to amend the clientInfo associated with my JDBC connection, as shown in this snippet of jdbc trace

[jcc][Time:2015-12-10-14:39:24.851][Thread:main][Connection@3b6eb2ec] getClientInfo () called
[jcc][Time:2015-12-10-14:39:24.851][Thread:main][Connection@3b6eb2ec] getClientInfo () returned {ClientUser=XXXXXX00, ApplicationName=db2jcc_application, ClientHostname=L0513039, ClientAccountingInformation=JCC04130L0513039                                      '}
[jcc][SystemMonitor:stop] core: 0.28737999999999997ms | network: 0.0ms | server: 0.0ms
[jcc][SystemMonitor:start] 
[jcc][Time:2015-12-10-14:39:24.852][Thread:main][Connection@3b6eb2ec] setClientInfo ({ApplicationName=crsJCC_application}) called
[jcc][SystemMonitor:stop] core: 3.613203ms | network: 0.0ms | server: 0.0ms
[jcc][SystemMonitor:start] 
[jcc][Time:2015-12-10-14:39:24.856][Thread:main][Connection@3b6eb2ec] getClientInfo () called
[jcc][Time:2015-12-10-14:39:24.856][Thread:main][Connection@3b6eb2ec] getClientInfo () returned {ClientUser=XXXXXX00, ApplicationName=xxxxxx_application, ClientHostname=L0513039, ClientAccountingInformation=JCC04130L0513039                                      '}
[jcc][SystemMonitor:stop] core: 0.24718099999999998ms | network: 0.0ms | server: 0.0ms
[jcc][Time:2015-12-10-14:39:24.857][Thread:main][Connection@3b6eb2ec] createStatement () called
[jcc][Time:2015-12-10-14:39:24.863][Thread:main][Connection@3b6eb2ec] createStatement () returned Statement@5ebec15
[jcc

In this case I amended the ApplicationName within ClientInfo , what I would like is that the initial value as customised, eg that the initial value WAS'NT " db2jcc_application " but "started out as " xxxxxx_application ", is this possible?

Working with the DB2Driver you should be able to set application name like this:

Properties p= new Properties();
p.put("user", "admin");
p.put("password", "secret");
p.put("clientProgramName", "xxxx_application");
Connection conn = DriverManager.getConnection(
    "jdbc:db2://localhost:50000/yourdb", props);

If you're using a DB2DataSource, check out this information from IBM :

       com.ibm.db2.jcc.DB2DataSource ds = 
          new com.ibm.db2.jcc.DB2DataSource();                                       

       ds.setDriverType(4);
       ds.setServerName("localhost");                             
       ds.setPortNumber(50000);                                   
       ds.setDatabaseName("sample");                              
       ds.setUser("username");                                  
       ds.setPassword("password");                              
       ds.setClientProgramName("My application");       

As stated here :

clientProgramName

Specifies an application ID that is fixed for the duration of a physical connection for a client. The value of this property becomes the correlation ID on a DB2 for z/OS server. Database administrators can use this property to correlate work on a DB2 for z/OS server to client applications. The data type of this property is String. The maximum length is 12 bytes. If this value is null, the IBM DB2 Driver for JDBC and SQLJ supplies a value of db2jccthread-name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM