Last active
October 7, 2023 14:18
-
-
Save hiimivantang/5b28df30b40c17e75315b81577595af8 to your computer and use it in GitHub Desktop.
Oceanbase useful queries for DBA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#View cluster resources utilization at cluster level | |
select mem_total/1024/1024, (mem_assigned)/1024/1024, cpu_total,cpu_assigned from __All_virtual_server_stat; | |
#View cluster resources utilization at node level | |
select | |
zone, | |
concat (svr_ip, | |
':', | |
svr_port) cpu_capacity, | |
cpu_total, | |
cpu_assigned, | |
cpu_assigned_percent, | |
mem_capacity, | |
mem_total, | |
mem_assigned, | |
mem_assigned_percent, | |
unit_Num, | |
round ('load', | |
2) 'load', | |
round ('cpu_weight', | |
2) 'cpu_weight', | |
round ('memory_weight', | |
2) 'mem_weight', | |
leader_count | |
from | |
__all_virtual_server_stat | |
order by | |
zone, | |
svr_ip; | |
# List resource units | |
select unit_config_id,name,max_memory/1024/1024/1024,max_cpu from __all_unit_config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment