当前位置:网站首页>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
边栏推荐
- win11安装pytorch-gpu遇到的坑
- Getting started with pytest ----- confitest Application of PY
- [high speed bus] Introduction to jesd204b
- Super detailed pycharm tutorial
- [bus interface] Axi interface
- Record the bug of unity 2020.3.31f1 once
- Summary of main account information of zhengdaliu 4
- Its appearance makes competitors tremble. Interpretation of Sony vision-s 02 products
- Analyze the space occupied by the table according to segments, clusters and pages
- UNET deployment based on deepstream
猜你喜欢

Online incremental migration of DM database

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!

June book news | 9 new books are listed, with a strong lineup and eyes closed!

Leetcode- insert and sort the linked list

面试会问的 Promise.all()

Vmware安装win10报错:operating system not found

The underlying principle of go map (storage and capacity expansion)

2022-003arts: recursive routine of binary tree

C# 基于MQTTNet的服务端与客户端通信案例

Tawang food industry insight | current situation, consumption data and trend analysis of domestic infant complementary food market
随机推荐
Unity particle Foundation
How to modify data file path in DM database
Mathematical knowledge -- understanding and examples of fast power
Let genuine SMS pressure measurement open source code
Cannot activate CONDA virtual environment in vscode
fastText文本分类
VMware installation win10 reports an error: operating system not found
Gin framework learning code
正大留4的主账户信息汇总
Design and implementation of general interface open platform - (44) log processing of API services
Summary of MySQL key challenges (2)
Oracle和MySQL的基本区别(入门级)
培养中小学生对教育机器人的热爱之心
Comp 250 parsing
Idea automatic package import and automatic package deletion settings
LM09丨费雪逆变换反转网格策略
Mapping location after kotlin confusion
Keil compilation code of CY7C68013A
TypeScript函数详解
UNET deployment based on deepstream