南大通用GBase 8a集群查看当前运行状态,内存使用情况

GBase 8a数据库集群运行时的很多状态,可以通过元数据表 GLOBAL_STATUS,SESSION_STATUS进行读取,也可以用show命令简单。注意集群分管理节点和数据节点,需要各自查看,且每个机器也各自不同。该功能主要用于运维和监控。

元数据表

gbase> select * from information_schema.GLOBAL_STATUS where variable_name like 'meminfo%';
+----------------------------------+----------------+---------------+-----------+
| VARIABLE_NAME                    | VARIABLE_VALUE | SESSION_LEVEL | WRITEABLE |
+----------------------------------+----------------+---------------+-----------+
| MEMINFO_CACHE_ACCESS_TIMES       | 0              |             1 |         1 |
| MEMINFO_CACHE_HIT_RATE_%         | 0.000000       |             1 |         1 |
| MEMINFO_CACHE_HIT_TIMES          | 0              |             1 |         1 |
| MEMINFO_CACHE_MISS_TIMES         | 0              |             1 |         1 |
| MEMINFO_CACHE_REMOVED_LIST_SIZE  | 0              |             1 |         1 |
| MEMINFO_DC_HEAP_AVAILBLE_SIZE    | 536870912      |             1 |         1 |
| MEMINFO_DC_HEAP_MALLOC_SIZE      | 0              |             1 |         1 |
| MEMINFO_DC_HEAP_TOTAL_SIZE       | 536870912      |             1 |         1 |
| MEMINFO_DC_HEAP_USED_SIZE        | 0              |             1 |         1 |
| MEMINFO_LARGE_HEAP_AVAILBLE_SIZE | 268435456      |             1 |         1 |
| MEMINFO_LARGE_HEAP_MALLOC_SIZE   | 0              |             1 |         1 |
| MEMINFO_LARGE_HEAP_TOTAL_SIZE    | 268435456      |             1 |         1 |
| MEMINFO_LARGE_HEAP_USED_SIZE     | 0              |             1 |         1 |
| MEMINFO_TEMP_HEAP_AVAILBLE_SIZE  | 268433472      |             1 |         1 |
| MEMINFO_TEMP_HEAP_MALLOC_SIZE    | 0              |             1 |         1 |
| MEMINFO_TEMP_HEAP_TOTAL_SIZE     | 268435456      |             1 |         1 |
| MEMINFO_TEMP_HEAP_USED_SIZE      | 1984           |             1 |         1 |
+----------------------------------+----------------+---------------+-----------+
17 rows in set (Elapsed: 00:00:00.01)

gbase> select * from information_schema.SESSION_STATUS where variable_name like 'meminfo%';
+----------------------------------+----------------+---------------+-----------+
| VARIABLE_NAME                    | VARIABLE_VALUE | SESSION_LEVEL | WRITEABLE |
+----------------------------------+----------------+---------------+-----------+
| MEMINFO_CACHE_ACCESS_TIMES       | 0              |             1 |         1 |
| MEMINFO_CACHE_HIT_RATE_%         | 0.000000       |             1 |         1 |
| MEMINFO_CACHE_HIT_TIMES          | 0              |             1 |         1 |
| MEMINFO_CACHE_MISS_TIMES         | 0              |             1 |         1 |
| MEMINFO_CACHE_REMOVED_LIST_SIZE  | 0              |             1 |         1 |
| MEMINFO_DC_HEAP_AVAILBLE_SIZE    | 536870912      |             1 |         1 |
| MEMINFO_DC_HEAP_MALLOC_SIZE      | 0              |             1 |         1 |
| MEMINFO_DC_HEAP_TOTAL_SIZE       | 536870912      |             1 |         1 |
| MEMINFO_DC_HEAP_USED_SIZE        | 0              |             1 |         1 |
| MEMINFO_LARGE_HEAP_AVAILBLE_SIZE | 268435456      |             1 |         1 |
| MEMINFO_LARGE_HEAP_MALLOC_SIZE   | 0              |             1 |         1 |
| MEMINFO_LARGE_HEAP_TOTAL_SIZE    | 268435456      |             1 |         1 |
| MEMINFO_LARGE_HEAP_USED_SIZE     | 0              |             1 |         1 |
| MEMINFO_TEMP_HEAP_AVAILBLE_SIZE  | 268433472      |             1 |         1 |
| MEMINFO_TEMP_HEAP_MALLOC_SIZE    | 0              |             1 |         1 |
| MEMINFO_TEMP_HEAP_TOTAL_SIZE     | 268435456      |             1 |         1 |
| MEMINFO_TEMP_HEAP_USED_SIZE      | 1984           |             1 |         1 |
+----------------------------------+----------------+---------------+-----------+
17 rows in set (Elapsed: 00:00:00.00)

show status like '%meminfo%'

like部分就是标准的模糊查询语法

查看全部的,就去掉like部分
show status

其它运维监控命令,请参考

http://www.gbase8.cn/?tag=%e7%9b%91%e6%8e%a7