简体   繁体   English

如何在IBM Mainframe zos DB2上识别远程Type 4 JDBC工作负载

[英]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. 我需要能够确定IBM大型机DB2 v10 zos数据库上的Type 4 jdbc工作负载。

Our mainframe db2 monitor can filter on the following fields 我们的大型机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

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? 可以在我的Java客户端jdbc代码中设置“可能的候选人”吗?

ii). 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 如果我不能使用任何这些字段,那么我已经设法修改了与我的JDBC连接关联的clientInfo ,如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? 在这种情况下,我在ClientInfo修改了ApplicationName ,我想要的是自定义的初始值,例如,初始值WAS'NT“ db2jcc_application ”但“开始为” xxxxxx_application “,这可能吗?

Working with the DB2Driver you should be able to set application name like this: 使用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);

If you're using a DB2DataSource, check out this information from IBM : 如果您使用的是DB2DataSource,请从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 clientProgramName

Specifies an application ID that is fixed for the duration of a physical connection for a client. 指定在客户端的物理连接期间固定的应用程序ID。 The value of this property becomes the correlation ID on a DB2 for z/OS server. 该属性的值成为DB2 for z / OS服务器上的关联ID Database administrators can use this property to correlate work on a DB2 for z/OS server to client applications. 数据库管理员可以使用此属性将DB2 for z / OS服务器上的工作与客户端应用程序相关联。 The data type of this property is String. 此属性的数据类型为String。 The maximum length is 12 bytes. 最大长度为12个字节。 If this value is null, the IBM DB2 Driver for JDBC and SQLJ supplies a value of db2jccthread-name. 如果该值为null,则IBM DB2 Driver for JDBC和SQLJ提供db2jccthread-name的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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