Nnmi Postgres Database size (266 Views)
Reply
Frequent Advisor
Posts: 99
Registered: ‎11-10-2011
Message 1 of 2 (266 Views)

Nnmi Postgres Database size

Hi Experts,

 

NNMi 9.2 patch 4

 

Linux in HA

 

How to check the NNMi Postgres Database size.

 

Available space and used space

 

Please suggest

HP Expert
Posts: 639
Registered: ‎09-27-2000
Message 2 of 2 (226 Views)

Re: Nnmi Postgres Database size

Abhishek,

 

  You can use various psql commands to determine the size of the DB and the tables.  The internet has a lot of good information on Postgres.   However for your question you have

 

For the size on disk ( apart from using OS commands ):

 

psql -U postgres
postgres=#select pg_size_pretty(pg_database_size('nnm')) ;

 

Or the internal size of data within the DB

 

psql -d nnm -U postgres postgres=#select SUM(relpages * 8192) AS size_in_bytes FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname='public') ;

 

  if you need to know how to access the DB then please refer to the KCS document:

 

http://support.openview.hp.com/selfsolve/document/KM00591311

 

  All the best

 

Dave Y

HP Support

The views expressed in my contributions are my own and do not necessarily reflect the views and strategy of HP

If you find this or any post resolves your issue, please be sure to mark it as an accepted solution.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.