Maintenance in the database.

[expired user #12322]'s profile image [expired user #12322] posted 5 years ago in General Permalink

Good afternoon everyone.

This is my first post in this forum.

Doubt: The bank optimization process generates a temporary file, correct !?

My question is the following, is it possible to redirect the destination location where this file will be generated?

I have two partitions on my system, one partition with 4GB free and one with 1.5TB. I would like to direct this temporary file to the 1.5TB partition in order to free up space on my partition with 4GB free.

Thanks for the help.

Regards, Victor Hugo R. Gomes

Translated by: Google Translate.

ansgar's profile image ansgar posted 5 years ago Permalink

You mean the MariaDB server is generating a temporary file?

If so, you will have to configure your my.cnf or my.ini in order to move these files. I guess you cannot just move those temporary files, but you should be able to set a different data-directory.

[expired user #12322]'s profile image [expired user #12322] posted 5 years ago Permalink

Good night.

So let me describe it step by step to see if I can better explain what I need.

1 - When I run the optimize command on a bench "test.ibd" table with 5GB, a file "# 1234.ibd" is generated in the same directory and its size is growing throughout the process.

2 - the optimization process is finished. the file "# 1234.ibd" now has 4.1GB.

3 - the file "# 1234.ibd" disappears and the file "teste.ibd" that previously had 5GB, now has 4.1GB.

What I need is this. The file "# 1234.ibd" that is automatically created at the beginning of the optimization in the same directory as "test.ibd" ... so I need to direct it to another place.

I have little space on the partition where the database is stored, so I need to redirect this file to another location so that the optimization can occur until the end, without ending up with the free space on my partition.

I do not know if I could be clear on the explanation, I hope so.

I still appreciate the help.

ansgar's profile image ansgar posted 5 years ago Permalink

I already understood you in your first post. The answer is still the same: you will need to configure the data directory of the MySQL/MariaDB server to another directory. You cannot just move the place where MariaDB puts its temporary files. Go and find your my.cnf/my.ini at first, open it with some text editor and watch out for a "datadir" line. Change it to your needs, stop the server, move your current data directory and files from there to the new location and then restart the server.

Please login to leave a reply, or register at first.