当前位置:网站首页>Basic differences between Oracle and MySQL (entry level)
Basic differences between Oracle and MySQL (entry level)
2022-07-02 04:56:00 【MICAHHH】
Catalog
whole
Product positioning differences
- Oracle Database is an object relational database management system (ORDBMS).MySQL Is an open source relational database management system (RDBMS).
- Oracle It is a large database for charging .MySQL It's open source 、 Free of charge 、 Small and medium databases .
- Oracle If something happens, call the customer service ,MySQL Solve the problem by yourself .
Transaction support
- Oracle The default is not auto submit , It needs to be submitted by the user manually .MySQL The default is auto submit .
- MySQL Only some storage engines support transactions (InnoDB),Oracle It supports .
concurrency
What is concurrency ? Concurrency is OLTP(On-Line Transaction Processing Online transaction processing ) The most important feature of database , Concurrency involves the acquisition of resources 、 Sharing and locking .
Mysql Mainly watch lock , Great efforts have been made to lock resources , If one session Locking a watch for too long , Will let others session Unable to update data for this table .
Oracle Using row level locks , The intensity of resource locking is much smaller , It's just locking sql Resources needed , And the lock is on the data row in the database , Independent of index . therefore oracle Support for concurrency is much better .
persistence
Oracle Ensure that all committed transactions can be recovered , because Oracle Put the submitted sql The operating line is written to the online log file , Save to disk , If the database or host is abnormal, restart , restart Oracle The data submitted by customers can be recovered by online logs .
Mysql Default submit sql sentence , But if something happens during the update process db Or the problem of host restart , Data may also be lost .
Data replication
MySQL: Replication server configuration is simple , But when there's something wrong with the main warehouse , The plex may lose some data . And you need to manually switch the cluster library to the main library .
Oracle: There's traditional data replication, push or pull , Also have dataguard The disaster recovery mechanism of dual or multiple computers , The problem with the main library is , You can automatically switch the standby database to the main database , But configuration management is more complex .
Performance diagnostics
Oracle There are various mature performance diagnosis and tuning tools , Can realize a lot of automatic analysis 、 Diagnostic function . such as awr、addm、sqltrace、tkproof etc. ;
MySQL There are fewer diagnostic tuning methods , There are mainly slow query logs .
The data backup
Mysql Logical backup is to lock data , To ensure that the backup data is consistent , Affecting the normal business DML( Data manipulation language Data Manipulation Language) Use ;Oracle Do not lock data during logical backup , And the backup data is consistent .
Permission support
- Oracle The concept of authority and security is more traditional , The compasses ;MySQL The user of is related to the host , It doesn't make any sense , In addition, the host is easier to be imitated ip There is a chance .
- Oracle User permissions can be set 、 Access right 、 Read and write permissions, etc ,MySQL No, .
Isolation level
MySQL yes repeatable read Isolation level , and Oracle yes read commited Isolation level
Partitioned tables and partitioned indexes
MySQL The partition table is not yet mature and stable ;Oracle The function of partition table and partition index is very mature , Can improve user access db Experience .
data structure
Date support
MySQL The date field is divided into DATE and TIME Two kinds of ,Oracle The date field is only DATE, Contains the information of year, month, day, hour, minute and second , The system time of the current database is SYSDATE, Accurate to seconds
Character support
There are some differences in the character types supported in the two databases . For character types ,MySQL have CHAR and VARCHAR, The maximum length allowed is 65,535 byte (CHAR Up to 255 byte ,VARCHAR by 65.535 byte ).
and ,Oracle Four character types are supported , namely CHAR,NCHAR,VARCHAR2 and NVARCHAR2; All four character types require at least 1 Byte length ; CHAR and NCHAR The biggest can be 2000 Bytes ,NVARCHAR2 and VARCHAR2 The maximum limit of is 4000 Bytes . It may be extended in the latest version .
SQL sentence
- mysql Use concat() Function connection string ,oracle It's not just concat() function , You can also use ||;
- mysql Paging using limit,oracle Paging has to be done with the help of rownum keyword (Oracle Pagination is done by pseudo columns and subqueries , Insert data can only be inserted in one row )
- mysql Automatic growth auto_increment,oracle Use sequence instead of ;
- mysql Write the loop judgment statement directly ,oracle Have to rely on PL/SQL sentence
- mysql use elseif,oracle Use elsif;
- group by, Under oracle Next use group by Words ,group by The following fields must be in select Behind the , Otherwise, it will be wrong , and mysql But not ;
- mysql There is no external connection , Use a collection connection instead of ,oracle With all external connections , And the left and right outer links have their own grammar :(+);
- mysql There can be no from,oracle There has to be , It can be written. from dual;
- mysql You can create a database , and oracle Without this operation ,oracle Only instances can be created ;
- Oracle No, if exists keyword , It doesn't work like if exists Of SQL grammar .
( There are too many differences , If you encounter problems, please inquire )
Oracle still MySQL
Most people think , If there are many high concurrency 、 High security and other advanced requirements , Then use Oracle better , Instead, use MySQL.
If the core technology is not mastered by yourself , It's hard to have the ability to solve problems quickly enough . So most of them will choose their own database . Many people go IOE, Abandon completely to IBM、ORACLE and EMC Tradition represented by IT framework , Its essence is to use “ Distributed architecture + Open source software ” Replace the traditional “ Centralized architecture + Commercial software ”. Alibaba, for example, is from Oracle go to MySQL.
Most Internet companies choose to mix and match : Those that can be solved with open source , If open source is not so reliable, use commercial top , Then slowly find the right time to replace . But in fact , Business is generally only fast , It is best to seize the market quickly Oracle.
From the perspective of money , An excellent person MySQL DBA My salary is not low , So it looks like Oracle It's not that expensive .
Specific problems need to be analyzed .
Reference resources :
https://zhuanlan.zhihu.com/p/158751020
https://zhuanlan.zhihu.com/p/335264917
https://www.cnblogs.com/yanyunpiaomaio/p/10821437.html
https://blog.csdn.net/andyguan01_2/article/details/86995794
边栏推荐
- Keil compilation code of CY7C68013A
- UNET deployment based on deepstream
- Summary of database problems
- Mysql表insert中文变?号的问题解决办法
- How to modify data file path in DM database
- Mathematical problems (number theory) trial division to judge prime numbers, decompose prime factors, and screen prime numbers
- Embedded-c language-9-makefile/ structure / Consortium
- Design and implementation of general interface open platform - (44) log processing of API services
- 6.30年终小结,学生时代结束
- C# 图片显示占用问题
猜你喜欢
![Learn AI safety monitoring project from zero [attach detailed code]](/img/a9/cb93f349229e86cbb05ad196ae9553.jpg)
Learn AI safety monitoring project from zero [attach detailed code]

