Migrating a Sybase Index with ignore_dup_key

HI All,
I am involved with Sybase to Oracle migration.
I need to migrate a Index with ignore_dup_key.
I am currently inserting the data into the table and then deleting the duplicate enteries.
Can someone suggest me a better approach..
Thanks,
Riddhisha
Edited by: Riddhisha on Apr 13, 2012 3:18 PM

I think there is some confusion around ignore_dup_key functionality. Ignore_dup_key in Sybase essentially allows an application to continue without aborting a on-going transaction even if there was an attempt to insert duplicate values for columns that have a Unique index on them with ignore_dup_key clause. But (I emphasize) Sybase does not allow duplicate values in a column on which a unique index exists.
Typically when you try to insert duplicate values for columns with unique/primary indexes, you get a "unique constraint violation error". This error under normal conditions will result in the failure of the complete transaction. With IGNORE_DUP_KEY clause, the sybase database simply ignores that "INSERT/UPDATE" statement and continues with the rest of the transaction.
What that means is if you have a index on a table in Sybase with Ignore_dup_key clause then most likely that index is a UNIQUE index. So that means you shouldn't see duplicate values in the affected column(s). If you do see duplicate values then the implication is that the index is not a UNIQUE index and hence IGNORE_DUP_KEY clause does not really add value. Customer may have changed their schema design later realizing that those columns will have duplicate values but forgot to take out the IGNORE_DUP_KEY clause. Also if you already have duplicate values for a column, you cannot create a UNIQUE index even in Sybase with this clause.
Since you are seeing duplicate values in the table so I am guessing that it is a regular B*tree index so you can do the same in Oracle and ignore the IGNORE_DUP_KEY clause as Oracle does not offer such functionality.
If you really want to create a unique index in Oracle and not have the duplicate values then you will have to try couple of different approaches. Create an External table and use PL/SQL procedure/function to load the data using MERGE statements or INSERT INTO... SELECT FROM EXTERNAL_TABLE with the LOG ERROR Clause to reject the duplicate values without failing the overall data load.
Hope this helps..
Regards
Prakash

