Considerations for MySQL to Oracle program migration

Source: Internet
Author: User
Considerations for MySQL to Oracle program migration
2001-09
There are many application projects, just started with the MySQL database can basically achieve a variety of functional requirements, with the increase in application users,
The increase in the amount of data, MySQL gradually overwhelmed the situation: the connection is slow or even downtime, so there is the data from MySQL relocated
Oracle's needs, the application will have to make some changes accordingly. I have summed up the following points of attention, I hope to help you.
1. Automatic growth of data type processing
MySQL has an automatically growing data type, and the data value is automatically obtained when you insert a record without manipulating this field.
Oracle does not automatically grow the data type, need to establish an automatic growth of the serial number, insert the record when the serial number of the next
Value is assigned to this field.
The name of the CREATE SEQUENCE serial number (preferably the table name serial number tag) INCREMENT by 1 START with 1
MAXVALUE 99999 CYCLE NoCache;
The maximum value is determined by the length of the field, and if the defined automatically-growing serial number (6), the maximum is 999999
Insert statement inserts this field value as: The name of the serial number. Nextval
2. Single quotation mark processing
MySQL can be used in double quotes wrap strings, Oracle can only use single quotes wrap strings. In inserting and modifying strings
Must be replaced by single quotes: Replace all occurrences of one single quote with two single quotes.
3. The processing of the SQL statement page
MySQL processing pages of the SQL statement is relatively simple, with limit start position, record number; PHP can also use seek to locate the result
The location of the set.
Oracle handles page-flipping SQL statements is cumbersome. Each result set has only one rownum field that indicates its location, and can only
With rownum<100, you can't use rownum>80.
The following are two of the better Oracle page-Flipping SQL statements (field names with IDs as unique keywords):
Statement one:
SELECT ID, [Field_name,...] From table_name WHERE ID in (SELECT ID from (SELECT)
RowNum as Numrow, ID from table_name WHERE Condition 1 order by condition 2 where Numrow >
Numrow <) Order BY condition 3;

Statement two:
SELECT * FROM (select RowNum as Numrow, c.* from (SELECT [Field_name,...] From
table_name WHERE Condition 1 order by condition 2 C) where Numrow > and Numrow < (m) Order by condition 3;
4. Processing of long strings
Processing of long strings Oracle also has its own special place. Maximum operable string length of insert and update is less than or equal to

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.