Symptoms:
vpxd service fails to start. /var/log/vmware/vpostgres/postgresql.log, you see messages similar to:[YYYY-MM-DDTHH:MM:SS] 689cf970.452c 0 VCDB vc [local] 17708 3 ERROR: could not open file "pg_tblspc/16394/PG_13_########/#####/########": No such file or directory[YYYY-MM-DDTHH:MM:SS] 689cf970.452c 0 VCDB vc [local] 17708 4 STATEMENT: BEGIN;declare "SQL_CUR0x7f45d400bac0" cursor with hold for SELECT EVENT_ID, CHAIN_ID, EVENT_TYPE, EXTENDED_CLASS, CREATE_TIME, USERNAME, CATEGORY, VM_ID, VM_NAME, HOST_ID, HOST_NAME, COMPUTERESOURCE_ID, COMPUTERESOURCE_TYPE, COMPUTERESOURCE_NAME, DATACENTER_ID, DATACENTER_NAME, DATASTORE_ID, DATASTORE_NAME, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, DVS_ID, DVS_NAME, STORAGEPOD_ID, STORAGEPOD_NAME, CHANGE_TAG_ID FROM VPXV_EVENT_ALL WHERE (EVENT_ID IN (########,########,########,########,########,########,########,########)) LIMIT 8; ;fetch 1024 in "SQL_CUR0x7f45d400bac0"Such corruption often arises from abrupt storage interruptions or improper shutdowns, leading to inconsistencies and, in some cases, the database integrity as well.
Follow the below steps to fix the corruption issue:
service-control --stop --all
service-control --start vmware-vpostgresRun commands below (Generally, VACUUM FULL fixes mild corruptions).
/opt/vmware/vpostgres/current/bin/vacuumdb -U postgres -d VCDB --full -–analyze
/opt/vmware/vpostgres/current/bin/reindexdb -U postgres -d VCDB
vacuum full;
/opt/vmware/vpostgres/current/bin/pg_amcheck --username=postgres --all --verbose ( Only available for vCenter version 8.x).