So, I modified my script toYou can NOT use in answer of EP (to see - yes, to use - no). To see an answer of EP use in `echo`, Vertica will print it.
Code: Select all
#!/bin/bash
value=`vsql -c "select CEIL(sum(used_bytes)/1024/1024) as total_size_in_MB from v_monitor.storage_containers;"`
echo $value
exit 0
Code: Select all
[dbadmin@node1 ~]$ sh total_size.sh
total_size_in_MB ------------------ 284 (1 row)
[dbadmin@node1 ~]$
Created the procedure and tried running it.
Code: Select all
dbadmin=> select total_size();
INFO 4427: Procedure reported:
total_size
------------
0
(1 row)
dbadmin=>