Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

moving CLOBs in ORACLE

Greetings,
I have a table with a CLOB in it (plus some normal fields, couple of decimals, some ints, some varchar2(x)).

I am told that "Insert into table (select....))" is not the fastest way to load a CLOB.

Does anyone know the fastest way to move a CLOB over (with the other fields)?
Thanks

Efficiencey is the name of the game here.  Source and Target tables are both in ORACLE instances.
Avatar of Bajwa
Bajwa
Flag of United States of America image

Avatar of Evan Cutler

ASKER

This is great information...I will absolutely keep this...we have attachments too, to which I was going to tackle next, this is great.

However, my problem is I need to pick up some tables that are already CLOB'd, and leapfrog to one table then onto another.  

basically I need to copy this table twice.  My ETL job is extremely slow in this matter.
Thanks.
Oracle recommends to keep LOB, CLOBS in separate tablespaces and you could

1. Create a new tablespace and
2. move all your CLOBS to new ts

Here is a generate script

select 'alter table '||table_name||' move lob('||column_name||') store as (tablespace MY_NEW_TS);' from user_lobs
/

this script will generate all the tables with lob/clob columns using which you can move them to a separate tablespace

for example

alter table clob_test move lob(clob_field) store as ( tablespace users);
The problem is that I have three schemas.....one source, two target.  Each schema is in a different tablespace, and I need to get this clob over to both of them, because I have applications using each schema.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>I am told that "Insert into table (select....))" is not the fastest way to load a CLOB.

Have you confirmed this with your own tests?  Not sure how you are doing it now but I would expect this to be the quickest.
I have a test of 300,000 records...create table from insert...  runs in 4.5 minutes.
I have 220Mil records to move. then 100K a day....
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry for the long reply.
impdp is a great solution, however my customer would not allow it.
we had to alter the plan.

Thank you.