Migrating Table data from MySQL to Oracle Using SQL* LOADER
Hi Readers, In this article,we will see Migrating Table data from MySQL to Oracle Using SQL* LOADER. Step 1 : Connect to Mysql DB and create a table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
[root@ip-172-31-46-32 ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 16 Server version: 5.7.28-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | oggdb1 | | performance_schema | | sys | +--------------------+ 5 rows in set (0.00 sec) mysql> use oggdb1; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> mysql> CREATE TABLE `C_EMP` ( -> `sid` bigint(20) NOT NULL, -> `C_ID` bigint(20) NOT NULL, -> `text` varchar(255) DEFAULT NULL, -> `A_N_S_M` int(11) NOT NULL DEFAULT '0', -> `D_R_I_K` int(11) NOT NULL DEFAULT '0', -> `crd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -> `mdd` timestamp NULL DEFAULT NULL -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Query OK, 0 rows affected (0.01 sec) |
Insert data into a table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.01 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.01 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) mysql> insert into C_EMP values(1,1,'ABCD',10,10,NOW(),NOW()); Query OK, 1 row affected (0.00 sec) |
Crosscheck the data in C_EMP TABLE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
mysql> select * from C_EMP; +-----+------+------+---------+---------+---------------------+---------------------+ | sid | C_ID | text | A_N_S_M | D_R_I_K | crd | mdd | +-----+------+------+---------+---------+---------------------+---------------------+ | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:53 | 2020-05-01 13:08:53 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:55 | 2020-05-01 13:08:55 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:56 | 2020-05-01 13:08:56 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:57 | 2020-05-01 13:08:57 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:58 | 2020-05-01 13:08:58 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:08:59 | 2020-05-01 13:08:59 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:09:00 | 2020-05-01 13:09:00 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:09:04 | 2020-05-01 13:09:04 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:09:05 | 2020-05-01 13:09:05 | | 1 | 1 | ABCD | 10 | 10 | 2020-05-01 13:09:06 | 2020-05-01 13:09:06 | +-----+------+------+---------+---------+---------------------+---------------------+ 10 rows in set (0.00 sec) |
Step 2 : … Read More