For MySQL and MariaDB DBMSs, you can store data in the following ways:
ibdata1
file).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:
fix_tablespace.sql
script.You can view the fix_tablespace.sql
script by clicking this link:
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.
[mysqld]
section of the my.cnf file, set the innodb_file_per_table
parameter to 1
.The data is moved from a shared tablespace to a file-per-table tablespace.
Page top