如何识别 IBM 大型机 zos DB2 上的远程 Type 4 JDBC 工作负载

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

我需要能够识别 IBM 大型机 DB2 v10 zos 数据库上的类型 4 jdbc 工作负载。

我们的大型机 db2 监视器可以过滤以下字段

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

我猜这些值中有很多都无法更改。

但是这些项目似乎很可能是候选人

CONNECTION ID
CORRELATION ID
REQUESTING LOCATION
OTHER LOCATION

我的问题是:-

我)。可以在我的 java 客户端 jdbc 代码中设置 "likely candidates" 吗?

ii).如何设置这些 "likely candidates"?

如果我不能使用这些字段中的任何一个,那么我已经设法修改了与我的 JDBC 连接关联的 clientInfo,如 jdbc trace[= 的片段所示19=]

[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

在这种情况下,我在ClientInfo中修改了ApplicationName,我想要的是自定义的初始值,例如初始值是'NT“db2jcc_application”但是"started out as "xxxxxx_application”,这可能吗?

使用 DB2Driver,您应该能够像这样设置应用程序名称:

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);

如果您使用的是 DB2DataSource,请查看 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");       

如前所述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.