Sybase TEXT to Oracle CLOB migration

Hi All,
We are doing the migration from Sybase to Oracle 10g.
Migration steps include..
1. Creation of Oracle staging area similar structure as Sybase database.
2. Extract the data through BCP
3. Import to oracle by Sqlldr (sql loader)
But we have problem in migrating the SYBASE TEXT column into ORACLE CLOB, as Sqlldr ( sql loader) can load clob column only 500 bytes, unless we are not using LOBFILE clause.
To use LOBFILE clause, we have to create "Secondary Data file " , But BCP have limitation. It is not supporting custom query to generate CLOB column data file.
Help me in resolving this issue.

umesh chandru wrote:
To use LOBFILE clause, we have to create "Secondary Data file " , But BCP have limitation. It is not supporting custom query to generate CLOB column data file.As I understand it, the core issue is that SQL*Loader wants you to point it to the file containing the CLOB to load. While BCP puts the TEXT/CLOB inline in what is essentially a BCP produced CSV file.
Now this is a problem. As the CLOB can contain all kinds of formatting, including end-of-CSV-row characters, special characters and so on, it can easily render the format of that CSV file useless.
SQL*Loader expects a CSV file where the CLOB column contains a filename to load - and where that file contains the contents of the CLOB. With this approach there is no issues dealing with complex file formatting rules in trying to load the CLOB as a part of a CSV file.
So extract the data in this format - do not restrict yourself to the limitations of BCP. That TEXT column must have a PK column (or two). Write a script that extract the TEXT into a default directory, creating a file that is uniquely identified by the PK.
Extract the rest of the table's content (using BCP for example) into CSV format. Now you have the data in the two parts (CSV file and separate CLOB files) that SQL*Loader expects. Create the appropriate control file and load the data. This should not be that complex to do.

