Detailed explanation of the misunderstanding between MySQL and Oracle

Detailed explanation of the misunderstanding between MySQL and Oracle

Essential Difference

  • Oracle Database is an object-relational database management system (chargeable)
  • MySQL is an open source relational database management system (free)

Database security

  • MySQL uses three parameters to authenticate a user, namely username, password and location
  • Oracle uses more security features such as username, password, profile, local authentication, external authentication, advanced security enhancements, etc.

Permissions

The MySQL permission system is a hierarchical structure formed by inheritance. When permissions are granted to a higher level, other lower levels implicitly inherit the permissions granted. Of course, the lower levels can also rewrite these permissions.

Depending on the authorization scope, MySQL has the following authorization methods:

1. Global;

2. Based on each host;

3. Table-based;

4. Based on table columns.

Each level has an authorization table in the database. When performing permission checks, MySQL checks each table from high to low, and lower-range authorizations take precedence over higher-range authorizations.

Unlike Oracle, MySQL does not have the concept of roles. That is to say, if the same permissions are granted to a group of users, each user needs to be authorized separately.

Schema Migration

A schema contains tables, views, indexes, users, constraints, stored procedures, triggers, and other database-related concepts. Most relational databases have similar concepts.

The following contents are included:

1. Similarity of pattern objects;

2. The name of the schema object;

3. Focus on table design;

4.Multiple database integration;

5. Concerns about MySQL schema integration.

Similarity of pattern objects

In terms of schema objects, Oracle and MySQL store many similarities, but there are also some differences.

The name of the schema object

Oracle is case-insensitive, and schema objects are stored in-line on write. In the Oracle world, columns, indexes, stored procedures, triggers, and column aliases are all case-insensitive, and this is true on all platforms. MySQL is case sensitive, such as the storage path relative to the database and the files corresponding to the table.

Both Oracle and MySQL allow you to use keywords with schema objects when you enclose them in quotes. But for some keywords in MySQL, it is OK without quotes.

Table design concerns

1. The type of character data;

2. Column default value.

3. Character Data Type

(1) Oracle supports four font types: CHAR, NCHAR, NVARCHAR2, and VARCHAR2. The maximum length of CHAR and NCHAR is 2000 bytes.

The maximum length of NVARCHAR2 and VARCHAR2 is 4000 bytes.

(2) There are some differences between MySQL and Oracle in saving and reading character data. The length of MySQL character types such as CHAR and VARCHAR is less than 65535 bytes. Oracle supports four font types: CHAR, NCHAR, NVARCHAR2, and VARCHAR2. The maximum length of CHAR and NCHAR is 2000 bytes, and the maximum length of NVARCHAR2 and VARCHAR2 is 4000 bytes.

MySQL handles column default values ​​and does not allow them to be empty, which is different from Oracle. In Oracle, if you insert data into a table, you need to have values ​​for all columns that do not allow NULL.

Multi-database migration

If multiple MySQL databases are located on the same database service, migration is supported.

Data storage concepts

The MySQL database corresponds to a directory within the data directory on the server. This data storage method is different from that of many databases, including Oracle. The table in the database corresponds to one or more files in the database directory and uses the storage engine when storing the table.

An Oracle database contains one or more tablespaces. Tablespaces correspond to the physical storage of data on disk. A tablespace is constructed from one or more data files. A data file is a file in the file system or a piece of raw storage space.

Grammatical Differences

Primary Key:

  • MySQL generally uses the automatic growth type. When creating a table, specify the primary key of the table as auto increment, and the primary key will automatically grow.
  • There is no automatic growth in Oracle. The primary key generally uses a sequence, and the values ​​can be assigned sequentially during interpolation.

Quote mark problem:

  • Oracle does not use double quotes and will report an error
  • MySQL has no restrictions on quotation marks

Pagination query:

  • MySQL paging query uses the keyword limit to implement
  • Oracle does not implement keywords for paging queries, so the implementation is more complicated. In each result set, there is only one rownum field to indicate its position, and you can only use rownum<= a certain number, not rownum>= a certain number, because ROWNUM is a pseudo column. When using it, you need to give ROWNUM an alias to turn it into a logical column and then operate on it.

Data Type:

  • Integer type in MySQL: int(), string type: varchar()
  • Integer in Oracle: number(), string type: varchar2()

The above is a detailed explanation of the misunderstandings between Mysql and Oracle. For more information about the misunderstandings between Mysql and Oracle, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Implementation of SpringBoot multi-database connection (mysql+oracle)
  • Detailed explanation of the solution for real-time synchronization from MySQL to Oracle
  • Example of creating table statements for user Scott in MySQL version of Oracle
  • Description of the default transaction isolation level of mysql and oracle
  • Description of the correspondence between MyBatis JdbcType and Oracle and MySql data types
  • Summary of the differences between MySQL and Oracle (comparison of functional performance, selection, SQL when using them, etc.)
  • Detailed example of mysql similar to oracle rownum writing
  • A brief discussion on the differences between the three major databases: Mysql, SqlServer, and Oracle
  • Problems and solutions when replacing Oracle with MySQL

<<:  Unable to define IE6 font: 13px size is invalid, IE6 automatically displays a larger font solution

>>:  Example code for implementing triangles and arrows through CSS borders

Recommend

Example of implementing grouping and deduplication in MySQL table join query

Table of contents Business Logic Data table struc...

Analysis of MySQL concurrency issues and solutions

Table of contents 1. Background 2. Slow query cau...

Several ways to solve CSS style conflicts (summary)

1. Refine the selector By using combinators, the ...

More popular and creative dark background web design examples

Dark background style page design is very popular...

JavaScript web page entry-level development detailed explanation

Part 3: ❤Three ways to overlook backend data rece...

Some things to note about varchar type in Mysql

Storage rules for varchar In versions below 4.0, ...

How to view and set the mysql time zone

1. Check the database time zone show variables li...

Using front-end HTML+CSS+JS to develop a simple TODOLIST function (notepad)

Table of contents 1. Brief Introduction 2. Run sc...

Why is the disk space still occupied after deleting table data in MySQL?

Table of contents 1. Mysql data structure 2. The ...

How to set up scheduled backup tasks in Linux centos

Implementation Preparation # Need to back up the ...

Mysql stores tree structure through Adjacency List (adjacency list)

The following content introduces the process and ...

Layui implements sample code for multi-condition query

I recently made a file system and found that ther...

How to use DQL commands to query data in MySQL

In this article, the blogger will take you to lea...

What is the use of the enctype field when uploading files?

The enctype attribute of the FORM element specifie...

In-depth explanation of binlog in MySQL 8.0

1 Introduction Binary log records SQL statements ...