How to reclaim unused space from InnoDB reporting.event table?
search cancel

How to reclaim unused space from InnoDB reporting.event table?


Article ID: 17210


Updated On:


CA Spectrum


The CA Spectrum Report Manager was configured to retain 45 days of historical data from the partitioned event table, but the MySQL InnoDB is not releasing disk space after deleting data rows from the table.

How to reclaim unused space on InnoDB partitioned reporting.event table?


Release: Any
Component: Spectrum Report Manager


Out Of the Box (OOB) CA Spectrum Report Manager (SRM) will not shrink the reporting database.

Running ALTER TABLE tbl_name ENGINE=INNODB on an existing InnoDB table performs a “null” ALTER TABLE operation, which can be used to defragment an InnoDB table. 

1 - Log into the SRM system as the user that owns the Spectrum installation

2 - If on Windows, start a bash shell by running "bash -login"

3 - cd to the $SPECROOT/mysql/bin directory and enter the following command to log into mysql:

./mysql --defaults-file=../my-spectrum.cnf -uroot -p<PASSWD> reporting

4 - Run the following command at the mysql prompt:


In the following image you can see the files before and after defragmentation:


Additional Information

You can also run this MySQL syntax from a script to run it in a weekly basis:

cd $SPECROOT/mysql/bin

./mysql --defaults-file=../my-spectrum.cnf -uroot -p<PASSWD> reporting -e "ALTER TABLE event ENGINE=InnoDB;"