search
HomeDatabaseMysql TutorialWhat is the difference between MySQL and Oracle?

This article will introduce to you the difference between MySQL and Oracle. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

What is the difference between MySQL and Oracle?

##1. Macroscopically:

1. Oracle is a large database and Mysql is a small and medium-sized database; Mysql is open source and Oracle is paid. And expensive.

2. Oracle supports large concurrency and large access volume, and is the best tool for OLTP.

3. The memory occupied by the installation is also different. After the Mysql installation is completed, the memory occupied is much smaller than the memory occupied by Oracle, and the more Oracle is used, the more memory it will occupy.

2. Microscopic view:

1. Support for transactions

Mysql does not support transactions by default, but some storage engines such as innodb can support it. ; And Oracle fully supports things.

2. Concurrency

What is concurrency? Concurrency is the most important feature of the OLTP (

On-Line Transaction Processing Online Transaction Processing) database. Concurrency involves the acquisition, sharing and locking of resources.

Mysql supports both table locks and row-level locks. Table locks are very powerful in locking resources. If a session locks a table for too long, other sessions will be unable to update the data of this table.

Oracle uses row-level locking, which locks resources much less strongly. It only locks the resources required by SQL, and the locking is on the data rows in the database and does not depend on the index. Therefore, Oracle's support for concurrency is much better.

3. Data persistence

Oracle guarantees that submitted transactions can be recovered, because Oracle writes the submitted sql operation line into the online online log file and saves it to the disk. If If the database or host restarts abnormally, restarting Oracle can restore the data submitted by the customer by relying on the online log.

Mysql submits sql statements by default, but if there is a db or host restart problem during the update process, data may also be lost.

4. Transaction isolation level

MySQL is the isolation level of repeatable read, while Oracle is the isolation level of read committed. At the same time, both support serializable serialized transaction isolation level, which can achieve the highest level.

Read consistency. Only after each session is submitted can other sessions see the submitted changes. Oracle achieves read consistency by constructing multi-version data blocks in the undo table space. When each session is queried, if the corresponding data block changes, Oracle will construct the old data for this session in the undo table space when it is queried. piece.

MySQL does not have a mechanism to construct multi-version data blocks similar to Oracle, and only supports the isolation level of read committed. When one session reads data, other sessions cannot change the data, but they can insert data at the end of the table. When a session updates data, an exclusive lock must be added so that other sessions cannot access the data

5. Submission method

Oracle does not automatically submit by default and needs to be submitted manually. Mysql automatically commits by default.

6. Logical backup

Mysql logical backup requires locking data to ensure that the backed up data is consistent, which affects the normal use of DML (Data Manipulation Language) in the business; Oracle logic Data is not locked during backup, and the backed up data is consistent.

7. Flexibility of sql statements

Mysql has many very practical and convenient extensions to sql statements, such as limit function (paging), insert can insert multiple rows of data at a time; Oracle is here It feels more stable and traditional. Oracle's paging is done through pseudo columns and subqueries, and data can only be inserted row by row.

8. Data replication

MySQL: The replication server configuration is simple, but when there is a problem with the main database, the cluster database may lose a certain amount of data. And you need to manually switch the plex library to the main library.

Oracle: There are both push or pull traditional data replication and dataguard’s dual-machine or multi-machine disaster recovery mechanism. If there is a problem with the main database, the standby database can be automatically switched to the main database, but the configuration management is complicated. complex.

9. Partitioned table and partitioned index

MySQL's partitioned table is not yet mature and stable; Oracle's partitioned table and partitioned index functions are very mature and can improve the user's experience of accessing the DB.

10. After-sales and fees

Oracle charges a fee. If you have any problems, please contact customer service; Mysql is free and open source. If you have problems, you can solve them by yourself.

11. Permissions and security

Oracle's permissions and security concepts are relatively traditional and quite satisfactory; MySQL users are related to the host, which feels meaningless. In addition, the host and IP are more likely to be counterfeited. Take advantage of the opportunity.

12. Performance diagnosis

Oracle has various mature performance diagnosis and tuning tools, which can realize many automatic analysis and diagnosis functions. For example, awr, addm, sqltrace, tkproof, etc.; MySQL has few diagnostic and tuning methods, mainly slow query logs.

Related recommendations: "

mysql tutorial"

The above is the detailed content of What is the difference between MySQL and Oracle?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQL BLOB : are there any limits?MySQL BLOB : are there any limits?May 08, 2025 am 12:22 AM

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

MySQL : What are the best tools to automate users creation?MySQL : What are the best tools to automate users creation?May 08, 2025 am 12:22 AM

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

MySQL: Can I search inside a blob?MySQL: Can I search inside a blob?May 08, 2025 am 12:20 AM

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.