If postgres replication is broken you may as well reset it up as opposed to trying to manually move the logs. Here’s how to do it
Author: yvonneknowsdatabases
postgres on vcops
to login
su – postgres /opt/vmware/vpostgres/current/bin/psql -d vcopsdb -p 5433
Backup and restore VCDB on windows
To backup the postgres database manually on windows
Troubleshooting SQL Server Performance
If your concerned your SQL server database is the cause of a performance issue then these commands might help
Troubleshooting Postgres Performance
IF you think postgres performance is the cause of an application performing badly these sql statements may help
Kill sessions
Vcloud kill idle sessions
Autovacuum Blocking Vacuum
This mainly shows how to kill sessions and look at locking in postgres
vpostgres on windows
This runs as a service account
NT SERVICE\vPostgres
You can start it using
C:\Program Files\VMware\vCenter Server\bin>service-control –start vPostgres
C:\Program Files\VMware\vCenter Server\bin>service-control –stop vPostgres
You cannot start it using pg_ctl as administrator
If there are errors starting you can see the postgresql*.logs
normally in C:\ProgramData\VMware\vCenterServer\logs\vpostgres
If nothing here check the windows events log
Go check the Application log: right
click on Computer -> Manage -> Events -> Application
You can increase logging editing the postgresql.conf file
normally found in C:\ProgramData\VMware\vCenterServer\data\vpostgres
track_activities = on
track_activity_query_size = 6000
log_statement_stats = on
log_statement = ‘all’
In a case I had the reverse proxy server had to be restarted to allow the vpostgres service to start.
If you need to work around unknown passwords you can lower security so a password isn’t required
Search for the C:\ProgramData\VMware\vCenterServer\data\vpostgres\pg_hba.conf
change md5 to trust
To run pg_ctl you’#ll have to be postgres user. Run command prompt at postgres user
C:\Program Files\VMware\vCenter Server\vPostgres\bin>psql.exe -U vc -d VCDB
psql (9.4.9 (VMware Postgres 9.4.9.1-4536683 release))
why are my vc events getting so full
select count(*) from vpx_Event;
select count(*) from vpx_Event_arg;
select event_type, count(event_type) from vpx_Event group by event_type order by count(event_type);
autovacuum blocking vacuum
SET vacuum_cost_delay = 0
pg_terminate_backend()
ALTER TABLE hd_property_instance SET (autovacuum_enabled = false,
toast.autovacuum_enabled = false);