top of page

Crazy about diabetes Group

Public·9 members

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 datadir. For example, if you want to store your recovery log file in /mnt/backup, you need to create a symlink like this:



ln -s /mnt/backup/tokudb.rollback datadir/tokudb.rollback


This will create a symlink in datadir that points to the recovery log file in /mnt/backup. When TokuDB and PerconaFT write to the recovery log file, they will use the /mnt/backup location instead of the datadir.


Conclusion




In this article, we have introduced you to the new database file management feature for TokuDB and PerconaFT in Percona Server 5.6.33-79.0 and Percona Server 5.7.15-9. 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.


We have also shown you how to use this feature by enabling or disabling the tokudb_dir_per_db option, renaming tables and indexes in SQL and on disk, grouping data files by database within subdirectories, and moving data files, temporary files, and recovery log files to different locations using symlinks.


We hope that you have found this article useful and informative. If you want to learn more about Percona Server, TokuDB, PerconaFT, or the new database file management feature, you can check out the following resources:



  • Percona Server Documentation



  • TokuDB Documentation



  • PerconaFT Documentation



  • Percona Server Blog Post on Database File Management Feature



FAQs




What are the prerequisites for using the new database file management feature?




To use the new database file management feature, you need to have Percona Server 5.6.33-79.0 or Percona Server 5.7.15-9 installed on your system. You also need to have TokuDB or PerconaFT storage engines enabled for your databases.


How can I check the current location of my TokuDB and PerconaFT data files?




You can check the current location of your TokuDB and PerconaFT data files by using the SHOW VARIABLES command in MySQL. For example, you can run the following command to see where your data files are stored:


SHOW VARIABLES LIKE 'tokudb_data_dir';


This will show you the value of the tokudb_data_dir variable, which is the directory where your data files are stored. By default, this is the same as the MySQL datadir.


How can I monitor the disk space usage of my TokuDB and PerconaFT data files?




You can monitor the disk space usage of your TokuDB and PerconaFT data files by using the du command in Linux. For example, you can run the following command to see how much disk space is used by your data files:


du -sh datadir/*


This will show you the size of each file or directory in your datadir. You can also use other options of du command to filter or sort the output according to your needs.


What are the advantages of using symlinks for TokuDB and PerconaFT data files?




Using symlinks for TokuDB and PerconaFT data files can have several advantages, such as:



  • You can optimize your disk space usage by storing your data files on different disks with different capacities and performance characteristics.



  • You can improve your database performance by storing your data files on faster disks or RAM disks.



  • You can enhance your database security by storing your data files on encrypted disks or remote devices.



  • You can simplify your database backup and restore processes by storing your data files on separate backup devices or cloud services



How can I troubleshoot any issues with the new database file management feature?




If you encounter any issues with the new database file management feature, you can try the following steps to troubleshoot them:



  • Check the MySQL error log for any errors or warnings related to TokuDB or PerconaFT.



  • Check the permissions and ownership of your data files, temporary files, and recovery log files on disk.



  • Check the integrity and consistency of your data files using the CHECK TABLE command in MySQL.



  • Check the status and statistics of your TokuDB and PerconaFT storage engines using the SHOW ENGINE TOKUDB STATUS and SHOW ENGINE PERCONAFT STATUS commands in MySQL.



  • Contact Percona Support for further assistance.



dcd2dc6462


  • About

    Welcome to the group! You can connect with other members, ge...

    bottom of page