MySQL imports data into Oracle.
To build an Oracle table:
CREATETABLE"Gg_user" ("USERID"VARCHAR2 (255 BYTE)NotNull, "Ispart"VARCHAR2 (255 BYTE)DEFAULTNull, "Actualpositionid"Number (11)DEFAULTNull, "Beginworktime"TIMESTAMP (0)DEFAULTNull, "BIRTHDAY"TIMESTAMP (0)DEFAULTNull, "Cardno"VARCHAR2 (255 BYTE)DEFAULTNull, "EMAIL"VARCHAR2 (255 BYTE)DEFAULTNull, "Genderid"Number (11)DEFAULTNull, "Healthid"Number (11)DEFAULTNull, "HOME"VARCHAR2 (255 BYTE)DEFAULTNull, "IDENTIFY"VARCHAR2 (255 BYTE)DEFAULTNull, "Leavereasonid"Number (11)DEFAULTNull, "Leavetime"TIMESTAMP (0)DEFAULTNull, "Mobilephone"VARCHAR2 (255 BYTE)DEFAULTNull, "OFFICE"VARCHAR2 (255 BYTE)DEFAULTNull, "ORGID"VARCHAR2 (255 BYTE)DEFAULTNull, "OrgName"VARCHAR2 (255 BYTE)DEFAULTNull, "PASSWORD"VARCHAR2 (255 BYTE)DEFAULTNull, "PositionID"Number (11)DEFAULTNull, "Reachtime"TIMESTAMP (0)DEFAULTNull, "Sortsno"Number (11)DEFAULTNull, "Userimg"VARCHAR2 (255 BYTE)DEFAULTNull, "USERNAME"VARCHAR2 (255 BYTE)DEFAULTNull, "Workstatusid"Number (11)DEFAULTNull, "STATUS"Number (11)default null " Certypeid "number (11) default null "Minzuid" number (11) default null " PERSONID "varchar2 (255 BYTE) default null primary key To execute the MySQL Data Export command:
mysql-uroot-pd********-ne "Use dsideal_db; SELECT * from Gg_user; ">/usr/local/mysql/gg_user.csv
Write Sqlldr Import Control file
Load data
CHARACTERSET ' UTF8 '
InFile ' D:/gg_user.csv '
Replace into table Gg_user
Fields terminated by X ' 09 '
Optionally enclosed by ' "'
(USERID nullif (userid= ' null '), Ispart nullif (ispart= ' null '), Actualpositionid nullif (actualpositionid= ' null '), beginworktime timestamp "Yyyy-mm-dd" Nullif (beginworktime= ' NULL '), BIRTHDAY timestamp "YYYY-MM-DD" Nullif ( birthday= ' null '), Cardno nullif (cardno= ' null '), EMAIL nullif (email= ' null '), Genderid nullif (genderid= ' null '), Healthid nullif (healthid= ' null '), HOME nullif (home= ' null '), IDENTIFY nullif (identify= ' null '), Leavereasonid nullif ( Leavereasonid= ' null '),leavetime timestamp "Yyyy-mm-dd" nullif (leavetime= ' null '), Mobilephone nullif ( Mobilephone= ' null '), OFFICE nullif (office= ' null '), ORGID nullif (orgid= ' null '), OrgName nullif (orgname= ' null '), PASSWORD nullif (password= ' null '), PositionID nullif (positionid= ' null '), reachtime timestamp "YYYY-MM-DD" Nullif ( Reachtime= ' null '), Sortsno nullif (sortsno= ' null '), userimg nullif (userimg= ' null '), USERNAME nullif (username= ' null '), Workstatusid nullif (workstatusid= ' null '), STATUS nullif (status= ' null '), Certypeid nullif (certypeid= ' null ')), Minzuid nullif (minzuid= ' null '), PERSONID nullif (personid= ' null '))
Perform a SQLLDR import operation
Sqlldr userid= ' dsideal/dsideal ' control= ' d:/ctl.ctl ' log= ' D:/ctl.log '
MySQL Import data into Oracle