Similar Messages

  • SQL 2012 database behaves differently with a unique index and ignore_dup_key = on when inserting data. It works on SQL 2008 db

    If you have a table with a unique index and ignore_dup_key = on and you INSERT rows into that table with an ORDER BY clause (because you want to control which of the duplicate
    key rows gets inserted),  the wrong row gets inserted in SQL2012.  It works correctly in SQL 2008.
    We have recently migrated  a database from SQL 2008 to SQL 2012.  We do have few other dbs which are in compatability mode 100.  The above operation works fine
    in SQL 2008 dbs but not SQL 2012.
    I've even tried applying the latest patch for SQL 2012 SP2 with CU2. Still the problem exists.  I'm going to call MS support, but want to know if anyone has come across this problem ?

    The MS documentation doesn't guarantee that the first row of the duplicates will always be inserted and the next duplicate row(s) get(s) ignored. Where did you find it in the MS documentation? I think you were just lucky that it was always inserting the
    first row in SQL 2008 (and ignoring the rest of the duplicates) - I don't think this is guaranteed
    Satish Kartan http://www.sqlfood.com/

  • 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

  • Migration from SYBASE IQ to SYBASE ASE 11/12 and then to ORACLE 10G

    Hi ,
    The OWMB tool does not support migration of SYBASE IQ to ORACLE.So there should be some tool to migrate this SYBASE IQ to SYBASE ASE 11/12.And then which we can migrate to ORACLE which the OMWB supports.Does anybody have any idea about such tool(SYBASE IQ to SYBASE ASE 11/12).
    Thanks With Regards,
    Vinoth

    Vinoth,
    That's correct. However Sybase IQ is normally associated with Data Warehouses. Have you investigated the suitability of using Oracle Warehouse builder to assist with such a migration?
    Ispirer supports migration from Sybase IQ 12 ( http://www.ispirer.com/products)
    Donal

  • 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

  • Migrate peoplesoft sybase HR database to oracle 11g

    Hi All,
    We am looking to migrate from sybase 12 to Oracle 11g. We are not sure on which path to choose for this migration to be done. Ths sybase Database is around 55 GB. Below are few questions. Please let me know. The down time on this database can not be more than 2 days at the max.
    1. What is the best and fastest way to do this, if there is one?
    2. Any Documentation on steps involved in migration?
    3. Do we have to use any 3rd party tools for this?
    4. Can we achieve the data migration with sql loader, if yes is it the suggested way to do this and is there any documentation on this?
    I tried sql developer to do the migration but it did not go well and finally found that it is not the way to migrate a Database with peoplesoft environment, below is the link to explain more about what I have done with sql developer.
    If there is any other information required, below link has almost all the information.
    Re: Migrate peoplesoft sybase HRMS database to oracle 11g
    Thanks
    Kranthi

    1)     Build an Oracle Demo system patched to the same release level as the current production system.
    2)     Launch Application Designer and compare the production system to the demo system so you may capture the modifications.
    3)     Load a custom table with the tables listed in the MVPRDEXP.EXP in the production system. Run a script to create an export script for all PSRECDEFN where the RECTYPE is 0. This identifies all application data tables. You may want to dms export large tables in parallel.
    4)     DMS Import the exported data into the Oracle instance.
    5)     Reapply the modifications.

  • Migrate peoplesoft sybase HRMS database to oracle 11g

    Hi All,
    I want to know if I can migrate a sybase peoplesoft HRMS database to oracle 11g using sql developer 3.0. I am trying to do this following the steps given in the link below but it is taking for ever for the convert step, I could see the messae saying building converted model.
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev/r30/SybaseMigration/SybaseMigration.htm
    The sybase database is 55GB and the version is 12. There are around 20,000 tables in Sybase Database.
    Please advise, if this is possible with SQL Developer??
    If yes, how long this process might take(for each step in the above link), based on any past convertions of the same size database??
    If this is not feasable with SQL Developer because of the complexity of the database, are there any other tools we can look into which might be faster/better than SQL Developer.
    Please advise.
    Thanks..

    Hi Dermot, Tanks for the reply.
    "Do you know the number of views and procedures captured". Below is the ouput from some of the tables in migration repositary.
    count from md_derivatives table, grouped by derived_type.
    MD_CATALOGS     1
    MD_USERS     1
    MD_CONNECTIONS     2
    MD_SCHEMAS     4
    MD_TRIGGERS     40
    MD_VIEWS     34316
    MD_TABLES     48048
    MD_INDEXES     55850
    MD_INDEX_DETAILS     112043
    MD_COLUMNS     766244
    Count from md_views table 34316
    Count from md_additional_properties table 110322
    "Is there a chance the convert phase has hung, or does it refresh ever so ofter with details of another object being "migrated"?"
    It is not hung. I can see the message 'Translating views' right now, and the View names change often but not fast roughly every minute. When I checked for what the session is doing, I could see the below two sql statements.
    SELECT PROP_KEY, VALUE, PROPERTY_ORDER, CONNECTION_ID_FK
    FROM MD_ADDITIONAL_PROPERTIES
    WHERE REF_ID_FK = :1
    ORDER BY PROPERTY_ORDER;
    SELECT ID
    FROM MD_TABLES -- Some times this is MD_VIEWS
    WHERE SCHEMA_ID_FK = :1 AND UPPER (TABLE_NAME) = UPPER (:2)
    "What is the current "Being migrated" information?"
    Translating View xxx.
    "Does the tablespaces your migration repository schema is based on have sufficient space?"
    Yes, Since there is no data at this point, it is all done in one table space which is set to grow UNLIMITED. At this point the size of the table space is a little over 500M.
    "Is SQL Developer being run on the same machine as the Oracle database containing the migration repository? (conversion can be alot quicker for procedure,view,trigger conversion if SQL Developer is on the same machine as the repository)"
    NO. SQL developer is running on my machine but the migration repositary is in the database which is on HP-UX box. Below are some of the details of the server. Also, since the database in on HP-UX, I couldn't find SQL developer for UNIX. I also read in the release note of 3.0 that it is not supported with UNIX, Is that right? else is there a way I can install SQL developer on the Unix server and that might improve the performance!, if yes, please guide me with the steps to do this installation.
    Server:
    Processors: 4, CPU version: PA 8700 CPU module 3.1, clock Frequency: 750MHz, Hardware Model: 900/800/L3000-7x, Kernel width Support 64.
    Physical Memory 8199.3 MB
    Real Memory --> Active: 2990487.0 KB, Total: 3956471.8 KB
    Virtual Memory --> Active: 5787735.5 KB, Total: 6864998.0 KB
    Free Memory Pages: 127049 at 4 KB/page
    Swap Space --> Avail: 4096 MB, Used: 4096 MB, Free: 0 MB
    OS Identification: B.11.11 U
    I see the below when I do a 'glance' on the server. Looks like it is using most of the memory and the Swap. These are the numbers from the server after the migration started, they stay consistent all time with very small variation.
    CPU Util S SR RU U | 34% 31% 39%
    Disk Util F F | 4% 4% 13%
    Mem Util S SU UB B | 93% 93% 93%
    Swap Util U UR R | 86% 86% 86%
    PROCESS LIST Users= 1
    User CPU Util Cum Disk Thd
    Process Name PID PPID Pri Name ( 400% max) CPU IO Rate RSS Cnt
    oraclefap 16560 1 178 oracle 97.9/98.3 132507 0.1/ 0.6 16.0mb 1
    My Machine where SQL Developer is Running
    Windows XP Professional SP3. 2GB Memoery. All this, time I was using around 1 Gb of memory while this process is running, Out of which SQL developer uses only 200 to 300 MB at any given point and the CPU is less than 5%.
    "What version of Oracle database have you installed the migration repository in?"
    Below is the Banner.
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Also please let me know about this request I have popsted. https://apex.oracle.com/pls/apex/f?p=43135:7:2259365896228241::NO:RP,7:P7_ID:29361
    I would greatly appreciate any help. Thanks again.

  • Migration of Sybase 4.9 to Oracle 9i

    Hi
    We need to migrate a Sybase 4.9 Database to Oracle 9i.
    We are in initial research phase and the approach is yet to be decided.
    Any info on tools available and approach will be of great help.
    Regards
    kapil

    Kapil,
    The sqlways product from Ispirer might be a possible solution? I would discuss it with them. This is a very old version of Sybase.
    http://www.ispirer.com/products/
    Donal

  • Migrating from Sybase Anywhere to ASE

    I am in process of migrating from Sybase Anywhere to ASE and trying to import a table from Anywhere to ASE, I getting following error message that could not find appropriate data type for column - now this column from Anywhere has data type of datetime.

    ASE does not have any wizards so you must be using some sort of GUI/tool/application.
    What GUI/tool/application are you using? PowerDesigner? Sybase Central? Sybase Control Center? Something else?
    Can you *connect* to the ASA and ASE instances with this GUI/tool/application? [Forget the 'import' operation for the moment ... and verify you can just *connect* to both ASA and ASE.]
    Also, what is the actual/complete error message?
    NOTE: I don't use GUI/tools so depending on the error there may not be much more I can assist with.

  • Migrating from Sybase 11.9

    Is there an Oracle tool still available for migrating Sybase release 11.9 databases to Oracle? I can't seem to find anything on the Oracle website.
    Thank you,
    Steve

    SQL Developer migration is the latest migration tool Oracle offers to mograte foreign databases to Oracle. Unformtunately it does not cover Sybase ASE 11.9 database releases according to the manual:
    http://www.oracle.com/technology/tech/migration/workbench/pdf/migrationdatasheet_15.pdf
    To migrate a Sybase 11 ASE you might think about using the old Migration Workbench utility:
    http://www.oracle.com/technology/software/tech/migration/workbench/index.html
    The Sybase 11 plugin has been removed from the list of available resources, but it is still available on the download server:
    http://download.oracle.com/otn/nt/omwb/101040/Sybase11.jar
    In addition I've notified develoment if they could implement again a link on the OMWB download page fro the Sybase 11 plugin.
    So you need to get from the Oracle Migration Workbench download URL the common file of OMWB:
    http://download.oracle.com/otn/nt/omwb/101040/omwb.zip
    Extract this ZIP file into a directory of your choice.
    The plugin (make sure you save the file as it is - as a JAR file) into the OMWB Plugin directory and then get from Sybase te jdbc driver jconn2.jar and put the JDBC driver in
    to the OMWB\drivers directory.
    Edited by: kgronau on Nov 10, 2008 10:29 AM

  • Migrate a Sybase 11.5 to Oracle 10.2.0.1

    Trying to use the Oracle SQL Developer 1.5.0.53. I have the Sybase database connected and can view the tables. When I try and run the Quick Migrate it fails in the PreMigration Check on "Locating Source Plugin". I'm have trouble determining what this means. I have looked through documentation and message board. Can somebody please help me.

    Hi,
    the SQL Developer Migration Workbench supports only migrations of Sybase Adaptive Server 12 and 15.
    Please see http://www.oracle.com/technology/tech/migration/workbench/pdf/migrationdatasheet_15.pdf
    You can still use the standalone Migration Workbench (OMWB) for migrations of Sybase Adaptive Server 11 to Oracle RDBMS 9i or 10g (not 11g).
    Please refer to
    http://www.oracle.com/technology/tech/migration/workbench/pdf/omwb_ds.pdf
    Here are more details about OMWB 10.1.0.4:
    http://www.oracle.com/technology/tech/migration/workbench/index.html
    Read the documentation given on that URL before trying anything out.
    Regards
    Wolfgang

  • Migrating from Sybase to Oracle

    Hi!
    Can someone tell me, how to migrate from Sybase to Oracle.
    Thank U.

    Hi,
    You don't say if you have used the SQL*Developer migration workbench for the migration so far.
    This has a feature for transferring data offline which should do what you want.
    Have a look at the documentation linked from -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    or at -
    http://download.oracle.com/docs/cd/E12151_01/index.htm
    SQL Developer User's Guide - section 2.9.1 Transferring the Data Offline
    Regards,
    Mike

  • Experiences migrating from Sybase to Oracle

    Hi all,
    I have been asked to look into migrating a database from Sybase to Oracle.
    I know there is lots of info on Oracle's website, which I have downloaded, but I was just hoping for some info about some of your experiences regarding your processes. What are the gotchas. I suspect there will be a few.
    Anything that will help would be of interest.
    Many thanks
    VicC

    HI VicC,
    I work within the SQL Developer team and not a customer as such, but the follow maybe of use.
    SQL Developer is a migration aid, its not 100% magic bullet.
    SQL Developer does alot of the manual conversion for you quickly. But you may find Testing / Tuning and the application migration (if any) take you the most amount of time.
    SQL Developer aims to migrate you tables, indexes, and data without issue. But SQL Objects like Procedures, Triggers, Views and Functions conversion will likely require manual work on top of the automatic conversion provided by SQL Developer.
    SQL Developer does not yet automatically handle things like the tablespaces structure or the the logins. Although these things can be scripted and managed more easily within SQL Developer.
    I would recommend downloading and performing the migration from a non production instance ASAP.
    SQL Developer can perform a migration quickly and you will then be able to assess what SQL Developer can and cant do for you.
    I would recommend creating a migration repository on an Oracle database local (install Oracle XE if you dont have a local database) to the SQL Developer instance you are using.
    I would also recommend downloading SQL Developer 2.1
    Here are some key sites regarding Sybase migrations.
    http://www.oracle.com/technology/tech/migration/workbench/viewlets/sqlserver.html . This viewlet for SQL Server is the same process for Sybase.
    http://www.oracle.com/technology/obe/hol08/sqldev_migration/sybase/migrate_sybase_otn.htm . This Oracle By Example takes you step by step through a Sybase migration including some gotchas
    http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151_11.html . This is my blog outlining the steps to perform a Sybase migration.
    Regards,
    Dermot
    SQL Developer Team.

  • Error when creating index with parallel option on very large table

    I am getting a
    "7:15:52 AM ORA-00600: internal error code, arguments: [kxfqupp_bad_cvl], [7940], [6], [0], [], [], [], []"
    error when creating an index with parallel option. Which is strange because this has not been a problem until now. We just hit 60 million rows in a 45 column table, and I wonder if we've hit a bug.
    Version 10.2.0.4
    O/S Linux
    As a test I removed the parallel option and several of the indexes were created with no problem, but many still threw the same error... Strange. Do I need a patch update of some kind?

    This is most certainly a bug.
    From metalink it looks like bug 4695511 - fixed in 10.2.0.4.1

  • Can we associate index with foreign key?

    hello
    i have searched and could not find the answer to the above;
    i have a foreign key constraint on the tables; i added an index on that column as well;
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?
    thx
    rgds

    Hi,
    UserMB wrote:
    i have a foreign key constraint on the tables; i added an index on that column as well;It helps if you give a specific example, such as:
    "I have a foreign key constraint, where emp.deptno references dept.deptno. (Deptno is the primary key of dept.) I created an index called emp_deptno_idx on emp.deptno as well."
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;Not all indexes are associated with a constraint. In the example above, you wouldn't expect to see anything about the index emp_demptno_idx in all_constraints or in all_cons_columns.
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?In the situation above, Oracle will still use the index when the optimizer thinks it will help. You don't have to do anything else.

Maybe you are looking for