TimesTen 应用层数据库缓存学习:11. AWT性能监控

2024-02-04 13:48

本文主要是介绍TimesTen 应用层数据库缓存学习:11. AWT性能监控,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

演示环境准备

为了运行以下的例子,我们建立了一个AWT缓存组
Oracle Schema用户:

$ sqlplus tthr/oracle@ttorcl
create table orders(ord_num int primary key, ship_time timestamp not null);
grant select, insert, update, delete on orders to cacheadm;

TimesTen Cache管理用户:

cacheadm>
CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP "AWT" FROM"TTHR"."ORDERS" ("ORD_NUM"   NUMBER(38)   NOT NULL,"SHIP_TIME" TIMESTAMP(6) NOT NULL,PRIMARY KEY("ORD_NUM"))
cacheadm> call ttrepstart;
cacheadm> cachegroups;Cache Group CACHEADM.AWT:Cache Group Type: Asynchronous WritethroughAutorefresh: NoAging: No aging definedRoot Table: TTHR.ORDERSTable Type: Propagate1 cache group found.cacheadm>repschemes;Replication Scheme TTREP._AWTREPSCHEME:Element: _1798096                       Type: Table TTHR.ORDERSMaster Store: CACHEDB1_1122 on TIMESTEN-HOL Transmit DurableSubscriber Store: _ORACLE from TIMESTEN-HOL Store: CACHEDB1_1122 on TIMESTEN-HOLPort: (auto)Log Fail Threshold: (none)Retry Timeout: 120 secondsCompress Traffic: DisabledStore: _ORACLE from TIMESTEN-HOLPort: (auto)Log Fail Threshold: (none)Retry Timeout: 120 secondsCompress Traffic: Disabled1 replication scheme found.

OS用户,下面的输出类似于repschems

$ ttrepadmin -showconfig cachedb1_1122Self host "TIMESTEN-HOL", port auto, name "CACHEDB1_1122", LSN 19/2685192, timeout 120, threshold 0
List of subscribers
-------------------Peer name         Host name                 Port    State  Proto Track
----------------  ------------------------ ------  ------- ----- -----
_ORACLE           TIMESTEN-HOL              Auto   Start      38     0Last Msg Sent Last Msg Recv Latency TPS     RecordsPS     
------------- ------------- ------- ------- ---------     
00:00:05      -               -1.00      -1        -1 List of objects and subscriptions
---------------------------------Table details
-------------
Table : TTHR.ORDERS   Timestamp updates : -  Master Name               Subscriber name         
-----------               ---------------         
CACHEDB1_1122             _ORACLE                 

TimesTen Schema用户:

tthr>
insert into orders values(1, sysdate);
ALTER SESSION SET PLSQL_TIMEOUT = 0;
declare ord_num number;      
begin
for i in 1..1000 loop
select max(ord_num) into ord_num from orders;
insert into orders values(ord_num+1, sysdate);
commit;
dbms_lock.sleep( 1 );
end loop;
end;
/

打开 AWT 性能监控

使用ttCacheAWTMonitorConfig打开监控,然后可以用ttRepAdmin查看监控信息。
其中On表示打开,数字16表示16次采样一次,是推荐值,但在我们的例子中,我们采用1,即每次都采样

cacheadm>CALL ttCacheAWTMonitorConfig;
< OFF, 0 >
1 row found.
cacheadm>CALL ttCacheAWTMonitorConfig('off');
< OFF, 0 >
1 row found.
cacheadm>CALL ttCacheAWTMonitorConfig('on');
< ON, 16 >
1 row found.
cacheadm>CALL ttCacheAWTMonitorConfig('on', 1);
< ON, 1 >
1 row found.
cacheadm>CALL ttCacheAWTMonitorConfig;
< ON, 1 >
1 row found.

Display AWT performance results with the ttRepAdmin utility

使用ttRepAdmin的-awtmoninfo 和 -showstatus 选项,例如

