如何查看服务器资源配置

root@sys 登陆查询

SELECT
  /* MONITOR_AGENT */
  svr_ip,
  svr_port,
  cpu_capacity_max AS cpu_total,
  cpu_assigned_max AS cpu_assigned,
  round(mem_capacity / 1024 / 1024 / 1024) mem_total_gb,
  round(mem_assigned / 1024 / 1024 / 1024) mem_assigned_gb,
  round((cpu_assigned_max / cpu_capacity_max), 2) AS cpu_assigned_percent,
  round((mem_assigned / mem_capacity), 2) AS mem_assigned_percent,
  round(data_disk_capacity / 1024 / 1024 / 1024) data_disk_capacity_gb,
  round(data_disk_in_use / 1024 / 1024 / 1024) data_disk_in_use_gb,
  round(
    (data_disk_capacity - data_disk_in_use) / 1024 / 1024 / 1024
  ) data_disk_free_gb,
  round(log_disk_capacity / 1024 / 1024 / 1024) log_disk_capacity_gb,
  round(log_disk_assigned / 1024 / 1024 / 1024) log_disk_assigned_gb,
  round(log_disk_in_use / 1024 / 1024 / 1024) log_disk_in_use_gb
FROM
  gv$ob_servers
ORDER BY
  svr_ip,
  svr_port;
3 个赞

其实可以借助obdiag 工具来查, 这样就不用记那么多SQL了。

集群基本信息收集
obdiag gather scene run --scene=observer.base
–config db_host=xx.xx.xx.xx
–config db_port=xxxx
–config tenant_sys.user=root@sys
–config tenant_sys.password=***

PS: obdiag 在国庆节后会发布2.5.0版本,由多位社区爱好者共同参与共建的obdiag display xxxx功能会上线,到时候各位DBA们收集整理的各种有用的SQL就能发挥作用了,敬请期待

2 个赞

:+1: :+1: obdiag 好使,有没有什么图形化的界面

1 个赞

这个可以