Re: blobs, mssql
Posted by: Michael G. Zinner
Date: December 12, 2005 08:42AM

To increase the 4MB limit, open java\com\mysql\grt\modules\MigrationGeneric.java and search for the
getEscapedHexString() function. Change the *4 to *8 or *16 in the following code and re-compile the file.

if ((currentSize > 1048576 * 4) && (!doOverrideBlobLimit)) {
throw new RuntimeException("BLOB is larger than 4MB.");
}

We introduced this limit to prevent out of memory issues.


You can also add the parameter "OverrideBlobLimit" to the dataBulkTransferParams. In function Mig:bulkDataTransfer() at the very end of the MigrationScript.lua file, add the parameter and set it to "yes".

-- set transfer parameters
grtV.setGlobal("/migration/dataBulkTransferParams", {
CreateScript= (selection == 1) and "yes" or "no",
TransferData= "no",
ScriptFileName="inserts.sql",
OverrideBlobLimit= "yes"
}
)

But if you have one very large BLOB it will cause Java to fail, because the JVM runs out of memory.


The blob stream checkbox in Windows changes the behaviour so that the initial INSERTs use NULL for BLOB values. Then, in a second step, the BLOB values are selected and streamed over to MySQL using a special feature in MySQL's JDBC driver.

I originally implemented this for a customer migrating from Oracle who had BLOBs larger than 250MB and I have not tested it with MSSQL yet. If the MSSQL JDBC driver we use does not support the getBinaryStream() function then this will not work. I will look into this.

Mike

Michael Zinner, Team Lead, Developer Tools
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification



Edited 2 time(s). Last edit at 12/12/2005 08:44AM by Michael G. Zinner.

Options: ReplyQuote


Subject
Written By
Posted
December 09, 2005 12:17AM
December 09, 2005 11:01AM
Re: blobs, mssql
December 12, 2005 08:42AM
December 13, 2005 04:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.