人大金仓kwr报告

1、查看kwr插件是否安装

ksql -U system ncdb
\dx
如果没有kwr插件安装
CREATE EXTENSION sys_kwr;

   关闭数据库

2、修改kingbase.conf参数

track_counts = on
track_sql = on
track_io_timing = on
track_wait_timing = on
track_functions = all			# none, pl, all
sys_stat_statements.track = 'top'
track_instance = on
sys_kwr.track_objects = on
sys_kwr.track_os = on
sys_kwr.enable = on    --自动生成快照
sys_kwr.topn = 20
sys_kwr.history_days = 8
sys_kwr.interval = 60
sys_kwr.language = 'chinese' 
[kingbase@mysql01 data]$ grep "shared_preload_libraries" kingbase.conf 
shared_preload_libraries = 'liboracle_parser, synonym, plsql, force_view, kdb_flashback,plugin_debugger, plsql_plugin_debugger, plsql_plprofiler, ora_commands,kdb_ora_expr, sepapower, dblink, sys_kwr, sys_ksh, sys_spacequota, sys_stat_statements, backtrace, kdb_utils_function, auto_bmr, sys_squeeze, src_restrict'

3、启动数据库生成kwr报告

--手动生成快照
SELECT * FROM perf.create_snapshot();
--查询快照
SELECT * FROM perf.kwr_snapshots;
--生成报告
SELECT * FROM perf.kwr_report_to_file(1,2,'html','/tmp/kwr.html');

  

 

posted @ 2023-03-29 15:57  刚好遇见Mysql  阅读(160)  评论(0编辑  收藏  举报