Copy Objects having LOB columns between database

Hi,
I want to know the easiest way to copy the table having one LOB column from one database to another.
Table contains 900K records and create table <tablename> as select is taking hours. Also tried with Insert into <tablename> is also taking much time. and export is giving error DR$SOLUTION_NOTE_IDX$I doesnot exist.
Regards,
Munish Khosla

You have 900K records with LOB. But what is the size of LOBs? If it is, say 1M per row on average then you've got 900G of data. How can you expect to copy it in less than "hours"? Try to copy 900G from one HD to another (if you have 900G disks at hand:o)
You can try transportable tablespaces (not that much of an expert on them)

Similar Messages

  • How to copy the content in XMLtype column between databases

    Hi, there,
    Does anyone know how to copy the content in XMLtype clumn between databases? I tried insert as select via database link and it gives me the following message:
    SQL> insert into nrt_ot_request_temp (SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML )
    2 select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia;
    select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Thanks,
    Jessica

    Hi Jessica,
    in my eyes the second statement
    select ... xmlstring_column ... from table@remote_side;
    causes the error. Columns of type XMLString internally are stored as CLOBs in Oracle. Unfortunately there are restrictions on statements for CLOBs and remote locators.
    It seems you cannot say
    SELECT clob_column FROM table@remote_site;
    Remark: For me this is a showstopper for the datatype XMLString if you cannot run a simple statement like this one. It seems you can do an insert and an update but no select.
    On the other hand your first statement
    INSERT INTO table_local SELECT * FROM table@remote_site;
    should work following the documentation.
    See also
    http://docs.oracle.com/cd_a97630/appdev.920/a96591/adl04mng.htm#98328
    Best regards
    Indu Keilitz

  • When comparing database tables with lob columns via "Database diff" in different environments indexes are shown as different

    When using "Database diff" selecting other schemas only for compare own objects are shown too!Hi!
    For tables with lob columns (clob, blob, etc.) indexes with system names are automatically created per lob column.
    If I am on different database instances (eg. dev/test) these system names can differ and are shown as differences, but these is a false positive.
    Unfortunately there is now way to influence the index names.
    Any chance to fix this in sql developer?
    Best regards
    Torsten

    Only the Sql Dev team can respond to that question.
    Such indexes should ONLY be created by Oracle and should NOT be part of any DDL that you, the user, maintains outside the database since they will be created by Oracle when the table is created and will be named at that time.
    It is up to the Sql Dev team to decide whether to deal with that issue and how to deal with it.

  • How to save and retrieve an excel file as an object into lob column?

    Hi ,
    I need to save and retrieve the whole excel file with 3 or more sheets as an object into the lob column of table.
    For example:
    t_docments
    (doc_id number,
    excel_data clob
    All excel files need to be saved to excel_data column.
    What should I do?
    Thanks

    Did you check the asktom thread posted by Jens?
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P1
    1_QUESTION_ID:232814159006
    There's example of varies file types.Yes, I did try some examples.
    Those work for .doc/.pdf/.jpg files, BUT NOT for excel file.
    The following error happened when retrieving excel file(retrieving .doc/.pdf are OK)
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 375
    ORA-06512: at "SYS.UTL_FILE", line 990

  • EXP/IMP..of table having LOB column to export and import using expdp/impdp

    we have one table in that having colum LOB now this table LOB size is approx 550GB.
    as per our knowldge LOB space can not be resused.so we have alrady rasied SR on that
    we are come to clusion that we need to take backup of this table then truncate this table and then start import
    we need help on bekow ponts.
    1)we are taking backup with expdp using parellal parameter=4 this backup will complete sussessfully? any other parameter need to keep in expdp while takig backup.
    2)once truncate done,does import will complete successfully..?
    any SGA PGA or undo tablespace size or undo retention we need to increase.. to completer susecfully import? because its production Critical database?
    current SGA 2GB
    PGA 398MB
    undo retention 1800
    undo tbs 6GB
    please any one give suggestion to perform activity without error...also suggest parameter need to keep during expdp/impdp
    thanks an advance.

    Hi,
    From my experience be prepared for a long outage to do this - expdp is pretty quick at getting lobs out but very slow at getting them back in again - a lot of the speed optimizations that may datapump so excellent for normal objects are not available for lobs. You really need to test this somewhere first - can you not expdp from live and load into some test area - you don't need the whole database just the table/lob in question. You don;t want to find out after you truncate the table that its going to take 3 days to import back in....
    You might want to consider DBMS_REDEFINITION instead?
    Here you precreate a temporary table (with same definitiion as the existing one), load the data into it from the existing table and then do a dictionary switch to swap them over - giving you minimal downtime. I think this should work fine with LOBS at 10g but you should do some research and see if it works fine. You'll need a lot of extra tablespace (temporarily) for this approach though.
    Regards,
    Harry

  • Importing multiple jpeg files from local folder into database LOB column

    I have to programatically save multiple pictures (jpeg) from the folder on my PC into Oracle table LOB column. I have to be able to choose local folder on my PC where are the pictures, and press button on Oracle Forms to save pictures in LOB column in database.
    I'm using Forms 6i and Oracle 10g Rel2 database.
    Is this possible with Oracle Forms or the only way to do that is to use create directory database command and use dbms_lob package which I shouldn't do, because Oracle database directory is not allowed to see my local folder.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • Lob column compraisions

    Comparing LOB columns between two tables. I have 8000 rows of data in two tables.
    below query I have executed in sqlplus.
    SELECT sql_key, TO_CHAR(sql_query) FROM sql_queries_table1
    MINUS
    SELECT sql_key , TO_CHAR(sql_query) FROM sql_queries_table1;
    ERROR at line 2:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 7766, maximum: 4000)
    can any one tell me what is the procedure to compare lob columns

    DBMS_LOB.Compare.
    Regards,
    Dima

  • Best way to move LOB between database

    I am using Oracle 10.2.0.4. Please share your experience what is the best to move LOBs between databases. Lob size is 40 gb. I have tried using data pump, and parallel insert with nologging but it is taking almost 1 hour to transfer 1 gb.
    Thanks for any suggestion.

    N Gasparotto wrote:
    For data pump I am using impdp over network_link .Would be much more efficient to copy the file accross the network and then run impdp locally. Did you also tried also parallel impdp ?
    Nicolas.Thank I will be trying your suggestion to move the copy. Currently do to space issue I cannot try it but I have already requested for the designated mount point.
    I tried using parallel hint. Our sever had 8 cpu so I tried parallel 16. Although current parallelism was 16 ,
    worker parallelism was 1. They were only 2 workers and other worker was always waiting. In other words, the two workers did not execute simultaneously. So, I guess data pump did not run parallely.
    Should not more than one worker be executing simultaneously for it to run parallel? I did not understand what worker parallelism meant?

  • Exporting lob columns...???

    Is there any limitation of exporting LOB columns from client machines. If the client's export version is lower/greater, then is it going to affect the export of lob columns?

    That's a bug. And even if the structure of the version you are dealing with is compatible, the functionality isn't. I suggest you to apply a patch to the client too.
    Cause
    This problem during export has been introduced with the 9.2.0.5 patchset. In that patchset, a fix has been included for Bug 2948717 "Queries against DBA_SEGMENTS can be slow accessing BYTES/BLOCKS/EXTENTS columns". Note that this fix has also been implemented in Oracle10g Release 1 (10.1.0.2.0).
    As a result of that fix, an export from the 9.2.0.5.0 or any higher release database (e.g. 9.2.0.6.0 or 10.1.0.4.0) with a lower release export utility, e.g. 9.2.0.4.0 or 8.1.7.4.0 will now produce the EXP-3 error. For details see:
    Bug 3593227 "EXP-3 WHEN EXPORTING A TABLE WITH MORE THAN 1 EXTENT USING EXP BELOW 9.2.0.5"
    Bug 3784697 "EXPORT OF LOB FROM 9205 WITH PRE-9205 EXP GIVES EXP-3 (NO STORAGE DEF FOUND)"
    These bugs were closed as a duplicate of:
    Bug 3291851 "EXP-3: NO STORAGE DEFINITION FOUND FOR SEGMENT" (not a public bug)
    Solution
    The EXP-3 error only occurs when the export from the 9.2.0.5.0 or any higher release database (e.g. 9.2.0.6.0 or 10.1.0.4.0) is done with a lower release export utility, e.g. 9.2.0.4.0. The reason to run an export from a 9.2.0.5.0
    or any higher release database (e.g. 9.2.0.6.0 or 10.1.0.4.0) with a 9.2.0.4.0 export utility, is to import the export dump file later into a target database of that lower release.
    Note: if your intention is to export from a 9.2.0.6.0 database in order to import (back) into a 9.2.0.6.0 target database, there is no need to use a pre-9.2.0.5 release export utility. In that situation use the 9.2.0.6.0 export utility.
    Workaround 1
    Rerun the export and specify the parameter COMPRESS=Y (this is the default value for COMPRESS).
    If you have a table with a secondary object, e.g. a LOB column, then this workaround might not work and you will re-produce the EXP-3 error during export. In that case, use workaround 2.
    Workaround 2
    a. Make a note of the export definition of exu9tne from $ORACLE_HOME/rdbms/admin/catexp.sql
    b. Copy this to a new file and add:
    "UNION ALL select * from sys.exu9tneb"
    to the end of the definition
    e.g. In the 9.2.0.5.0 or any higher release source database (e.g. 9.2.0.6.0 or 10.1.0.4.0), the workaround view would be:
    CREATE OR REPLACE VIEW exu9tne (
    tsno, fileno, blockno, length) AS
    SELECT ts#, segfile#, segblock#, length
    FROM sys.uet$
    WHERE ext# = 1
    UNION ALL
    SELECT * from sys.exu9tneb
    c. Run this as the SYS user (!) against the database that needs to be exported.
    d. Re-run the export as required.
    e. Put back the original definition of exu9tne as obtained in step a.
    Note: only use this workaround when absolutely necessary, and don't forget to put back the original definition of the view SYS.exu9tne as mentioned in step e.

  • Questions on Lob-Columns

    Hi,
    i´m working still along time with Oracle, but not very often with Lob-Types.
    The docs and metalink didn´t helped me very much with the following questions:
    1. What is the maximum length of a CLOB Datatype in PL/SQL (long ago it was 32767 Bytes, but now (10.2) ?)
    2. Is empty_blob()/empty_clob() still necessary in 10.2? or when do i use it?
    3. What is the maximum length of a pl/sql clob datatype when i update a clob column in a table?
    declare
    c clob;
    begin
    c:=.......... very long;
    update t set col=c where id=1;
    end;
    4. Does a select in pl/sql return a locator or the data ob the lob (If locator, is there a easy way the read the contents of a clob without dbms_lob.read?)
    5. Is there dbms_lob Package faster/better/??? then using insert/update/delete direct on the column?
    Thanks
    Marco
    Message was edited by:
    mpatzwah

    You may find the following link useful:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#sthref173
    E.g., search for CLOB yields:
    CLOB objects can store up to (4 gigabytes -1) * (the value of the
    CHUNK parameter of LOB storage) of character data.
    If the tablespaces in your database are of standard block size,
    and if you have used the default value of the CHUNK parameter
    of LOB storage when creating a LOB column, then this is
    equivalent to (4 gigabytes - 1) * (database block size).
    CLOB objects have full transactional support. Changes made
    through SQL, the DBMS_LOB package, or the Oracle Call
    Interface (OCI) participate fully in the transaction.
    CLOB value manipulations can be committed and rolled back.
    However, you cannot save a CLOB locator in a PL/SQL or
    OCI variable in one transaction and then use it in another
    transaction or session.

  • Storage of Java object in table column

    Hello,
    We have developed an application that requires some Java objects to be stored in tables.
    With JDataStore, Cloudscape or InstantDB the operation is rather straightforward. We can use something like:
    pstmt = conn.prepareStatement("INSERT INTO TABLEOBJ(ID,OBJ) VALUES (?,?)");
    pstmt.setLong(1,i);
    pstmt.setObject(2,myObject);
    psmt.executeUpdate();
    Some of our clients would like us to use Oracle Lite rather than any of the previously mentioned databases. The only problem is that the above simple code does not work with Oracle.
    What is then the easiest way to save Java Object in table column?
    Thanks in advance,
    Benoit Marchal

    found part of the answer in another newsgroup.
    But is Oracle Lite 4.0 offering the same possibility? Is it going to be implemented in Oracle Lite 5.0?
    Benoit
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alexander Day ([email protected]):
    Another little tidbit from ORacle's documentation:
    "Important: The JDBC 2.0 specification states that PreparedStatement methods setBinaryStream() and setObject() can be used to input a stream value as a BLOB, and
    that the PreparedStatement methods setAsciiStream(), setUnicodeStream(), setCharacterStream(), and setObject() can be used to input a stream value as a CLOB. This
    bypasses the LOB locator, going directly to the LOB data itself. In the implementation of the Oracle JDBC drivers, this functionality is supported only for a configuration using an 8.1.6 database and
    8.1.6 JDBC OCI driver. Do not use this functionality for any other configuration, as data corruption may result."<HR></BLOCKQUOTE>
    null

  • Copying objects from pm to pm, relations

    Hi
    We want to copy some data from a relational database to a Versant database
    using Kodo JDO. The basic approach is to read some objects, detach them
    from the relational PM, and attach them to the Versant PM.
    Because the database is BIG, letting JDO take care of the relations is not
    feasible, this would take too much memory. Doing the copy process in small
    bytes won__t work either, since this will result in double entries in the
    target database for tables like __country__ (same value, different oid).
    So we are now thinking of another approach. We want to read and write the
    tables one by one, without making relations between objects. After copying
    to Versant, we will run queries there for all relations using the key
    fields (that we will have mapped as simple values).
    When trying to do this, we ran into this problem: if we include in our
    Java class fields for the relationship objects, Kodo will complain there
    is no mapping for them when reading from the relational db.
    One solution I have come up with is to declare these fields transient,
    copy the data to Versant, then change the Java code and Versant schema to
    make them non transient. Very cumbersome and not straightforward to
    automate.
    Another solution is to describe all the mappings in the JDO files, and
    make sure the fields are not in the default fetch group. But this is a lot
    of work, especially since we then don__t use the relations at all !
    Is there another solution to this, a sort of mapping that we can use both
    in the relational case (there it would be a sort of null mapping) and the
    Versant case ?
    Regards, Luc

    luc wrote:
    Another solution is to describe all the mappings in the JDO files, and
    make sure the fields are not in the default fetch group. But this is a lot
    of work, especially since we then don__t use the relations at all !By default, relations are not in the dfg.
    Is there another solution to this, a sort of mapping that we can use both
    in the relational case (there it would be a sort of null mapping) and the
    Versant case ?In the Kodo mapping information, you can set a persistent field to use a
    'none' mapping:
    <jdbc-field-map type="none"/>
    That might do what you're looking for.
    -Patrick

  • Add columns to a table with lob column

    Hi,
    Just a quick question: is there a performance penalty after adding columns to a table with a lob fied? the lob field is now the last column in the table and via via I was told that adding columns will impact badly the IO performance on the table if the lob field isn't anymore the last column. The table is on a Oracle 10.2.0.3 version.
    thanks. regards
    Ivan

    Havent heard of performance degradation specifically due to a LOB column not being the last column in a table (although there are several issues with just having a LOB column in a table).
    You may want to build a test database to test it out. It should be easy to run tests comparing one with the additional column and one the original to prove or refute it. The results would be interesting to learn - please post them up if you intend to test it out.

  • Data synchronization between databases

    Hi,
    This week one of my team accidentally damaged multiple records in one of the production databases, I have a backup of the database prior to what happened.    I need to copy the information in a few tables from the beginning of records (about 10 years ago), to the end of August 2014.   The newer records should remain as they are.
    I was thinking that the best route is to use some sort of tool to synchronize data between databases.
    Do you guys have a recommendation for this sort of work? 
    The databases (production and backup) are ASA 9.
    Best regards,
    Edgard

    Hello Edgard,
    If you have any PowerBuilder in-house the Data Pipeline object might help. Otherwise I'd have a look at Squirrel SQL. I know that can communicate between two databases simultaneously but confess I have never tried it.
    Paul

  • Protected memory exception during bulkcopy of table with LOB columns

    Hi,
    I'm using ADO BulkCopy to transfer data from a SqlServer database to Oracle. In some cases, and it seems to only happen on some tables with LOB columns, I get the following exception:
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at Oracle.DataAccess.Client.OpsBC.Load(IntPtr opsConCtx, OPOBulkCopyValCtx* pOPOBulkCopyValCtx, IntPtr pOpsErrCtx, Int32& pBadRowNum, Int32& pBadColNum, Int32 IsOraDataReader, IntPtr pOpsDacCtx, OpoMetValCtx* pOpoMetValCtx, OpoDacValCtx* pOpoDacValCtx)
    at Oracle.DataAccess.Client.OracleBulkCopy.PerformBulkCopy()
    at Oracle.DataAccess.Client.OracleBulkCopy.WriteDataSourceToServer()
    at Oracle.DataAccess.Client.OracleBulkCopy.WriteToServer(IDataReader reader)
    I'm not sure exactly what conditions trigger this exception; perhaps only when the LOB data is large enough?
    I'm using Oracle 11gR2.
    Has anyone seen this or have an idea how to solve it?
    If I catch the exception and attempt row-by-row copying, I then get "ILLEGAL COMMIT" exceptions.
    Thanks,
    Ben

    From the doc:
    Data Types Supported by Bulk Copy
    The data types supported by Bulk Copy are:
    ORA_SB4
    ORA_VARNUM
    ORA_FLOAT
    ORA_CHARN
    ORA_RAW
    ORA_BFLOAT
    ORA_BDOUBLE
    ORA_IBDOUBLE
    ORA_IBFLOAT
    ORA_DATE
    ORA_TIMESTAMP
    ORA_TIMESTAMP_TZ
    ORA_TIMESTAMP_LTZ
    ORA_INTERVAL_DS
    ORA_INTERVAL_YM
    I can't find any documentation on these datatypes (I'm guessing these are external datatype constants used by OCI??). This list suggests ADO.NET bulk copy of LOBs isn't supported at all (although it works fine most of the time), unless I'm misreading it.
    The remaining paragraphs don't appear to apply to me.
    Thanks,
    Ben

Maybe you are looking for

  • MBP thunderbolt display problem

    I have MBP 13" retina display running 10.10.2 (14C109). I use both the thunderbolt port for external monitor, when i lock display and wake it up, one or both external monitors go grainy(like this tv with out cable). I have to re-connect thunderbolt p

  • Error in SOAP sender CC. Channel stopped by administrative task.

    I am getting an error in my SOAP sender communication chanel as follows; com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: Channel stopped by administrative task. The channel is Active

  • Messed up Zen To

    my zen touch froze on a song so i turned it off. Then when turning it back on it would not change from the "Zen Touch" start up screen so i did a disk clean up and still nothing happen. Well one thing did, it started making a funny noise. i then trie

  • How to design a flex app so that it loads fast

    hi, i was gonna make a large CRM+ERP app in flex and was worried it would take a long time to load as even the smallest examples on various sites take quite a bit of time to load (quite a lot more than simple flash apps, why ??). i was thinking of br

  • Un-deletable item?

    Hi, I've got an empty folder in my recycle bin which contains another empty folder. When I try and "empty trash" it says I don't have enough rights or privileges...any ideas what this means? I'm the only user of this iMac. Cheers.