运行如下语句可以查询某段时间内执行时间排名 TOP N 的请求:
obclient>SELECT sql_id, elapsed_time , trace_id
FROM oceanbase.gv$sql_audit
WHERE tenant_id = 1001
and IS_EXECUTOR_RPC = 0
and request_time > (time_to_usec(now()) - 10000000)
AND request_time < time_to_usec(now())
ORDER BY elapsed_time DESC LIMIT 10;
+----------------------------------+--------------+-------------------------------+
| sql_id | elapsed_time | trace_id |
+----------------------------------+--------------+-------------------------------+
| CFA269275E3BB270408747C01F64D837 | 87381 | YB420AB75598-0005634FBED5C5E8 |
| 1979A5B4A27D5C3DBE08F80383FD6EB6 | 83465 | YB420AB74E56-0005634B4B87353B |
| 51248E6C3BB5EF1FC4E8E79CA685723E | 82767 | YB420AB74E56-0005634B4B82E7E1 |
| 249C40E669DFCCE80E3D11446272FA11 | 79919 | YB420A67E27C-00056349549A79D3 |
| BEFAD568C3858D2C2E35F01558CBEC06 | 77210 | YB420A67E4B1-00056345B0F2E97E |
| FB1A6A8BC4125C324A38F91B3808D364 | 75870 | YB420AB74E71-00056347074261E6 |
| 0343A519C0C5BF31C68CB68F63721990 | 75666 | YB420BB47107-00056346A5A631FB |
| B140BB0C671D9B8616FB048544F3B85B | 73902 | YB420A67E56B-00056342A5A4683E |
| 4F9B1D0A3822A3E0DF69DB11ABFBE0EA | 72963 | YB420BB47107-00056346A5AAC5F5 |
| 9963E8D252E6CBA72FBA45AC5790BA11 | 72354 | YB420A67E56B-00056342A5A66089 |
+----------------------------------+--------------+-------------------------------+
在MySQL模式下,一般用户会通过原生的mysqldump进行数据备份。但因为OceanBase MySQL模式暂不支持trigger,会导致以下报错。解决...
OceanBase 开发者中心(OceanBase Developer Center,ODC)SQL 窗口中的语句是同步执行的,当语句运行时间过长时可能会出现执行...
在 OceanBase 开发者中心(OceanBase Developer Center,ODC)单击连接名进入连接后,在左导航栏中单击函数标签可以查看函数列表...
CONCAT声明CONCAT(str1, .., strN)说明把多个字符串连接成一个字符串。参数中包含NULL时,返回NULL。例子obclient SELECT...