$ ttRepAdmin -showstatus -awtmoninfo cachedb1_1122Replication Agent Status as of: 2016-04-21 18:04:39DSN                         : cachedb1_1122
Process ID                  : 8089 (Started)
Replication Agent Policy    : manual
Host                        : TIMESTEN-HOL
RepListener Port            : 42901 (AUTO)
Last write LSN              : 18.65272072
Last LSN forced to disk     : 18.65271808
Replication hold LSN        : 18.65206536Replication Peers:Name                     : _ORACLEHost                     : TIMESTEN-HOLPort                     : 42901 (AUTO) (Connected)Replication State        : STARTEDCommunication Protocol   : 38Name                     : CACHEDB1_1122Host                     : TIMESTEN-HOLPort                     : 0 (AUTO)Replication State        : STARTEDCommunication Protocol   : 38TRANSMITTER thread(s):For                     : _ORACLE (track 0)Start/Restart count   : 1Send LSN              : 18.65245448Transactions sent     : 467Total packets sent    : 856Tick packets sent     : 384MIN sent packet size  : 64MAX sent packet size  : 893AVG sent packet size  : 291Last packet sent at   : 18:04:39Total Packets received: 854MIN rcvd packet size  : 64MAX rcvd packet size  : 120AVG rcvd packet size  : 119Last packet rcvd'd at : 18:04:39TXNs Allocated        : 11TXNs In Use           : 5ACTs Allocated        : 11ACTs In Use           : 5ACTs Data Allocated   : 880Timeout               : 120Adapted Timeout Max   : 120Adapted Timeout Time  : 1461285423current txn           : 0.0Longest batch runtime : 0Longest batch 1st txn : 0.0Longest batch lst txn : 0.0Largest txn (ops)     : 1461231493.12371Largest txn (#ops)    : 1Longest txn (time)    : 0.0Longest txn (secs)    : 0Most recent errors (max 5):TT16025 in repagent.c (line 1227) at 17:34:49 on 04-21-2016TT16285 in transmitter.c (line 1109) at 17:34:49 on 04-21-2016TT16999 in transmitter.c (line 1447) at 17:34:49 on 04-21-2016RECEIVER thread(s):For                     : CACHEDB1_1122 (track 0)Start/Restart count   : 1Transactions received : 467Total packets sent    : 855Tick packets sent     : 0MIN sent packet size  : 64MAX sent packet size  : 120AVG sent packet size  : 119Last packet sent at   : 18:04:39Total Packets received: 2259MIN rcvd packet size  : 64MAX rcvd packet size  : 298AVG rcvd packet size  : 110Last packet rcvd'd at : 18:04:39rxWaitCTN             : 0.0prevCTN               : 0.0current txn           : 0.0serial CTN            : 0.0STA Blk Data Allocated: 32STA Data Allocated    : 4096Longest batch runtime : 0Longest batch 1st txn : 0.0Longest batch lst txn : 0.0Largest txn (ops)     : 1461231493.12371Largest txn (#ops)    : 5Longest txn (time)    : 0.0Longest txn (secs)    : 0AWT Monitoring statistics-------------------------TimesTen processing time : 138.387000 millisecs (100 %)Oracle execute  (SQL execution) time : 0.000000 millisecs (0 %)Oracle execute (PL/SQL execution) time : 0.000000 millisecs (0 %)Time since monitoring was started: 375830.816000 millisecsCacheAwtMethod mode : 1Cache-connect Operational Stats :SQL Operations sent to Oracle : 0Number of update operations : 0Number of update batches    : 0Number of insert operations : 0Number of insert batches    : 0Number of delete operations : 0Number of delete batches    : 0Total number of batches sent: 0Number of bytes sent : 0PL/SQL Operations sent to Oracle : 0Number of update operations : 0Number of insert operations : 0Number of delete operations : 0Number of batches sent : 0Number of bytes sent : 0Number of TimesTen Transactions sent to Oracle (includes retries) : 376Number of retries on TimesTen due to errors on Oracle : 0Number of round trips to Oracle (includes executes, commits and rollbacks) : 0Number of commits on Oracle : 0Number of rollbacks on Oracle : 0Number of rxbatches: 376Number of rxskips: 0Most recent errors (max 5):TT16025 in repagent.c (line 1227) at 17:34:49 on 04-21-2016

注意AWT Monitoring statistics部分。

Using system tables to monitor AWT operations

查询SYS.MONITOR的LAST_LOG_FILE, REPHOLD_LOG_FILE 和 REPHOLD_LOG_OFF列。
它们的含义为:
- LAST_LOG_FILE: Most recent log file present
- REPHOLD_LOG_FILE: Number of last log file held by replication
- REPHOLD_LOG_OFF: Offset in last log file held by replication

SYS.MONITOR只有一行记录, 输出中的18表示log文件是cachedb1_1122.log18

cacheadm>select LAST_LOG_FILE, REPHOLD_LOG_FILE, REPHOLD_LOG_OFF from SYS.MONITOR;
< 18, 18, 63803656 >
1 row found.
cacheadm>select LAST_LOG_FILE, REPHOLD_LOG_FILE, REPHOLD_LOG_OFF from SYS.MONITOR;
< 18, 18, 63854856 >
1 row found.
cacheadm>select LAST_LOG_FILE, REPHOLD_LOG_FILE, REPHOLD_LOG_OFF from SYS.MONITOR;
< 18, 18, 63854856 >
1 row found.

依据下面的原则来判断是非有问题,即如果复制hold的日志文件和产生的最新日志文件差距不断拉大,则表示复制数据的速度赶不上产生数据的速度

If the difference between the value in the LAST_LOG_FILE column and the value in the REPHOLD_LOG_FILE column is increasing over time, and the value in the REPHOLD_LOG_OFF column is increasing slowly or not changing, then the tables are being updated at a faster rate than the updates are being replicated.

如果有问题,可以结合以下的命令再判断

$ ttRepAdmin -receiver -list cachedb1_1122
Peer name         Host name                 Port    State  Proto Track
----------------  ------------------------ ------  ------- ----- -----
_ORACLE           TIMESTEN-HOL              Auto   Start      38     0Last Msg Sent Last Msg Recv Latency TPS     RecordsPS Logs
------------- ------------- ------- ------- --------- ----
00:00:04      -               -1.00      -1        -1    1

这篇关于TimesTen 应用层数据库缓存学习:11. AWT性能监控的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/677715

相关文章

IDEA如何切换数据库版本mysql5或mysql8

《IDEA如何切换数据库版本mysql5或mysql8》本文介绍了如何将IntelliJIDEA从MySQL5切换到MySQL8的详细步骤,包括下载MySQL8、安装、配置、停止旧服务、启动新服务以及... 目录问题描述解决方案第一步第二步第三步第四步第五步总结问题描述最近想开发一个新应用,想使用mysq

C#使用yield关键字实现提升迭代性能与效率

《C#使用yield关键字实现提升迭代性能与效率》yield关键字在C#中简化了数据迭代的方式,实现了按需生成数据,自动维护迭代状态,本文主要来聊聊如何使用yield关键字实现提升迭代性能与效率,感兴... 目录前言传统迭代和yield迭代方式对比yield延迟加载按需获取数据yield break显式示迭

Oracle数据库使用 listagg去重删除重复数据的方法汇总

《Oracle数据库使用listagg去重删除重复数据的方法汇总》文章介绍了在Oracle数据库中使用LISTAGG和XMLAGG函数进行字符串聚合并去重的方法,包括去重聚合、使用XML解析和CLO... 目录案例表第一种:使用wm_concat() + distinct去重聚合第二种:使用listagg,

Redis缓存问题与缓存更新机制详解

《Redis缓存问题与缓存更新机制详解》本文主要介绍了缓存问题及其解决方案,包括缓存穿透、缓存击穿、缓存雪崩等问题的成因以及相应的预防和解决方法,同时,还详细探讨了缓存更新机制,包括不同情况下的缓存更... 目录一、缓存问题1.1 缓存穿透1.1.1 问题来源1.1.2 解决方案1.2 缓存击穿1.2.1

使用zabbix进行监控网络设备流量

《使用zabbix进行监控网络设备流量》这篇文章主要为大家详细介绍了如何使用zabbix进行监控网络设备流量,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录安装zabbix配置ENSP环境配置zabbix实行监控交换机测试一台liunx服务器,这里使用的为Ubuntu22.04(

Java读取InfluxDB数据库的方法详解

《Java读取InfluxDB数据库的方法详解》本文介绍基于Java语言,读取InfluxDB数据库的方法,包括读取InfluxDB的所有数据库,以及指定数据库中的measurement、field、... 首先,创建一个Java项目,用于撰写代码。接下来,配置所需要的依赖;这里我们就选择可用于与Infl

springboot健康检查监控全过程

《springboot健康检查监控全过程》文章介绍了SpringBoot如何使用Actuator和Micrometer进行健康检查和监控,通过配置和自定义健康指示器,开发者可以实时监控应用组件的状态,... 目录1. 引言重要性2. 配置Spring Boot ActuatorSpring Boot Act

Java实现任务管理器性能网络监控数据的方法详解

《Java实现任务管理器性能网络监控数据的方法详解》在现代操作系统中,任务管理器是一个非常重要的工具,用于监控和管理计算机的运行状态,包括CPU使用率、内存占用等,对于开发者和系统管理员来说,了解这些... 目录引言一、背景知识二、准备工作1. Maven依赖2. Gradle依赖三、代码实现四、代码详解五

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora