Moving data from shared tablespace to file-per-table tablespace in MySQL and MariaDB DBMSs

For MySQL and MariaDB DBMSs, you can store data in the following ways:

Using a shared tablespace increases the risk of tablespace fragmentation. Since it is not possible to perform a SHRINK operation, a file in a shared tablespace may take up about 90% of the disk space. This negatively affects the disk subsystem performance. Thus, it is useful to opt for a file-per-table tablespace.

This article describes how to move data from a shared tablespace to a file-per-table tablespace. If MySQL or MariaDB DBMSs are also used by other applications, you have to move the databases of these applications to file-per-table tablespace.

We recommend that you perform the procedure only if you are using MySQL or MariaDB DBMSs for Administration Server.
Moving data from shared tablespace to file-per-table tablespace may increase the load on the disk subsystem.

Prerequisites

Before you start, make sure that:

The required disk space is 150% of the current total databases size (current size of the ibdata1 file).

Process

To move data from a shared tablespace to a file-per-table tablespace:

  1. Stop the Kaspersky Security Center Administration Server service and other applications using the instance of DBMS for which you want to perform this procedure.
  2. Log in to your DBMS as a superuser, and then, in any convenient application run the fix_tablespace.sql script.

    You can view the fix_tablespace.sql script by clicking this link:

    View the script

    You must not stop the script execution.
    If no DBMS errors occurred, but you terminated the script execution, either run the script again, or stop performing the steps of this procedure, restart the DBMS service, and restore the Administration Server data from the backup.

  3. In the [mysqld] section of the my.cnf file, set the innodb_file_per_table parameter to 1.
  4. Restart the MySQL or MariaDB service.
  5. Start the Kaspersky Security Center Administration Server service.

The data is moved from a shared tablespace to a file-per-table tablespace.

Page top