Our APM DB size is growing quickly and is affecting the performance of the environment so we are looking for a way to optimize the APM database.
How can we optimize the database when the database size is growing very quickly?
10.8
To remedy this, one should take a look on size of tables to decide if cleanup procedure will be needed.
Cleanup decision:
select external_id, history from (
select vertex_id, count(1) as history from appmap_vertices
where start_time > (CURRENT_DATE - INTERVAL '5 day')
group by vertex_id
order by 2 desc
limit 20) t
join appmap_id_mappings m on t.vertex_id=m.vertex_id;
Oracle:
select external_id, history from (
select vertex_id, count(1) as history from appmap_vertices
where start_time > (sysdate - 5)
group by vertex_id
order by 2 desc) t
join appmap_id_mappings m on t.vertex_id=m.vertex_id
where rownum < 20;
Optimize tables in Oracle:
alter table appmap_edges enable row movement;
alter table appmap_vertices enable row movement;
alter table appmap_attribs enable row movement;
alter table appmap_edges shrink space compact;
alter table appmap_vertices shrink space compact;
alter table appmap_attribs shrink space compact;
There is no need to stop the Enterprise Manager, it will just slow down a little bit the database.