Vertica的这些事(八)——-Vertica-管理

1、版本信息

1
2
3
4
5
dbadmin=> SELECT version();
version
------------------------------------

Vertica Analytic Database v7.2.3-7
(1 row)

2、license信息

1
2
3
4
5
6
7
8
9
10
dbadmin=> SELECT DISPLAY_LICENSE();
DISPLAY_LICENSE
-------------------------------------------
HPE Vertica
2/16/2016
Perpetual
3
2 TB

(1 row)

3、各节点硬盘使用情况

1
2
3
4
5
6
SELECT /*+label(diag_disk_space_utilization)*/ 
host_name,
( disk_space_free_mb / 1024 ) AS disk_space_free_gb,
( disk_space_used_mb / 1024 ) AS disk_space_used_gb,
( disk_space_total_mb / 1024 ) AS disk_space_total_gb
FROM v_monitor.host_resources;

4、各节点内存使用情况

1
2
3
4
5
6
7
SELECT /*+label(diag_memory_info)*/ 
host_name,
total_memory_bytes / ( 1024^3 ) AS total_memory_gb,
total_memory_free_bytes / ( 1024^3 ) AS total_memory_free_gb,
total_swap_memory_bytes / ( 1024^3 ) AS total_swap_memory_gb,
total_swap_memory_free_bytes / ( 1024^3 ) AS total_swap_memory_free_gb
FROM v_monitor.host_resources;

5、每个scheme 数据使用情况

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
SELECT /*+label(diag_schema_space_utilization)*/ 
pj.anchor_table_schema,
pj.used_compressed_gb,
pj.used_compressed_gb * la.ratio AS raw_estimate_gb
FROM (SELECT ps.anchor_table_schema,
SUM(used_bytes) / ( 1024^3 ) AS used_compressed_gb
FROM v_catalog.projections p
JOIN v_monitor.projection_storage ps
ON ps.projection_id = p.projection_id
WHERE p.is_super_projection = 't'
GROUP BY ps.anchor_table_schema) pj
CROSS JOIN (SELECT (SELECT database_size_bytes
FROM v_catalog.license_audits
ORDER BY audit_start_timestamp DESC
LIMIT 1) / (SELECT SUM(used_bytes)
FROM v_monitor.projection_storage) AS ratio) la
ORDER BY pj.used_compressed_gb DESC;