Similar Messages

  • Problems with Sybase 12 to Oracle 10g migration

    Hi,
    I'm using SQL Developer to test a migration between Sybase and Oracle and it doesn't work (both online and offline)
    I've create a dedicated user account and connection, with the roles and privileges required (as seen in http://download.oracle.com/docs/cd/B32485_01/doc/appdev.110/b31695/migration.htm#i1005739)
    I've created the migration repository without any problems (using the above user account).
    QUICK MIGRATION
    - select the source Sybase connection: OK
    - select the target Oracle connection: OK
    - select the referential: OK
    - verify privileges before migration: OK
    - migrate tables only and click Next
    ## window closes and nothing happens ## - nothing on Captured Model pane
    CAPTURE SOURCE SYBASE DATABASE
    - right click on the Sybase connection in the Connections pane
    - choose Capture Sybase
    ## window closes and nothing happens ## - nothing on Captured Model pane
    OFFLINE CAPTURE
    - create database capture scripts: OK
    - launch the database scripts (SYB12_OFFLINE_CAPTURE.BAT): OK
    - load database capture script output (sybase12.ocp)
    ## window closes and nothing happens ## - nothing on Captured Model pane
    I can't find any relevant logs or trace from the application.
    I even tried to use the capture file sybasemigration.zip from the "Migrating a Sybase Database to Oracle Database 11g" web page (http://www.oracle.com/technology/obe/hol08/sqldev_migration/sybase/migrate_sybase_otn.htm), but the result was the same.
    Does anyone encountered the same problems? Does someone knows where are the logs (if any)?
    Thanks in advance.
    Regards,
    Pedro

    Hi Pedro,
    What version of SQL Developer are you using?
    Can you browse your Sybase connection in SQL Developer, to see its tables for example?
    If not, then you may need to point SQL Developer to your JTDS 1.2 driver again.
    Are you capturing a non system database ? SQL Developer wont migration master or tempdb ...
    Can you try running SQL Developer from the command line and watch the command line for any errors during the capture.
    \sqldeveloper\bin\sqldeveloper.exe
    Regards,
    Dermot
    SQL Developer Team

  • Migrating Sybase code to Oracle 11g

    Hi All,
    We have to migrate Sybase code to Oracle 11g.
    When we are doing a SELECT .. INTO in Sybase , even if the query is returning more than 1 row , sybase selects 1 of the rows and populates the variables.
    But while migrating this code to oracle, we are getting TOO_MANY_ROWS Exception.
    We need to migrate the code from SYBASE to ORACLE without disturbing the logic.
    Can someone please tell me the logic applied by SYBASE to pick up the record?
    And if someone has faced this issue, then what can be done to resolve this.
    Regards,
    Riddhisha Khamesra

    The result 3 is the last entered record (not the amount of records..).
    So the first approach to write a dummy procedure that will select all records in Oracle like:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    FROM tt_tmp ;
    END;
    and hopefully returns only the last record will fail with:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    BEGIN last_record (:outvar); END;
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "SYSTEM.LAST_RECORD", line 9
    ORA-06512: at line 1
    One possible approach to get the last (and only the last) record that was entered into the table is to use rownum:
    The select might look like "select col1 from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;"
    So the procedure can be coded as:
    CREATE OR REPLACE PROCEDURE last_record
    v_arg1 OUT NUMBER
    AS
    BEGIN
    SELECT col1
    INTO v_arg1
    from (select col1, rownum from tt_tmp order by rownum desc) where rownum=1;
    END;
    Now calling it in SQL*Plus:
    SQL> variable outvar number
    SQL> exec last_record (:outvar)
    PL/SQL procedure successfully completed.
    SQL> print :outvar
    OUTVAR
    7
    The value 7 is the last record I've inserted into my tt_tmp table:
    SQL> select * from tt_tmp;
    COL1 COL2
    1 1
    2 2
    8 8
    7 7

  • Migration from sybase 11 to Oracle 9i

    Hi,
    I have to migrate all db objects (tables structures,table data,triggers,sp) from Sybase 11 to Oracle 9i
    There are currently two free tools -
    Migration workbench (http://www.oracle.com/technology/tech/migration/workbench/index.html )
    and
    SQL Developer( http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html )
    for this purpose.
    SQL developer has a provision to convert scripts which I can use for SPs and scripts one @ a time.
    Problem is migrating table structures along with data.
    from SQL developer I can't connect to sybase thou I provide all the details and from workbench in the online mode I need the sa login which is not possible as the database is live and @ client side.
    SQL Loader can be used but will require to make CSV files from each sybase table and hence is time consuming.

    Hi,
    Migration Workbench is not available for Sybase database.
    As you can see on this website:
    http://www.oracle.com/technology/tech/migration/workbench/files/mig_rel10104.html
    Only Informix and DB2 database are supoprted now with this product.
    With SQL Developer, we only support last versions of Sybase : V12 and V15.
    As you don't have any remote access to your client database and no SA login , the best way would be :
    ==>to get and export from Sybase 11.
    ==>install a V12 somewhere (on your site , you can download the Sybase V15 )and import the Sybase database
    Then SQL developer can migrate quickly your database without any problem.
    I hope it helps you.
    Mireille

  • Migrating table from Sybase 12 to Oracle 10g

    Hi ,
    We have a situation where we have to migrate multiple Sybase databases to Oracle10g . These multiple database have same set of tables but different data in these tables on each sybase database ( data differ, based on location or region wise but same table name and structure). We want to migrate all these sybase database to Oracle 10g and in single database, which involves inserting data from multiple tables ( though they exist on different database in sybase) into single Oracle table.
    for example if we have a table 'TESTK' that exist on five different sybase database but with different region wise data. I want to bring data from these five tables( Five as they exist in five differet sybase databases) and insert them into a single oracle table 'TESTK' .
    Have anybody ever face such scenerio , what are all possible approch please suggest. Once data is inserted into oracle table i need to partitioned this oracle table as well.

    It is not quite clear whether you have multiple tables (referencing each other) in multiple sybase databases or either one table or several non connected tables in multiple sybase databases.
    In the first case of course your task is harder because you need to keep references and most probably you cannot blindly copy data from db 1, db 2 and unite them because they can have the same id's coming from different sources.
    In the second case your task of course is much easier you can simply load all your data in Oracle tables either using some interim tables (if you need to filter out duplicates) or load data straight into target tables if you are sure you haven't duplicates.
    Also another question in case 1 is whether intersection of your data is 0 rows i.e. all data are completely different in each source db or not.
    So I'm sure you can find tools for blindly moving data from sybase to Oracle, although if you need to do some more complex filtering, computation or whatever you most probably need to write it yourself.
    I'v done a few data conversion projects from one schema to another and as the requirements were quite complex the only possibility for us was to initiate a separate data conversion project and create conversion software (pl/sql packages manually).
    You can find an overview of our approach in my article "Data migration from old to new application: an experience" here http://www.gplivna.eu/papers/legacy_app_migration.htm
    Gints Plivna
    http://www.gplivna.eu

  • Migration from Sybase 11 to Oracle 8i

    I am trying to migrate a Sybase DB to Oracle 8i. The platform of Sybase system is VMS and Oracle is UNIX. Can I use workbench to migrate between two different platform?
    If not, is it the only way to export sybase to a flat file and then load to Oracle using SQL loader?
    Thanks

    Hi,
    Migration Workbench is not available for Sybase database.
    As you can see on this website:
    http://www.oracle.com/technology/tech/migration/workbench/files/mig_rel10104.html
    Only Informix and DB2 database are supoprted now with this product.
    With SQL Developer, we only support last versions of Sybase : V12 and V15.
    As you don't have any remote access to your client database and no SA login , the best way would be :
    ==>to get and export from Sybase 11.
    ==>install a V12 somewhere (on your site , you can download the Sybase V15 )and import the Sybase database
    Then SQL developer can migrate quickly your database without any problem.
    I hope it helps you.
    Mireille

  • SQL Server Long Text column to Oracle CLOB via DB Link

    Does anyone know how to load a SQL Server Long Text column into an Oracle CLOB column using DB Link? When I try to Select from SQL Server table into Oracle table, I receive the error "ORA-00997: illegal use of LONG datatype".
    Thanks,
    Susan

    Hi,
      This is a known restriction involving long columns -
    (1) LONG datatype not supported with use of DBLINK when insert or update involves a select statement
    (2) LONG datatype cannot be used in a WHERE clause, in INSERT into ... SELECT ... FROM
    constructs, and in snapshots.
    The workround is to use a PL/SQL procedure or try the SQLPLUS COPY command.
    If you have access to My Oracle Support then review these notes -
    Cannot Move A Long From non Oracle database Ora-00997: Illegal Use Of Long Datatype (Doc ID 1246594.1)
    How To Workaround Error: Ora-00997: Illegal Use Of Long Datatype (Doc ID 361716.1)
    Regards,
    Mike

  • Error converting SQL Server text field to Oracle CLOB

    I am trying to convert an SQL Server DB to Oracle DB using DB link. The issue I am facing is one of the SQL Server table contains text field and we are trying to convert the text field to CLOB.
    The error I am getting is "SQL Error: ORA-00997: illegal use of LONG datatype"
    The statement is something like this.
    Insert into oracle_table
    Select col_1,col_2,col_3,col_4,col_5 from sql_table@sqldblink;
    Please help.

    Hi,
      This is a known restriction involving long columns -
    (1) LONG datatype not supported with use of DBLINK when insert or update involves a select statement
    (2) LONG datatype cannot be used in a WHERE clause, in INSERT into ... SELECT ... FROM
    constructs, and in snapshots.
    The workround is to use a PL/SQL procedure or try the SQLPLUS COPY command.
    If you have access to My Oracle Support then review these notes -
    Cannot Move A Long From non Oracle database Ora-00997: Illegal Use Of Long Datatype (Doc ID 1246594.1)
    How To Workaround Error: Ora-00997: Illegal Use Of Long Datatype (Doc ID 361716.1)
    Regards,
    Mike

  • Sybase ASE to Oracle Database 11g Migration

    Hi,
    I am looking for documentation on migration from Sybase ASE to Oracle Database 11g Migration.
    Front End application is Peoplesoft.
    Please suggest documentation on the same.
    I look forward to you reply.
    Best regards
    Sonali

    Have a look at the SQL Developer tool:
    Oracle SQL Developer</title><meta name="Title" content="Oracle SQL Developer"><meta n…
    It contains a migration utility which allows you to migrate foreign databases to Oracle:
    Database Migration Technology</title><meta name="Title" content="Database Migration Technology&q…
    Documentation and videos are available from the migration wbe page.
    - Klaus

  • Sybase 4.x to ORACLE 7 migration

    I am trying to use your Sybase 4.x to ORACLE 7 migration
    toolkit, and found out that one file is missing under
    /convkit/sybase/chkdupnms/ after I unzip the downloaded
    sybase4x_tar.z. The missing file is DUPNMS_RPT. On your
    conversion guide, it said that this file should be there. Did I
    missing something? Is it necessary to have this file? If it's
    so, how do I obtain this file? I'd appreciate your reply ASAP.
    Thanks.
    null

    Hi Ann,
    I think this file checks for duplicate names. You may be able to
    work without it.
    You may have to perform some manual steps to overcome name
    collisions if they occur, but these are usually straightfoward.
    Regards
    John
    Ann (guest) wrote:
    : I am trying to use your Sybase 4.x to ORACLE 7 migration
    : toolkit, and found out that one file is missing under
    : /convkit/sybase/chkdupnms/ after I unzip the downloaded
    : sybase4x_tar.z. The missing file is DUPNMS_RPT. On your
    : conversion guide, it said that this file should be there. Did
    I
    : missing something? Is it necessary to have this file? If it's
    : so, how do I obtain this file? I'd appreciate your reply
    ASAP.
    : Thanks.
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Sybase 11 - Oracle 8 Migration

    Hey looking for documentation that covers Sybase 11 to Oracle 8 conversion for HP-UX environment. If its on CD can you direct me to where to purchase it and its part number?
    Thanks

    Here are some links that might help:
    OTN's Oracle Migration Workbench Home Page
    http://otn.oracle.com/tech/migration/workbench/content.html
    Oracle Migration Workbench Support Page
    http://otn.oracle.com/support/tech/migration/workbench
    OTN Migration Workbench Discussion Forum
    Database and Application Migrations
    Regards,
    -rh

  • Loading multiple text files from a folder into oracle clob field

    I would like to load about 300 word documents into a oracle clob field with each document inserted as a separate record.
    I'm not quite sure how to go about doing this. Is there a utility in oracle that would do this?
    I've looked at sql loader and utl_file but both require the name of the file. Is there a way I can do this?
    If its not possible using just oracle, does anyone know how I can do this in combination with perl?
    Many Thanks
    Sam

    I have no experience with this, but pl see if MOS Doc 73787.1 (How to Read A Binary File into BLOB Using PL/SQL) can help.
    Essentially, you will have to write code to loop thru all 300 files to load them into the database
    HTH
    Srini

  • Sybase NULL to Oracle - Error with Fail

    Hi,
    We are doing migration from Sybase 12 to oracle 9i using Oracle Migration Work Bench . Though we are able to successfully perform the migration , with all object count matching once migrated. When we launch our peoplesoft application on top of the migrated database and start browsing thru it, it throws up error like “Error: PS_ABSENCE_HIST - Alter failed due to an unknown column type (CLOB) found for field COMMENTS. (76,22)”. Though the actual datatype value of this column in Sybase is text and when we try to migrate it defaults to CLOB.
    The same we try to migrate thru peoplesoft provided tool datamover, the column datatype is LONG. But now we mapped the datatype value of text to long and started migrating . At this point, where Sybase value is NULL, Oracle Migration Work Bench is not able to insert data for such value.
    Any idea of how to resolve this issue.
    [email protected]

    venuhi,
    At this point, where Sybase value is NULL, Oracle Migration Work Bench is not able to insert data for such value.There is a difference between sybase and oracle in terms with dealing with nulls, in oracle an empty string is null. The workbench can be configured to put a string in place of a null, such as a single space.
    What specifically is going wrong for you in your use of the workbench, is it replacing null with a single space, or is the tool stopping, and if the tool is stopping, what is the output of the error on the screen and the results of Error.log file. Enough details should be available to write a reproducible testcase and log a bug.
    Regards,
    Turloch
    Oracle Migration Workbench Team.

  • Oracle Database Migration Verifier - Can it be used for diff table structur

    Hello,
    We have re-engineered the existing sybase tables to a new structure in Oracle for few of the tables.For example a table in sybase is normalized to two tables in oracle.In these cases can the "Oracle Database Migration Verifier" be mapped such that the columns in one table in sybase be mapped to two table is Oracle with their respective column names.
    In a gist can the tool be used even if the structure is not the same in the source and targer databases.
    Please let me know if you need more clarifications regarding my query.
    Regards,
    Ramanathan.K

    not really. The DMV was a simple tool for verifiying that what you now had in Oracle was what you had in Sybase. It does not do what you are expecting.
    B

  • Sybase Timestamp in Oracle

    Hi,
    I am in the process of migrating Sybase database to oracle 10g.
    In Sybase there is a column exist in most of the tables with datatype Timestamp, the data looks like 0x467469786abfc324, this is automatically generated while inserting or updating a table.
    Is this equivalent to rowid in Oracle? or please suggest a equivialent solution in oracle.
    Thanks,
    DJ

    Yes. The Sybase Timestamp is essentially a surrogate row identifier and should not be moved into Oracle.
    In Oracle, especially with newer technologies such as Advanced Compression, we enable and expect row movement so it is rowids
    should not be treated as static. If you need a surrogate key then create a SEQUENCE object and use that to generate the surrogate key.

Maybe you are looking for

  • Could someone help me please

    I am doing a piece of code in RMI here is what i have come up with up to now: public class cipherimpl     extends java.rmi.server.UnicastRemoteObject     implements cipher {     public cipherimpl()          throws java.rmi.RemoteException {         

  • Having multiple issues with my MacBook Pro

    I have a MacBook Pro that I purchases new January 2013. I upgraded from Mountain to Maverick about 2 months ago, with no problems. About 3 days ago it started acting up. It started with my not being able to open Safari, although a few hours later I c

  • Itunes dosent recognise iphone 4s

    trying to sync phone with pc to transfer music but itunes dosent recognise phone tried uninstall ing itunes and reinstall  still no joy

  • I know how to convert wma files into aac but the itunes program messed all my album how can i fix that

    When i convert my wma files and put them into my itunes program it converts them automaticly but it mess up all my albums it split albums and it put lonely song here and there and i cannot put them back were they bellong...why it does that ? How can

  • Dependencies Disabled

    Hello DBAs We use 9.2.0.1.0 on W2K. I am having trouble transferring data from one table to another using SQL statements and MS batch files. These procedures worked correctly in the past (or so I am told) but one does not work now. If I check DBA_Tab