关注公众号数据社,获取大数据、数据分析资料

数据社

专注大数据、数据分析、MPP数据库技术分析

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

1、版本信息

dbadmin=> SELECT version();
              version               
------------------------------------
 Vertica Analytic Database v7.2.3-7
(1 row)

2、license信息

dbadmin=> SELECT DISPLAY_LICENSE();
              DISPLAY_LICENSE              
-------------------------------------------
 HPE Vertica
2/16/2016
Perpetual
3
2 TB

(1 row)

3、各节点硬盘使用情况

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、各节点内存使用情况

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 数据使用情况

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; 
posted @ 2020-04-08 13:29  WindyQin  阅读(384)  评论(0编辑  收藏  举报