Symptoms:
du -sh /db/elasticsearch
du -sh /db/rabbitmq
du -sh /db/data
/db/data volume taking most of the space. If it is one of the other disk trees, please see other KBs (i.e. audit data).VMware Identity Manager 3.3.x
Prerequisite:
Steps to clean up excessive disk space consumed by the OAuth2RefreshToken table:
service horizon-workspace stop
export PGPASSWORD=`cat /usr/local/horizon/conf/db.pwd`
/opt/vmware/vpostgres/current/bin/psql -U postgres -d saas
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;
truncate table "OAuth2RefreshToken" CASCADE;
select count (*) from "OAuth2RefreshToken";
select count (*) from "OAuth2AccessToken";
select count (*) from "SuiteTokenCache";
vacuum full verbose;
reindex table "OAuth2RefreshToken";
vacuum full verbose;
\q
service vpostgres restart
service horizon-workspace start
OAuth2RefreshToken table:
/opt/vmware/vpostgres/current/bin/psql -U postgres -d saas
select count (*) from "OAuth2RefreshToken";
Additional Workaround:
If on step 4 above, the TRUNCATE query does not produce any output at all after several minutes, you may need to find and forcibly stop a task:
SELECT pid,application_name FROM pg_stat_replication;
application_name = walreceiver results that remain whenever checked. Use this SQL query to forcibly stop a process:
SELECT pg_terminate_backend(<stuck_pid>);