OceanBase 查询 SQL 流量分布情况及 QPS

2021-06-30 11:45 更新

运行如下语句可以查询 SQL 流量分布情况及 QPS:

obclient>SELECT/*+ PARALLEL(15)*/t2.zone, t1.svr_ip,  COUNT(*) AS RPC_COUNT,
      AVG(t1.elapsed_time), AVG(t1.queue_time)  
      FROM oceanbase.gv$sql_audit t1, __all_server t2  
      WHERE t1.svr_ip = t2.svr_ip 
      AND tenant_id = 1001
      AND SQL_ID = 'BF7AA13A28DF50BA5C33FF19F1DBD8A9'
      AND IS_EXECUTOR_RPC = 0    
      AND request_time > (time_to_usec(now()) - 1000000)    
      AND request_time < time_to_usec(now())
      GROUP BY t1.svr_ip;


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号