Rough comparison of MySQL and Oracle

foreword

First of all, let me talk about my own feelings. The first time I used Oracle was in my first internship. I also did some problems in Leetcode to practice. Everyone can do it, and it is still rewarding.
First of all, I have always heard that Oracle has to pay, but in fact it has a free version. I tried to install the version of Oracle Database XE on my computer . I will not explain what was castrated. What I know is like partitionNot supported, but definitely enough for ordinary people to use.
For personal use, I will definitely not use it myself. First, it will take a long time to install Oracle, and it does not support Docker (it is available online, but I have not succeeded). Oracle is also very large in size. I can only install it on a Windows computer. It took me a long time to succeed. And in the later study, there are far fewer articles on the Oracle network than on MySQL. After all, it is not open source, and many things do not know why. If you have any questions, you can only go to the Oracle community to ask questions . Like the blog I wrote before "ORA-01752: cannot delete from view without exactly one key-preserved table and the problem of key-preserved table", this is reflected here.
insert image description here

the difference

The following is my translation based on the article based on https://www.javatpoint.com/mysql-vs-oracle

MySQL Oracle
introduce It is an open source, cross-platform relational database developed by Swedish company and now acquired by Oracle It is an object-oriented relational database. It allows fast and secure storage and retrieval of data. It can handle large amounts of data.
publish time 1995 1980
cost Open source and free, according to the GNU open source agreement Need to get a commercial license, but also provides a free version, which castrates some functions and performances, and is only recommended for students to use
scalability Suitable for small and large businesses Suitable for very large scale deployment
data partition not support support
safety Requires username, password and server address Requires username, password and authentication
Null value support not support
character Support CHAR and VARCHAR Supports CHAR, VARCHAR2, NCHAR and NVARCHAR2
backup mechanism mysqlhotcopy和mysqldump Like backup, hot backup, import, export, etc.
XML not support support
storage characteristics It only supports a few, like tablespaces, synonyms, packages, etc. It supports many things like tablespaces, synonyms, packages, etc.
lock mechanism table locking mechanism Table locks and row locks
language SQL SQL或PL/SQL
operating system Windows、Mac OS X、Linux、UNIX、z/OS、BSD、Symbian、AmigaOS Windows、Mac OS X、Linux、UNIX、z/OS

Remark

  1. What are data partitions?
    It can divide a large table into multiple small tables, each small table contains some data, and can be queried and updated as needed. This technique can improve query performance, reduce I/O operations, and increase concurrency.
    Oracle supports a variety of partitioning methods, including range partitioning, list partitioning, and hash partitioning. Among them, range partitioning is the most commonly used method. It divides data into multiple intervals according to the value of a certain field, and each interval corresponds to a subtable. List partitioning divides the data into multiple subtables according to a fixed list, and hash partitioning divides the data into multiple subtables according to the hash value of the data.

  2. What is authentication mentioned in security?
    I remember that when I was an intern, my colleagues helped me open Oracle permissions, and various settings were very troublesome; MySQl is very easy, and you can log in with the host address, account, and password.

  3. Oracle does not support null values?
    Oracle cannot store null, but it can store empty. I wrote about the difference between Null and no value in Oracle before . It cannot store null, but it can search for null.

  4. The specific difference between characters
    In MySQL, CHAR is a fixed-length character data type; VARCHAR is a variable-length character data type, which can store strings of any length.
    In Oracle, besides CHAR and VARCHAR, there are two other character data types, NCHAR and NVARCHAR2. Among them, NCHAR is a fixed-length Unicode character data type, which only supports characters within the ASCII code range; and NVARCHAR2 is a variable-length Unicode character data type, which can store Unicode strings of any length.

  5. The difference between backup mechanisms
    In MySQL, mysqlhotcopy is a hot backup mechanism, which can perform backups without stopping the database service; and mysqldump is a full backup mechanism, which needs to stop the database service to perform backups.
    For Oracle, backup is a basic backup mechanism, which can back up the entire database or table space into a file; hot backup is a fast backup mechanism, which can perform backup without stopping the database service; import and Export is two data import and export mechanisms, they can export data from one database to another database or from one file to another file, and some other ways.

  6. What is XML for?
    XML refers to the xml file format, Oracle can store these, and also perform precise searches.
    insert image description here

  7. What is the storage feature
    This should be the literal meaning, I did not find the corresponding entry. Let’s explain these three words separately. The first is the table space, which is very simple. It is the table we created in a database; the synonym is relatively unfamiliar. In simple terms, it is the creation of an alias. For development, administrators can create some aliases, authorize them to other personnel, and hide some content, etc. Packages are also relatively unfamiliar, that is, if you write a few SQLs or stored procedures, you need to put them in the package. Give them a name, and then you can call them like functions.

  8. The difference in locking mechanism
    Mysql mainly uses table locks (row locks are also supported, but it is more difficult to implement), and it locks resources very hard. If a session locks a table for too long, other sessions will not be able to update the table. The data.
    Oracle uses row-level locks, which are much less powerful in locking resources. It only locks the resources needed by SQL, and the locking is on the data rows in the database, not dependent on the index. So oracle's support for concurrency is much better.

  9. What is PL/SQL?
    PL/SQL is an extension of Oracle based on SQL. It adds many programming elements that are not in SQL. It supports variables, loops, functions, error handling, etc. In short, it is more powerful than SQL.

Summarize

In short, Oracle will crush MySQL in all aspects, including performance, scalability, reliability, functions, etc., which are stronger than MySQL. Moreover, MySQL was acquired by Oracle in 2009, which also determines the market positioning of MySQL, and its various performances are definitely lower than Oracle.

Guess you like

Origin blog.csdn.net/Fishermen_sail/article/details/128339480