Exploitation

Table Migration

The command line does the following procedure:

  • Rename existing table (‘xxx’ will be ‘xxx_old’)
  • Create an empty partitioned table
  • Migrate data in partitioned table (with ‘SELECT INSERT’ statement)

So be cautious !!! You need to do some verifications before:

  • Enough space on MySQL Server (at least twice the size of the table. Indexes and Datas)
  • No data in futures (time is used for the partitioning)
  • Enough memory on database server

Moreover, the ‘SELECT INSERT’ statement will lock the table and maybe your production in some points (per example table migration of ‘logs’).

Table migration is done by using the option ‘-m’:

# php /usr/share/centreon-partitioning/bin/centreon-partitioning.php -m /etc/centreon/centreon-partitioning/partitioning-data_bin.xml

If the table migration is ok, the old table can be deleted.

Table Update

After the table partitioned is done, current updates are needed. A cron script has to be executed every days:

0 4 * * * root php /usr/share/centreon-partitioning/bin/centreon-partitioning.php -u /etc/centreon/centreon-partitioning/partitioning-data_bin.xml >> /var/log/centreon/centreon-purge.log 2>&1