In this guide, we will explore the step-by-step process of migrating from MySQL to Oracle, covering key concepts, tools, and best practices to ensure a successful transition.
The tool we will use for the migration process will be “Oracle SQL Developer”.
To give information about databases.
MySQL DB
1 2 3 4 5 6 7 8 9 10 11 12 13 |
172.20.42.51 - 3306 mysql> select version(); +----------------+ | version() | +----------------+ | 5.1.46-log | +----------------+ 1 row in set (0.00 sec) [root@twt0isdb001 goldengate]# vi /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 6) ~ |
Oracle DB
1 2 3 4 5 6 7 |
172.20.42.21 - 1521 - primary1 Oracle 11g R2 11.2.0.4 [root@primary1 ~]# vi /etc/redhat-release Red Hat Enterprise Linux Server release 5.9 (Tikanga) ~ |
2. We create a SCHEMA that will be used as a REPOSITORY in the Oracle database we are connected to, and the permissions to be given to this schema are as follows.
1 |
SQL> grant connect, resource, dba to migration_repository identified by migration_repository; |
3. Then we connect to our Oracle database with this user.
4. We create MIGRATION REPOSITORY under the SCHEMA we created in our Oracle database.
5. Screens like the one below will appear.
6. We will start the transfer process by following the steps below.
i. We click on the database we will transfer and select the “Migrate To Oracle” option.
ii. We pass the first step.
iii. We select the REPOSITORY we created and click the NEXT button.
iv. We fill in the blanks as follows.
v. The database to be MIGRATED is selected.
vi. We select the MySQL database.
vii. The following step shows the DATA TYPE change when performing MIGRATION between databases.
viii. We select the database objects to be TRANSLATE.
ix. We enter our Oracle database, which will be our new database, as follows. This is the database we connect to with the SYS user.
x. The last step shows the result.
xi. The summary is as follows.
xii. The MIGRATE process will proceed as follows.
xiii. The result of the operation should be as follows.
7. Now that we have completed the MIGRATION process, we can check the tables. First, we check the tables on the MySQL side and then on the Oracle side.
MySQL
Oracle
1 |
SQL> select OWNER, TABLE_NAME, NUM_ROWS from dba_tables where owner ='APPDATA' order by 2; |
8. Finally, let’s check the row numbers.
MySQL
Oracle