7 Replies Latest reply: Jul 5, 2011 4:36 AM by Kgronau-Oracle RSS

    Help for migrating DB2 to Oracle11 g, with Sql Developer

    835156
      Hello, Good Afternoon,

      Today I started a series of exercises to migrate DB2 9 to Oracle 11 g, with SQL Developer in order to evaluate this tool for a project we have in door.

      But it is setting a number of issues, because the DB2 tables that we are trying to migrate do not have primary key and load the data sets the error ORA-02270.

      It is generating an error when trying to convert the following triggers.

      CREATE TRIGGER min_salary NO CASCADE
      BEFORE INSERT ON staff REFERENCING NEW AS newstaff
      FOR EACH ROW MODE DB2SQL BEGIN ATOMIC
      SET newstaff.salary =
      CASE
      WHEN newstaff.job = 'Mgr' AND newstaff.salary < 17000.00 THEN 17000.00
      WHEN newstaff.job = 'Sales' AND newstaff.salary < 14000.00 THEN 14000.00
      WHEN newstaff.job = 'Clerk' AND newstaff.salary < 10000.00 THEN 10000.00
      ELSE newstaff.salary END;
      END

      --------------------------------------------------------------------------------------------------------------------------------------------------------------------

      CREATE TRIGGER do_not_del_sales NO CASCADE
      BEFORE DELETE ON staff REFERENCING OLD AS oldstaff
      FOR EACH ROW MODE DB2SQL
      WHEN(oldstaff.job = 'Sales') BEGIN ATOMIC SIGNAL SQLSTATE '75000'
      ('Sales staff cannot be deleted... see the DO_NOT_DEL_SALES trigger.'); END

      --------------------------------------------------------------------------------------------------------------------------------------------------------------------

      SEVERE 197 625 oracle.dbtools.migration.workbench.core.MigrationLogResourceBundle Failed to Convert Trigger MIN_SALARY>: class org.antlr.runtime.NoViableAltException -> null: Line 1 Column 0

      SEVERE 196 1328 oracle.dbtools.migration.workbench.core.MigrationLogResourceBundle Failed to Convert Trigger DO_NOT_DEL_SALES>: class org.antlr.runtime.NoViableAltException -> null: Line 1 Column 0

      --------------------------------------------------------------------------------------------------------------------------------------------------------------------

      I can do for Work Bench (SQL Developer) not validate that DB2 must carry primary keys?

      I can do for Work Bench (SQL Developer), I can turn triggers the 2 above?


      Greetings