Free up space on your database
Last updated
Was this helpful?
Last updated
Was this helpful?
This procedure frees up disk space in a gradual process, which can take several days or weeks. Once all the steps have been completed, it will be necessary to temporarily increase the disk space in order to rebuild the database, thus recovering space and then reducing the disk size again.
Percona
You can also use Percona to perform this type of operation on your databases. A is available to help
Access the menu Setup
> General
> History Purge
to set up the purging of the two main space-consuming sections: Software and Users.
Steps :
Initial setup
In the Software section, set all three fields to 60 months.
In the Users section, set the four fields to 60 months for an initial test.
From Setup
> Automatic actions
, configure purgelogs
to run daily outside business hours.
Example schedule:
Automatic actions
Let the automatic action run overnight.
Then check the Logs tab in the automatic action to verify the number of lines deleted.
Leave the automatic action running overnight.
Then check the Logs tab in the automatic action to see how many lines have been deleted.
Once the number of deleted lines reaches 0 or close to 0, gradually reduce the retention period (previously set to 60 months) to 55 months.
Repeat the cleaning steps until you reach the desired minimum history duration.
Once the cleanup is complete, it will be necessary to temporarily increase disk space (to almost double the current size) to perform the following operation.
After deleting a large volume of data (e.g. from the glpi_logs table), you may notice that the disk space used does not immediately decrease at file system level. This is normal due to the operation of the InnoDB storage engine.
Procedure: Run the following command to optimize the table and reclaim disk space:
ALTER TABLE <table_name> ENGINE=InnoDB;
This command rebuilds the table indexes while ensuring data security and freeing up unused space.
See the different related to logsInitial run