Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

ibm_rtmon_data exceptions

  • 1.  ibm_rtmon_data exceptions

    Posted Thu April 23, 2020 05:41 AM

    Hi.

    In the monitor log file we have many error messages regarding the DSM scheme ibm_rtmon_data.

    For example when trying to insert into table ibm_rtmon_data.resource_storagegroup.

    I think that's a bug?




    ------------------------------
    Best regards

    Karsten Wilhelm
    ------------------------------

    #Db2


  • 2.  RE: ibm_rtmon_data exceptions

    Posted Fri April 24, 2020 12:06 AM
    Hi Karsten,

    This is Ke from DMC development team. It's a problem to use the deprecated schema. Could you share the error messages in the log?
    Any other tables have the same problem?

    Does your repository database regard a line starts with -- as comment in a query?

    Thanks,
    Ke

    ------------------------------
    KE CHEN
    ------------------------------



  • 3.  RE: ibm_rtmon_data exceptions

    Posted Fri April 24, 2020 02:53 AM
    ​Hi KE CHEN,

    there really are -- in the error message...

    monitor (170)                   Apr 23, 2020 1:02:11 AM         ERROR    Batch persist failed :
    org.apache.ibatis.exceptions.PersistenceException:
    ### Error updating database.  Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='dbconn_int', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resu
    ltMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTyp
    eForNull configuration property. Cause: com.ibm.db2.jcc.am.SqlException: [jcc][10271][10295][4.26.14] Unrecognized JDBC type: 0. ERRORCODE=-4228, SQLSTATE=null
    ### The error may involve com.ibm.aps.tools.monitor.collector.mybatis.mapper.StorageMapper.persist-Inline
    ### The error occurred while setting parameters
    ### SQL: --insert into ibm_rtmon_data.resource_storagegroup(   insert into .resource_storagegroup(   dbconn_int,   collected,   timestamp,   level_tag,        fs_total_size,         fs_used_size    )   values(   ?,   ?,   ?,   ?,   ?
    ,   ?   )
    ### Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='dbconn_int', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeNa
    me='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration pro
    perty. Cause: com.ibm.db2.jcc.am.SqlException: [jcc][10271][10295][4.26.14] Unrecognized JDBC type: 0. ERRORCODE=-4228, SQLSTATE=null
            at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
            at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)
            at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
            at com.sun.proxy.$Proxy308.persist(Unknown Source)
            at com.ibm.aps.tools.monitor.collector.consumer.MonitorPersistConsumer.run(MonitorPersistConsumer.java:131)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
            at java.lang.Thread.run(Thread.java:818)
    Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='dbconn_int', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeNa
    me='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration pro
    perty. Cause: com.ibm.db2.jcc.am.SqlException: [jcc][10271][10295][4.26.14] Unrecognized JDBC type: 0. ERRORCODE=-4228, SQLSTATE=null
            at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:89)
            at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:93)
            at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)
            at org.apache.ibatis.executor.BatchExecutor.doUpdate(BatchExecutor.java:71)
            at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
            at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
            ... 8 more
    Caused by: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: com.ibm.db2.j
    cc.am.SqlException: [jcc][10271][10295][4.26.14] Unrecognized JDBC type: 0. ERRORCODE=-4228, SQLSTATE=null
            at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:47)
            at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:87)
            ... 14 more
    Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][10271][10295][4.26.14] Unrecognized JDBC type: 0. ERRORCODE=-4228, SQLSTATE=null
            at com.ibm.db2.jcc.am.b7.a(b7.java:794)
            at com.ibm.db2.jcc.am.b7.a(b7.java:66)
            at com.ibm.db2.jcc.am.b7.a(b7.java:116)
            at com.ibm.db2.jcc.am.ao.m(ao.java:1504)
            at com.ibm.db2.jcc.am.k5.e(k5.java:948)
            at com.ibm.db2.jcc.am.k5.setNull(k5.java:843)
            at org.apache.commons.dbcp2.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:499)
            at org.apache.commons.dbcp2.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:499)
            at org.apache.commons.dbcp2.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:499)
            at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:45)
            ... 15 more

    Since the last update to 3.1.1 we have new tables in the repository database:

    ACTIVITY                        IBM_RTMON       T     2020-04-09-15.05.53.227220
    ACTIVITY_STMT                   IBM_RTMON       T     2020-04-09-15.05.53.568396
    HISTOGRAMBIN                    IBM_RTMON       T     2020-04-08-10.14.58.881885
    LOCK_EVENT                      IBM_RTMON       T     2020-04-08-10.14.54.443711
    LOCK_PARTICIPANTS               IBM_RTMON       T     2020-04-08-10.14.54.518663
    LOCK_PARTICIPANT_ACTIVITIES     IBM_RTMON       T     2020-04-08-10.14.54.582421
    UTIL_COMMON                     IBM_RTMON       T     2020-04-08-10.15.02.238742
    UTIL_LOCATION                   IBM_RTMON       T     2020-04-08-10.15.02.532490
    UTIL_START                      IBM_RTMON       T     2020-04-08-10.15.02.337754
    UTIL_STOP                       IBM_RTMON       T     2020-04-08-10.15.02.491605
    WLSTATS                         IBM_RTMON       T     2020-04-08-10.14.58.822682

    ------------------------------
    Best regards

    Karsten Wilhelm
    ------------------------------



  • 4.  RE: ibm_rtmon_data exceptions

    Posted Fri April 24, 2020 05:25 AM
    Thank you for your reply. The error is saying that the first parameter can not to be null. It's not a normal behavior. We need the whole log file to investigate why the parameter is null. I will send you my email privately, could you send the log file to me? 

    From the log, this line is ignored. 
    --insert 
    into ibm_rtmon_data.resource_storagegroup(

    Thanks,
    Ke

    ------------------------------
    KE CHEN
    ------------------------------



  • 5.  RE: ibm_rtmon_data exceptions

    Posted Mon April 27, 2020 08:49 AM

    So,  it looks the breaklines are removed when the query is logged into the logs..  

    In that case.  it looks the real query is: 

    SQL: 
    --insert into ibm_rtmon_data.resource_storagegroup(   
    insert into .resource_storagegroup
        (dbconn_int, collected, timestamp, level_tag, fs_total_size, fs_used_size )
     values(   ?,   ?,   ?,   ?,   ? ,   ?   )

     

    If this is true..   the issue is obvious..   SCHEMA is missing,   there is a "." (dot)  in front of table-name,  but no schema specified. 

    Regards



    ------------------------------
    Samuel Pizarro
    ------------------------------



  • 6.  RE: ibm_rtmon_data exceptions

    Posted Mon April 27, 2020 10:32 PM
    Edited by System Admin Fri January 20, 2023 04:11 PM
    The schema name is a parameter to be passed in. It seems that there is something wrong with the data source from the previous query. It may return something that we didn't expect. So all the parameters are not correctly set.

    Could you run this query against connection named 'l16int21' and let us know the result? Thanks.

    select sum(fs_total_size)/(1024*1024*1024) as fs_total_size, sum(fs_used_size)/(1024*1024*1024) as fs_used_size from (select sum(fs_total_size)/(1024*1024*1024) as fs_total_size, sum(fs_used_size)/(1024*1024*1024) as fs_used_size from (             select distinct fs_id, fs_total_size, fs_used_size        from table(ADMIN_GET_STORAGE_PATHS(null,-2)))

    ------------------------------
    KE CHEN
    ------------------------------



  • 7.  RE: ibm_rtmon_data exceptions

    Posted Tue April 28, 2020 02:15 AM
    I have corrected the statement so that it works. The output is:

    db2 "select sum(fs_total_size)/(1024*1024*1024) as fs_total_size, sum(fs_used_size)/(1024*1024*1024) as fs_used_size from (select distinct fs_id, fs_total_size, fs_used_size from table(ADMIN_GET_STORAGE_PATHS(null,-2)))"

    FS_TOTAL_SIZE FS_USED_SIZE
    -------------------- --------------------
    - -

    1 record(s) selected.

    One bracket was missing and the first subquery is double.

    Regards





    ------------------------------
    Karsten Wilhelm
    ------------------------------



  • 8.  RE: ibm_rtmon_data exceptions

    Posted Wed April 29, 2020 02:33 AM
    Hi Karsten Wilhelm,

    Thank you for your quick response. We have investigated this problem and found that it's caused by absence of storage group.

    What's your consideration of not creating a storage group? Could you create one?

    Thanks,
    Ke

    ------------------------------
    KE CHEN
    ------------------------------



  • 9.  RE: ibm_rtmon_data exceptions

    Posted Wed April 29, 2020 03:48 AM
    Hi,

    yes I could. But why should I do it?

    We do not use storage groups in our customer systems. But that shouldn't lead to exceptions. I think this query should be intercepted.

    I'll try anyway and I'll get back to you later.


    Regards

    ------------------------------
    Karsten Wilhelm
    ------------------------------



  • 10.  RE: ibm_rtmon_data exceptions

    Posted Wed April 29, 2020 05:25 AM
    Hi,

    You are right. We have made changes to avoid this exception upon this issue. But without storage group, you won't be able to view the storage usage in the monitor summary page.

    Thank you for reporting this issue.

    Regards,
    Ke


    ------------------------------
    KE CHEN
    ------------------------------



  • 11.  RE: ibm_rtmon_data exceptions

    Posted Wed April 29, 2020 02:47 AM
    I think you made a typo here. Those tables are created by event monitors in the monitored database.

    ACTIVITY                        IBM_RTMON       T     2020-04-09-15.05.53.227220
    ACTIVITY_STMT                   IBM_RTMON       T     2020-04-09-15.05.53.568396
    HISTOGRAMBIN                    IBM_RTMON       T     2020-04-08-10.14.58.881885
    LOCK_EVENT                      IBM_RTMON       T     2020-04-08-10.14.54.443711
    LOCK_PARTICIPANTS               IBM_RTMON       T     2020-04-08-10.14.54.518663
    LOCK_PARTICIPANT_ACTIVITIES     IBM_RTMON       T     2020-04-08-10.14.54.582421
    UTIL_COMMON                     IBM_RTMON       T     2020-04-08-10.15.02.238742
    UTIL_LOCATION                   IBM_RTMON       T     2020-04-08-10.15.02.532490
    UTIL_START                      IBM_RTMON       T     2020-04-08-10.15.02.337754
    UTIL_STOP                       IBM_RTMON       T     2020-04-08-10.15.02.491605
    WLSTATS                         IBM_RTMON       T     2020-04-08-10.14.58.822682

    ------------------------------
    KE CHEN
    ------------------------------