Video multiple effects production, fade in effect and border background are added at the same time

Embedded-c language-9-makefile/ structure / Consortium

Analyzing the hands-on building tutorial in children's programming

Ten thousand volumes are known to all, and one page of a book is always relevant. TVP reading club will take you through the reading puzzle!

Keil compilation code of CY7C68013A

解决:代理抛出异常错误

Markdown编辑语法

How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
![[high speed bus] Introduction to jesd204b](/img/78/1a0a3672e63058da6d98da95aa3cf2.jpg)
[high speed bus] Introduction to jesd204b
随机推荐
Learn BeanShell before you dare to say you know JMeter
Starting from the classification of database, I understand the map database
Go Chan's underlying principles
Summary of database problems
How to recover deleted data in disk
Binary tree problem solving (1)
记录一次Unity 2020.3.31f1的bug
Leetcode merge sort linked list
Pytest learning ----- pytest assertion of interface automation testing
Mathematical problems (number theory) trial division to judge prime numbers, decompose prime factors, and screen prime numbers
win11安装pytorch-gpu遇到的坑
DMA Porter
CY7C68013A之keil编译代码
Pit encountered in win11 pytorch GPU installation
C# 图片显示占用问题
Application of intelligent robot in agricultural ecology
How to write a client-side technical solution
fastText文本分类
TypeScript类的使用
Markdown编辑语法