赞
踩
慢SQL一直是数据运维中的痛点问题,如何有效诊断慢SQL根因是当前一大难题,工具结合openGauss自身特点融合了现网DBA慢SQL诊断经验,该工具可以支持慢SQL根因15+,能同时按照可能性大小输出多个根因并提供针对性的建议。
假设用户已经初始化配置文件目录confpath,则可以通过下述命令实现本特性的功能:
gs_dbmind service start -c confpath --only-run slow_query_diagnosis
gs_dbmind component slow_query_diagnosis show -c confpath --query SQL --start-time timestamps0 --end-time timestamps1
gs_dbmind component slow_query_diagnosis clean -c confpath --retention-days DAYS
gs_dbmind service stop -c confpath
模块命令行说明:
gs_dbmind component slow_query_diagnosis --help
usage: [-h] -c DIRECTORY [--query SLOW_QUERY]
[--start-time TIMESTAMP_IN_MICROSECONDS]
[--end-time TIMESTAMP_IN_MICROSECONDS] [--retention-days DAYS]
{show,clean}
Slow Query Diagnosis: Analyse the root cause of slow query
positional arguments:
{show,clean} choose a functionality to perform
optional arguments:
-h, --help show this help message and exit
-c DIRECTORY, --conf DIRECTORY
set the directory of configuration files
--query SLOW_QUERY set a slow query you want to retrieve
--start-time TIMESTAMP_IN_MICROSECONDS
set the start time of a slow SQL diagnosis result to
be retrieved
--end-time TIMESTAMP_IN_MICROSECONDS
set the end time of a slow SQL diagnosis result to be
retrieved
--retention-days DAYS
clear historical diagnosis results and set the maximum
number of days to retain data
参数 | 参数说明 | 取值范围 |
---|---|---|
-h, –help | 帮助命令 | - |
action | 动作参数 | show:结果展示,clean:清理结果 |
-c,–conf | 配置目录 | - |
–query | 慢SQL文本 | * |
–start-time | 显示开始时间的时间戳,单位毫秒 | 非负整数 |
–end-time | 显示结束时间的时间戳,单位毫秒 | 非负整数 |
–retention-days | 清理天数级结果 | 非负实数 |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。