System information for migration testing is shown below.
MySQL: 5.0.89, AIX 6.1
Informix: 11.50.FC9, AIX 6.1
Creating Sample Tables and Data (MySQL)
echo "create table blotest(a int, b blob)" | mysql -u root -p1nfra test
echo "insert into blobtest values (2,load_file('/home/mysql/logo.gif'))" | mysql -u user -ppasswd test
Initially, the data was extracted with the --hex-blob and --tab options of the mysqldump utility, but when extracted as a delimiter, it was not extracted as a hex.
So I extracted it with the OUTFILE statement as shown below.
echo "SELECT a,hex(b) INTO OUTFILE '/home/mysql/blobtest.txt' FIELDS TERMINATED BY '|' LINES TERMINATED BY '|\n' FROM blobtest;" | mysql -u user -ppasswd test
As mentioned above, when extracting data using the OUTFILE statement in MySQL, the NULL value is extracted as '\ N', so it needs to be processed.
And since Informix's delimiter file has delimiters at the end of the record, we've set LINES TERMINTAED BY to '|\n'.
In MySQL, the alphabet of the result of the hex function is printed in uppercase, while Informix is printed in lowercase, but there is no problem loading the data.
Create table to enter BLOB data in Informix (Informix)
echo "create table blobtest (a byte)" | dbaccess stores_demo
echo "create table blobtest1 (a blob)" | dbaccess stores_demo
When inputting to BLOB type in Informix, text and image data should be separated, so I executed the process of inputting image data first in BYTE type, then in BLOB format and then input again.
echo "load from /home/mysql/blobtest.txt insert into blobtest" | dbaccess stores_Demo
echo "insert into blobtest1 select b::blob from blobtest" | dbaccess stores_demo
After checking with the GUI tool, I was able to confirm that the image was well entered.
source:
How to migrate large blob table from mysql to postgresql?
http://dba.stackexchange.com/questions/4211/how-to-migrate-large-blob-table-from-mysql-to-postgresql
Migrate a database from MySQL to IBM Informix Innovator-C Edition, Part 1: Comparing MySQL to IBM Informix Innovator-C Edition
http://www.ibm.com/developerworks/data/library/techarticle/dm-1102mysqltoinnovatorc/
Migrate a database from MySQL to IBM Informix Innovator-C Edition, Part 2: Step-by-step walk-through of the migration process
http://www.ibm.com/developerworks/data/tutorials/dm-1102mysqltoinnovatorc2/index.html
Informix Interview Questions Answers
답글삭제