4 Replies Latest reply: Jun 3, 2013 2:29 AM by 446 RSS

    how to resolve ora issue-parent key not found!

    446
      Hi,
      Once the import is done,when i tried to enable the constraints,am getting ORA-02298: cannot validate (%s.%s) - parent keys not found for some of the constraints,i had already raised a new thread,but when i tried to resolve this issue based on the solution provided there,i couldn't....

      http://www.shutdownabort.com/errors/ORA-02298.php

      i have tried in so many ways-

      -reimporting the parent table alone.
      -fresh export of all tables with option consistent=y

      but the records are matching between source and target tables.
        • 1. Re: how to resolve ora issue-parent key not found!
          Srini Chavali-Oracle
          Pl post details of OS and database versions, along with the complete import command and the complete import log

          HTH
          Srini
          • 2. Re: how to resolve ora issue-parent key not found!
            446
            database version-11g,OS- windows XP
            i never faced any issue while taking import,once import was done i tried to enable the constraints,but for some constraints i cudn't
            • 3. Re: how to resolve ora issue-parent key not found!
              446
              based on this issue,is there any simple query to findout the missing records in parent table,i don't have access for child_table,parent_table views.

              FYI- am using traditional imp/exp command to accomplish data import and export activities,i tried with the following query,but not getting any output

              select 'select '||cc.column_name-
              ||' from '||c.owner||'.'||c.table_name-
              ||' a where not exists (select ''x'' from '-
              ||r.owner||'.'||r.table_name-
              ||' where '||rc.column_name||' = a.'||cc.column_name||')'
              from dba_constraints c,
              dba_constraints r,
              dba_cons_columns cc,
              dba_cons_columns rc
              where c.constraint_type = 'R'
              and c.owner not in ('SYS','SYSTEM')
              and c.r_owner = r.owner
              and c.owner = cc.owner
              and r.owner = rc.owner
              and c.constraint_name = cc.constraint_name
              and r.constraint_name = rc.constraint_name
              and c.r_constraint_name = r.constraint_name
              and cc.position = rc.position
              and c.owner = '&table_owner'
              and c.table_name = '&table_name'
              and c.constraint_name = '&constraint_name'

              can anyone suggest to fix it using some other option.
              • 4. Re: how to resolve ora issue-parent key not found!
                446
                Thanks for the response!