Question

I've been trying unsuccessfully to migrate an oracle database to sql server 2005. The problem I'm seeing is with migration of Oracle "LONG" text to SQL varchar. I only get the first 100 characters of data from the field I'm checking in the Oracle database after the migration completes. I can see data past 100 characters in the data view in SSMA for Oracle.

After some earlier research, it appeared that maybe I needed to set an explicit conversion rule, so I mapped Oracle's "LONG" to SQL VARCHAR(8000), but even though the destination table column is now the proper size (schema changed as desired), the inserted text is always truncated to the first 100 characters.

This question: LONG text in Oracle cut short by SSIS source?

is similar and seems to point to a problem that SSIS might have with OLEDB drivers, but I don't know if this would be related (and even if it is, I don't know what I should do about it to correct this in SSMA).

Anybody SQL Server Migration Assistant experts out there any ideas?

Was it helpful?

Solution

The ultimate solution was to write a query to pull the data out of the table and insert it into a new table as CLOB (which SSMA correctly deals with automatically as varchar(MAX) and doesn't truncate) via a built-in Oracle function.

I used a command similar to the following in sqlplus:

create table schema.my_new_table as
select primary_key_field, to_lob(troublesome_long_column) troublesome_long_column
from schema.original_table;

Since I included the primary key fields, I can tie each row back to the original table. The "to_lob" function converts LONG to CLOB, which makes the conversion of the data in the new table work.

I would have altered the original table (and just added a new column with the converted data), but I couldn't change anything about the existing tables.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top