How to work with vCenter 6.5 internal database

vCenter 6.5 we are using postgress database as internal database for vCenter.All the information related to vCenter are store in this database.

How to access data in this database

1.Login to the vCenter appliance using putty

Just type shell to enable shell commands

2.Using below command we can connect to vpostgress database

/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

clip_image001

3.Using \l+ we can get the details of running databases

clip_image002

4.To get help we need to run \?

clip_image003

4.Using \c command we can get the tables inside the database. For this example im using VCDB database

Command syntax

\c DATABASENAME

EX

\c VCDB

clip_image004

5.To list the tables of database we can use \dt

clip_image005

6.To view schema of the table

\d+ vpx_vm

clip_image006

7.To query only vm names from vpx_vm table

clip_image007

8.Same way we can get more details as we like

clip_image008

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: