6 Basic Commands to Interact with VCSA 6.5 Embedded VPostgres Database

vSphere 6.5, the latest version of its industry-leading virtualization platform.  This new release of vSphere features a dramatically simplified experience, comprehensive built-in security, and a universal app platform for running any app. vSphere 6.5 makes the vCenter Server Appliance the fundamental building block of a vSphere environment. The core vSphere architecture is built around this easy to deploy and manage approach that reduces operational complexity by embedding key functionality into a single location. Since  most the new features such as vCenter 6.5 Native HA ,etc are only available with vCenter Server appliance. It is important to learn to manage and troubleshoot the VCSA 6.5 and VCSA 6.5 Embedded VPostgres Database. In this article, I am going to explain the basic commands to interact with VCSA 6.5 Embedded VPostgres Database in the simplified way.

5 Basic commands to interact with VCSA 6.5 Embedded VPostgres Database

1.Read VCSA 6.5 Embedded Database Configuration Information

Connect to the SSH of VCSA 6.5 and Execute the below command to read the VCSA 6.5 embedded database configuration information.

less embedded_db.cfg

VCSA 6.5 Embedded VPostgres Database

It displays the embedded database configuration information such as DB Type, DB Server name. DB port, DB instance name , DB user name and also PG User Password in Quotes. This information are needed when you need to manage and troubleshoot the VCSA 6.5 Embedded VPostgres Database from outside the server.

VCSA 6.5 Embedded VPostgres Database_2

2. Connect to the VCDB from the vCenter Server Appliance 6.5 BASH Shell

Execute the below command to connect to VCSA 6.5 Embedded VPostgres Database (VCDB) from the SSH of VCSA appliance

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

It also displays the PSQL version and build information details. Once you have connected to the Postgres database. You will get the propmt of “VCDB=#”

VCSA 6.5 Embedded VPostgres Database_3

3. List all databases instance information

Execute the below command in “VCDB=#” prompt  to list all the database instances running on the VCSA 6.5 Embedded VPostgres Database.

\l+

It displays the instance name along with owner information, access privileges ,size and tablespace,etc.

VCSA 6.5 Embedded VPostgres Database_4

4. List all the tables of VCDB embedded database

Execute the below command in  “VCDB=#” prompt  to list all the database tables running on the VCSA 6.5 Embedded VPostgres Database along with its size information.

\d+

VCSA 6.5 Embedded VPostgres Database_5

5. List all the functions of VCDB embedded database

Execute the below command in  “VCDB=#” prompt to list all the functions running on the VCSA 6.5 Embedded VPostgres Database.

\df

VCSA 6.5 Embedded VPostgres Database_6

You can also run the Run SQL Statements using Standard SQL syntax.

SELECT * FROM VPX_VERSION; 
SELECT * FROM VPX_HOST;

VCSA 6.5 Embedded VPostgres Database_7

6. Exit from PSQL command prompt

Execute the below command to quit psql command prompt and return to VCSA 6.5 bash shell

\q

VCSA 6.5 Embedded VPostgres Database_8

I hope this post is informative for you to interact with the VCSA 6.5 Embedded VPostgres Database using this basic commands. We will discuss about detailed procedure on advanced tasks with VCSA 6.5 Embedded VPostgres Database in the upcoming posts. Thanks for Reading!!! Be social and share it in social media, if you feel worth sharing it.