Import data exported from an Oracle database into a MySQL database
1. Import to the MySQL database using the default closing symbol:
LOAD DATA LOCAL INFILE ' d:/oracle.txt ' IGNORE into TABLE alarmlog
The Terminator in fields now defaults to the '/t ' tab instead of the '/t ' string.
2. When the set fields terminator is imported into the MySQL database:
LOAD DATA LOCAL INFILE ' d:/oraclea.txt ' IGNORE into TABLE alarmlog fields TERMINATED by ' ~ '
The data files used in both cases oracle.txt and oraclea.txt are exported through the Ociuldr.exe program.
Import data exported from MySQL into an Oracle database
1. Import data from MySQL database into a file by setting the fields Terminator
SELECT * from Alarmlog to outfile ' d:/mysql.txt ' fields TERMINATED by ' ~ '
Import the D:/mysql.txt data file into the Oracle database via SQLLDR. Note that the control file is written, the following is the control file corresponding to the test program.
OPTIONS (bindsize=8388608,readsize=8388608,errors=-1,rows=50000)
LOAD DATA
INFILE ' D:/mysql.txt ' "STR X ' 0A '"
Into TABLE Instantdata
Fields TERMINATED by ' ~ ' TRAILING nullcols
(
FieldID CHAR (20),
Createtime Date ' Yyyy-mm-dd hh24:mi:ss ',
Acktime Date ' Yyyy-mm-dd hh24:mi:ss ',
TYPE CHAR (40),
Quality CHAR (40),
VALUE CHAR (40),
AVG CHAR (40),
MAX CHAR (40),
MIN CHAR (40),
SUM CHAR (40)
)
Import backups between MySQL database and Oracle database