MySQL differs from Oracle

Source: Internet
Author: User

MySQL differs from Oracle
Article Category: Database
Friday went to a company to interview, the company manager asked about the difference between MySQL and Oracle, did not summarize before, the answer is not very good, just by feeling, first summed up as follows:
1.

Oracle is a large database and MySQL is a small and medium-sized database, Oracle has a market share of 40%,mysql only about 20%, while MySQL is open source and Oracle is very expensive.
2. Oracle supports high concurrency, large traffic, and is the best tool for OLTP.
3. The space used to install the difference is also very large, MySQL installed after the 152M and Oracle has about 3G, and the use of Oracle occupies a particularly large memory space and other machine performance.
4.Oracle also some differences in MySQL operation
① PRIMARY Key
MySQL generally uses the automatic growth type, when the table is created as long as the primary key of the specified table is autoincrement, when inserting a record, no need to specify the primary key value of the record, MySQL will automatically grow; Oracle does not have an auto-grow type, the primary key is generally used by the sequence, The next value of the sequence number is paid to the field when the record is inserted, but only if the ORM framework is a native primary key generation strategy.
② Single-Quote processing
In MySQL, you can use double quotes to wrap strings, and Oracle can only wrap strings with single quotes. Single quotation marks must be replaced before inserting and modifying strings: Replace all occurrences of a single quotation mark with two single quotes.
③ the processing of SQL statements with paging
MySQL processing of the page of the SQL statement is relatively simple, using the limit start position, record number; Oracle's SQL statement for paging is cumbersome. Each result set has only one rownum field indicating its location and can only be used with rownum<100, not rownum>80
Processing of ④ long strings
The processing of long strings Oracle also has its special place. Insert and update when the maximum operand length is less than or equal to 4,000 single bytes, if you want to insert a longer string, consider the field with the Clob type, the method borrows the Dbms_lob package from the Oracle. Be sure to do non-null and length judgments before inserting a modified record, and the field values that cannot be empty and the value beyond the length field should be warned to return the last action.
Processing of ⑤ NULL characters
MySQL's non-empty fields also have empty content, and Oracle defines non-empty fields that are not allowed to have empty content. The Oracle table structure is defined according to MySQL notnull, which generates errors when the data is being directed. As a result, null characters are judged on the data, and if NULL or NULL, it is necessary to change it to a space string.
Fuzzy comparison of ⑥ strings
MySQL uses the field name like '% string% ', Oracle can also use the field name as '% string% ' but this method can not use the index, the speed is not fast.
⑦oracle implements most of the functions in Ansii SQL, such as the isolation level of the transaction, the propagation characteristics, and so on, and MySQL is still compared in this respect if the source: http://blog.sina.com.cn/s/blog_5d9ca4ea0100kmhy.html

Differences between MySQL and Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.