Comments - MariaDb vs Oracle

8 years, 1 month ago Sergei Golubchik
 
8 years ago Dba Btissam

Thanks!

What about :

- Synonyms : is there a similar feature in MariaDb? - What is the database driver used to access database from application?

Regards

 
8 years ago Sergei Golubchik

and don't hesitate to use google before asking here

 
8 years ago Dba Btissam

Thanks a lot!

I made a search in internet but didn't found always the accurate responses . I need also to know:

1- The VARCHAR column type has the max size of 65,535 bytes or this size is shared among all columns (that means that if a column in the same table has size say 1000 bytes the VARCHAR coulum will have a max size of 64535?!)?

2- I saw an article about the equivalent of the Oracle DbLink feature in MariaDb, I found that the connect engine with the ODBC table type can do an insert+select on a remote Oracle table ,but the update is it possible?

3- How can we remove a file from a disk and how to copy it into another directory under MariaDb?

Many Thanks for your help and Best Regards

 
8 years ago Jan Steinman

1) Yes. I think there's also some overhead like two bytes per column, which in your case would mean a VARCHAR would have a max of 64,531.

2) Don't know, but I'd be wary of using CONNECT (which I believe is beta software) to update another vendor's tables. I see CONNECT as a read-only solution at present.

3) I'm not sure what you mean here. If you mean the files containing the data in "datadir", you can move MyISAM files when mysql is not running, but you SHOULD NOT EVER move InnoDB files, because even with "innodb_file_per_table = 1" (the default), there is still necessary metadata in file "ibdata1" that will keep the moved file from working properly. (Voice of experience.)-:

If you mean moving tables between databases, with the exception of MyISAM tables (which can be moved in the filesystem), I think you are best using mysqldump, edit the file to change the name of the database, make sure the database exists, then USE it to import. Something like this will work in the shell:

<pre># mysqldump MyOldDatabase MyTableToMove;

  1. echo "USE MyOldDatabase; DROP MyTabelToMove; CREATE MyNewDatabase; USE MyNewDatabase" | cat - dump.sql | mysql"</pre>
 
8 years ago Dba Btissam

Thanks.

By the 3rd question I mean to move a simple text file(not a database file) from a directory to another one ,how to do a file copy +remove operations using MariaDb?

Regards

 
8 years ago Jan Steinman

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;"

 
8 years ago Dba Btissam

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 ?

Thanks

 
8 years ago Jan Steinman

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/

 
8 years ago Jan Steinman

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.

 
7 years, 10 months ago Dba Btissam

Hi,

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 ?

Thanks

 
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.