暂无图片
求mos 文档 Doc ID 2479980.1
我来答
分享
ss
2024-10-25
求mos 文档 Doc ID 2479980.1

How to migrate BLOB/CLOB data from Oracle to MySQL (Doc ID 2479980.1)


我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
墨天轮

抱歉,平台上无法分享包含Oracle具有知识产权的安装包、补丁、内部文档、商标等信息。

暂无图片 评论
暂无图片 有用 1
aknight

For BLOB type, it is possible to migrate by converting it to a hexadecimal character string and then loading it.

When dumping BLOB data from Oracle, please write to CSV with the converted value in hexadecimal.

(In general, you can use rawtohex() in a stored procedure to change BLOB to HEX. However, this document is managed by the MySQL support team and we are not covered Oracle DB. If you have any questions in the dump process of the Oracle DB side, please contact Oracle DB support.)

When loading on the MySQL side, use UNHEX function to return from binary to hexadecimal.

The following is an example in the LOAD DATA statement. We set UNHEXed value using SET in longblog type column.

mysql> CREATE TABLE (id int, data longblob);

mysql> LOAD DATA LOCAL INFILE '/path/to/test.mycsv'
INTO TABLE test
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
LINES TERMINATED BY '\ n'
(id, @ col2) SET data = UNHEX (@ col2);

 

How to export data from Oracle:

The following link will be useful.

How to Convert the Data from BLOB to CLOB using PL/SQL (Doc ID 235142.1)
How To Extract BLOB Data Into Individual Files (Doc ID 1602415.1)
DBMS_LOB Loading and Extracting Binary File To Oracle Database (Doc ID 1307346.1)
How to Write BLOBs Stored Inside the Database Out to Files (Doc ID 330146.1)
How to Write CLOB Data > 32K Out to a File? (Doc ID 358641.1)
How to Export The Table with a CLOB Column Into a CSV File using UTL_FILE ? (Doc ID 1967617.1)
How to Load File Content to a BLOB Field and Unload BLOB Content to a File on the OS (Doc ID 471715.1)


 


 

Please refer to the following documents.

This document also describes how to dump data from Oracle in CSV format and import it to MySQL using the LOAD DATA command.

Migration from Oracle to MySQL (Doc ID 1477151.1)

 

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