onstat -g ckp 命令:打印 checkpoint 历史记录和配置建议

可以使用 onstat -g ckp 命令打印 checkpoint 历史记录,显示配置建议(如果检测到次优的配置)。

语法:

示例输出

图: onstat -g ckp 命令输出

Auto Checkpoints=On   RTO_SERVER_RESTART=60 seconds   Estimated recovery time 7 seconds
                                                           Critical Sections        
        Clock                        Total  Flush  Block  #      Ckpt  Wait  Long  #Dirty
        Interval Time     Trigger  LSN        Time   Time   Time   Waits  Time  Time  Time  Buffers
        1        18:41:36 Startup  1:f8       0.0    0.0    0.0    0      0.0   0.0   0.0   4    
        2        18:41:49 Admin    1:11c12cc  0.3    0.2    0.0    1      0.0   0.0   0.0   2884 
        3        18:42:21 Llog     8:188      2.3    2.0    2.0    1      0.0   2.0   2.0   14438 
        4        18:42:44*User     10:19c018  0.0    0.0    0.0    1      0.0   0.0   0.0   39  
        5        18:46:21 RTO      13:188     54.8   54.2   0.0    30     0.6   0.4   0.6   68232 
      
           Physical Log    Logical Log
        Dskflu   Total   Avg      Total   Avg
        /Sec     Pages   /Sec     Pages  /Sec
        4        3       0        1       0
        2884     1966    163      4549    379
        7388     318     10       65442   2181
        39       536     21       20412   816
        1259     210757  1033     150118  735
Max Plog   Max Llog    Max Dskflush    Avg Dskflush   Avg Dirty   Blocked
          pages/sec  pages/sec   Time            pages/sec      pages/sec   Time
          8796       6581        54              43975          2314         0

输出描述

Auto Checkpoints
标示 AUTO_CKPTS 配置参数是 on 或 off
RTO_SERVER_RESTART
显示 RTO 时间(以秒为单位)。零(0)意味着 RTO 是关闭的
Estimated recovery time ## seconds
如果数据服务器停止响应,标示评估恢复时间。该值仅在 RTO_SERVER_RESTART 被激活时出现。
Interval
Checkpoint 间隔 ID
Clock Time
Checkpoint 发生的 Clock 时间
Trigger
事件触发 checkpoint 。 星号(*)表示请求的 checkpoint 是事务阻塞的 checkpoint 。
触发器名称 描述
Admin 管理员相关任务。例如:
  • 创建、删除或重命名 dbspace
  • 添加或删除 chunk
  • 添加或删除日志文件
  • 更改物理日志大小和位置
  • 分区上 "shrink" 操作之后
  • 打开或关闭镜像
Backup 备份相关操作。例如:
  • 假备份
  • 启动归档
  • 完整的物理恢复后
CDR 第一次启动 ER 子系统或在所有复制参与者被移除后,重启 ER 子系统
CKPTINTVL 当 checkpoint 间隔过期。Checkpoint 间隔是在 onconfig 文件中 CKPTINTVL 参数指定的值
Conv/Rev 转换复原 checkpoint 。转换检查阶段后磁盘结构实际实际转换前。复原完成之后也将触发 checkpoint 。
HA 高可用性。例如:
  • 新添加到高可用集群的 RSS 或 SDS 节点
  • 提升为主服务器的辅助服务器
  • 物理日志文件低的辅助服务器
HDR 高可用性数据复制。例如:
  • 更改的服务器方式
  • 安装 HDR 后的启动第一次传输
  • 有潜在的主或辅助服务器上的物理日志溢出
Lightscan 在分区上关闭观察四周之前
Llog 逻辑日志资源耗尽
LongTX 长事务。如果发现长事务未停止,那么会发起 checkpoint 停止该事务。在回滚过程中,如果在长事务终止后 checkpoint 还未准备发生,那么会在回滚阶段发起 checkpoint 。
Misc 杂项事件。例如::
  • 由于 I/O 错误 dbspace 或 chunk 关闭
  • 在回滚过程中,撤销 chunk 的附加部分时。例如:正在移动 chunk 时。
  • 聚集索引创建的过程中或变更索引为聚集索引时。
