当前位置:网站首页>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
- Simple and practical accounting software, so that accounts can be checked
- Mathematical problems (number theory) trial division to judge prime numbers, decompose prime factors, and screen prime numbers
- DJB Hash
- 社交媒体搜索引擎优化及其重要性
- Go Chan's underlying principles
- idea自動導包和自動删包設置
- Design and implementation of general interface open platform - (44) log processing of API services
- Line by line explanation of yolox source code of anchor free series network (7) -- obj in head_ loss、Cls_ Loss and reg_ Calculation and reverse transmission of loss I
- idea自动导包和自动删包设置
猜你喜欢
Keil compilation code of CY7C68013A
Its appearance makes competitors tremble. Interpretation of Sony vision-s 02 products
Getting started with pytest -- description of fixture parameters
关于Steam 教育的知识整理
解决:代理抛出异常错误
One step implementation of yolox helmet detection (combined with oak intelligent depth camera)
Thinkphp Kernel wo system source Commercial Open source multi - user + multi - Customer Service + SMS + email notification
idea自动导包和自动删包设置
面试会问的 Promise.all()
Solution: the agent throws an exception error
随机推荐
农业生态领域智能机器人的应用
DC-1靶场搭建及渗透实战详细过程(DC靶场系列)
Gin framework learning code
農業生態領域智能機器人的應用
2022-003arts: recursive routine of binary tree
[common error] the DDR type of FPGA device is selected incorrectly
C # picture display occupancy problem
Common errors of dmrman offline backup
Record the bug of unity 2020.3.31f1 once
TypeScript函数详解
C case of communication between server and client based on mqttnet
ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
CubeMx DMA笔记
Binary tree problem solving (2)
Simple and practical accounting software, so that accounts can be checked
数学知识——快速幂的理解及例题
Analyze the space occupied by the table according to segments, clusters and pages
Video multiple effects production, fade in effect and border background are added at the same time
06 decorator mode
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!