Comments - MariaDb vs Oracle
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
I think MariaDB is inappropriate for moving ordinary files.
Why can't you simply use the filesystem? Like the Linux/UNIX "mv" command? (Or equivalent Windows command?)
The mysql client program includes the SYSTEM command, which you can use to execute file system commands. So in a .sql script file, you could have "SYSTEM mv oldname newname;"
I need to move the file usinga MariaDb routine or procedure : I have to read a text file and split it into many files (each file will be processed by a specific routine) ,Once I finish spliting it, I have to copy the text file in another directory and delete the existing one. How can I accomplish this ?
As far as I know, there are no general-purpose file-manipulation commands in MariaDB/MySQL. Which is good, from a security point-of-view.
You'll have to write a user-defined function. Which is bad, from a security point-of-view: http://dev.mysql.com/doc/refman/5.7/en/adding-functions.html
There are (scary) UDFs available that will let you fire off a shell script. But they will run with the permission of the user running mysqld, and could be invoked by any SQL user. This means (for example) that someone with only SELECT permission could run a script that does "rm -rf /usr/local/var/mysql/*"
Here is enough rope to hang yourself: https://patternbuffer.wordpress.com/2012/09/14/triggering-shell-script-from-mysql/
You might consider a totally different approach: using a shell script that does the file manipulation you require while running mysql with the data manipulation you require.
You cannot run file manipulation from MySQL, but you <i>can</i> run MySQL from a file manipulation program. That seems the path of least resistance, rather than trying to use a hammer to drive screws.
Thanks a lot for your feedbacks.Another questions please:
-Oracle has the tablespace feature ,does MariaDb has the same feature ? -If yes how MariaDb encrypt a given tablespace ?