top of page

Crazy about diabetes Group

Public·15 members
Levi Long
Levi Long

TokuDB and PerconaFT Data Files: How to Rename, Group, and Move Them with Percona Server



New TokuDB and PerconaFT database file management feature in Percona Server 5.6.33-79.0 and Percona




If you are looking for a free, fully-compatible, enhanced, open source drop-in replacement for MySQL, you might want to consider Percona Server. Percona Server is a powerful database solution that provides superior performance, scalability, and instrumentation. It also offers a range of open source tools for data backup, availability, and management.




New TokuDB and PerconaFT database file management feature in Percona Server 5.6.33-79.0 and Percona



One of the features that makes Percona Server stand out is its support for TokuDB and PerconaFT storage engines. These storage engines are designed to handle large volumes of data with high compression ratios, fast insertion rates, and low maintenance overhead. They also use fractal tree indexes, which are more efficient than B-tree indexes for most workloads.


In this article, we will introduce you to a new feature that was added in Percona Server 5.6.33-79.0 and Percona Server 5.7.15-9: the database file management feature for TokuDB and PerconaFT. This feature allows you to easily rename, group, and move your data files on disk, without compromising the integrity or performance of your database. This can help you improve the manageability, organization, and security of your data files.


How to use the new database file management feature




The new database file management feature is controlled by a server option called tokudb_dir_per_db. This option determines how TokuDB and PerconaFT store their data files on disk. By default, this option is disabled in Percona Server 5.6.33-79.0, but enabled in Percona Server 5.7.15-9.


How to enable tokudb_dir_per_db option and what it does




To enable or disable tokudb_dir_per_db option, you need to edit your my.cnf configuration file and add or remove the following line:


tokudb_dir_per_db=ON


You can also change this option dynamically by running the following command in MySQL:


SET GLOBAL tokudb_dir_per_db=ON;


When tokudb_dir_per_db option is enabled, it does two things:



  • It renames the data files on disk when you rename a table or an index in SQL.



  • It groups the data files together within a directory that represents a single database.



How to rename tables and indexes and how the files are renamed on disk




When you rename a table or an index in SQL, you usually use commands like:


RENAME TABLE old_table TO new_table;


ALTER TABLE table_name RENAME INDEX old_index TO new_index;


However, when tokudb_dir_per_db option is disabled, these commands only change the names in SQL, but not on disk. The data , if you want to store your temporary files in /tmp, you need to create a symlink like this:



ln -s /tmp datadir/_tmp_tokudb


This will create a symlink in datadir that points to the /tmp directory. When TokuDB and PerconaFT create temporary files, they will use the /tmp directory instead of the datadir.


To change the location of recovery log files, you need to create a symlink for the file called tokudb.rollback in the