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

Document ID : KB000017210
Last Modified Date : 11/04/2019
Show Technical Document Details

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?


Out Of the Box (OOB) CA Spectrum Report Manager 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) Open a bash shell (bash -login) 


2) Go to $SPECROOT/mysql/bin directory 


3) Run: 

./mysql --defaults-file=../my-spectrum.cnf -uroot -proot reporting (Linux/Solaris) 


./mysql -uroot -proot reporting (Windows) 


4) Run: 



 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 -proot reporting -e"ALTER TABLE event ENGINE=InnoDB;"