Plog 物理日志具有以下之一的条件:
  • 物理日志已满 75%
  • 已使用的物理日志量加上脏分区的数量已超出物理日志大小的 90%
Restore Pt 还原点。Checkpoint 在还原点开始和结束。还原点(由转换守护程序使用)是启用的 CONVERSION_GUARD 配置参数,是 RESTORE_POINT_DIR 配置参数指定的临时目录。
Recovery 在恢复过程中,快速恢复开始时
Reorg 在联机索引生成开始
RTO 维护恢复时间目标(RTO)协议。在正常操作时,在系统崩溃后重新启动的时间可能会超过 RTO_SERVER_RESTART 配置参数所设置的值。
Stamp Wrap Checkpoint 时间戳。如果新的 checkpoint 时间戳出现在最后写入的 checkpoint 之前,那么时间戳在 checkpoint 间间隔先进先出。这样会触发另一个 checkpoint 。
Startup 数据库服务器启动时。
Uncompress 在表或分区上发生解压命令。只在表中的 checkpoint 或 没有日志记录的数据库中应用。
User 用户提交 checkpoint 请求
LSN
Checkpoint 记录在逻辑日志中的位置
Total Time
以秒表示 checkpoint 持续的总时间,从请求开始到 checkpoint 结束
Flush Time
以秒表示清除缓冲池的时间
Block Time
由于 checkpoint 被稀缺的必需资源触发而导致事务阻塞的时间(以秒表示)。例如:耗尽物理日志或环绕逻辑日志
# Waits
由于正在等待 checkpoint 而阻塞的事务的数量
Ckpt Time
以秒表示所有事务认识到请求的 checkpoint 的时间
Wait Time
以秒表示该事务已等待 checkpoint 的平均时间
Long Time
以秒表示事务等待 checkpoint 的最长时间
# Dirty Buffers
在 checkpoint 期间,刷新到磁盘的 dirty 缓冲区的数量
Dskflu/sec
每秒刷新的缓冲区数
Physical Log Total Pages
在 checkpoint 间隔,物理日志记录的总页数
Physical Log Avg/Sec
在 checkpoint 间隔,物理日志活动的平均率
Logical Log Total Pages
在 checkpoint 间隔,逻辑日志记录的总页数
Logical Log Avg/Sec
在 checkpoint 间隔,逻辑日志活动的平均率
Max Plog pages/sec
在 checkpoint 间隔,物理日志活动的最大速率
Max Llog pages/sec
在 checkpoint 间隔,逻辑日志活动的最大速率
Max Dskflush Time
以秒表示缓冲池刷新到磁盘的最长时间
Avg Dskflush pages/sec
缓冲池刷新到磁盘的平均速率
Avg Dirty pages/sec
在 checkpoint 之间 dirty 页的平均速率
Blocked Time
以秒表示自上次数据库服务器启动后最长阻塞时间

性能建议消息

如果 GBase 8s 数据服务器检测到一个次优的配置,那么在 checkpoint 历史记录下会出现一个有关性能调整的建议消息。该性能建议也在消息日志中出现。以下是性能建议消息的示例:

Physical log is too small for bufferpool size. System performance may be 
        less than optimal.
        Increase physical log size to at least %ldKb
        
        Physical log is too small for optimal performance.
        Increase the physical log size to at least $ldKb.
        
        Logical log space is too small for optimal performance.
        Increase the total size of the logial log space to at least %ld Kb.
        
        Transaction blocking has taken place. The physical log is too small.
        Please increase the size of the physical log to %ldKb
        
        Transaction blocking has taken place. The logical log space is too small.
        Please increase the size of the logical log space to %ldKb