The difference between Oracle and MySQL

Source: Internet
Author: User

One, concurrency

Concurrency is the most important feature of an OLTP database, but concurrency involves the acquisition, sharing, and locking of resources.

Mysql:

MySQL is a table-level lock-based, the granularity of the resource lock is very large, if a session on a table lock time too long, the other session will be unable to update the data in this table.

Although the InnoDB engine table can use row-level locks, the mechanism of this row-level lock relies on the index of the table, and table-level locks are still used if the table has no indexes, or if the SQL statement does not use an index.

Oracle

Oracle uses row-level locks, which are much smaller in the granularity of resource locking, only the resources required for locking SQL, and the locks are on the data rows in the database, and are not dependent on the index. So Oracle's support for concurrency is much better.

Second, consistency

Oracle

Oracle supports serializable isolation levels for the highest level of read consistency. Each session is submitted after the other session to see the submitted changes. Oracle implements read consistency by constructing multiple versions of data blocks in the undo table space.

For each session query, if the corresponding data block changes, Oracle constructs the old block of data in the Undo table space for the session when it queries.

Mysql:

MySQL does not have a mechanism similar to Oracle's construction of multi-version data blocks, only the isolation level of read commited is supported. When a session reads data, other sessions cannot change the data, but you can insert data at the end of the table.

When the session updates the data, you add an exclusive lock, and the other session cannot access the data.

Iii. Business

Oracle fully supports transactions very early.

MySQL supports transactions in the case of a row-level lock on the InnoDB storage engine.

Iv. Data Persistence

Oracle

Ensure that the submitted data is recoverable because Oracle writes the submitted SQL action line to the online log file and remains on disk.

In the event of a database or host exception restart, Oracle can recover the data submitted by the customer online logs after a restart.

Mysql:

The SQL statement is submitted by default, but may lose data if there is a problem with DB or host restart during the update process.

V. Ways of submission

Oracle is not automatically committed by default and requires manual submission by the user.

MySQL is automatically committed by default.

VI. Logical Backup

Oracle logical backup does not lock data, and the backed up data is consistent.

MySQL logical backup to lock the data in order to ensure that the backup data is consistent, affecting the business normal DML use.

Seven, hot backup

Oracle has a proven hot standby tool, Rman, that does not affect the user's use of the database while sparing. Even if the databases that are backed up are inconsistent, you can respond to them in a consistent response from the archive log and online redo logs on recovery.

Mysql:

MyISAM's engine, with MySQL's own mysqlhostcopy, needs to read the lock on the table, affecting DML operations.

InnoDB engine that backs up InnoDB tables and indexes, but does not back up the. frm file. When you back up with Ibbackup, a log file records data changes during the backup, so you can use the database without locking the table and not affecting other users. However, this tool is chargeable.

Innobackup is a script that is used in conjunction with Ibbackup, and he assists in backing up the. frm file.

Viii. expansion and flexibility of SQL statements

MySQL has a lot of very useful and convenient extensions to SQL statements, such as the limit function, which inserts multiple rows of data at a time, and select some management data can be non-additive.

Oracle feels more stable and traditional in this respect.

Nine, copy

Oracle: Traditional data replication with either push or pull, or dataguard dual or multi-machine disaster recovery mechanism, the problem with the main library is that you can automatically switch the repository to the main library, but configuration management is more complex.

MySQL: Replication server configuration is simple, but when the main library problems, Concou may lose some data. And you need to manually switch Concou to the main library.

Ten, performance diagnosis

Oracle has a variety of sophisticated performance diagnostic tuning tools that enable many automated analysis and diagnostic functions. such as AWR, ADDM, SQLTrace, tkproof, etc.

MySQL has fewer diagnostic tuning methods, mainly slow query logs.

Xi. Rights and security

MySQL users and host-related, feel no meaning, in addition to more easily be phishing host and IP has an opportunity.

Oracle's rights and security concepts are more traditional and more classic.

12. partition table and partition index

Oracle's partitioned tables and partitioned indexes are mature enough to improve user access to the DB experience.

MySQL's partitioned table is not yet mature and stable.

13. Management Tools

Oracle has a variety of sophisticated command lines, graphical interfaces, web management tools, and a number of third-party management tools that are extremely easy and efficient to manage.

MySQL management tools are less, installation of management tools under Linux sometimes to install additional packages (phpMyAdmin, etc), there is a certain complexity.

The difference between Oracle and MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.