ORA-02298 - A suggestion
hello all
for the error
ORA-02298 - cannot validate <child_table> - parent keys not found
means that ther are some orphaned child records in the child table for which there is no parent key . i.e. no parennt record exist in parent table.
so we have to remove the orphaned child records
try query like this
delete from child where(foreign_key) in
(select ce.foreign_key from child ce,parent c
where (ce.foreign_key)<>(c.parent_key))
shalini
ORA-02298: cannot validate (string.string) - parent keys not found
Cause: an alter table validating constraint failed because the table has orphaned child records.
Action: Obvious
Go Through Below links
>>>ORA-02298 Cannot validate - parent keys not found
HTH
M.S.Taj
Similar Messages
-
Ora-02298 in migrating MS-SQLServer to Oracle 8i
Greetings,
I am in the process of migrating a MS-SQLServer db to Oracle 8i.
I have encountered an error (ora-02298). The following was inserted into the mwb error log:
REM
REM Message : Failed to create foreign key: FK_M_REQUEST_M_WORK_ORDER: ORA-02298: cannot validate (BCBIZ.FK_M_REQUEST_M_WORK_ORDER) - parent keys not found
REM User : bcbiz
ALTER TABLE bcbiz.M_REQUEST ADD ( CONSTRAINT FK_M_REQUEST_M_WORK_ORDER FOREIGN KEY ( work_id ) REFERENCES bcbiz.M_WORK_ORDER ( work_id ) ON DELETE CASCADE );
I have read the FAQ section of the mwb site and from my understanding this error indicates that work_id should be primary key or unique key for the table m_work_order. I have checked the table m_work_order and have verified that the work_id field is the primary key for the m_work_order table.
I have tried dropping and creating the table from scratch and have received the same error.
Does anyone have any suggestions that I might try?
Thank you in advance,
-Ken
nullhello,
am interested in migrating from mssql server 7 to oracle 8i.
how excatly do i do that should i download some gateway software or should i download migration workbench software if i download how do i move files from MSSQL to oracle.
Some one please help me out.
thankyou
Ramesh
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Kenneth Eisner ([email protected]):
Greetings,
I am in the process of migrating a MS-SQLServer db to Oracle 8i.
I have encountered an error (ora-02298). The following was inserted into the mwb error log:
REM
REM Message : Failed to create foreign key: FK_M_REQUEST_M_WORK_ORDER: ORA-02298: cannot validate (BCBIZ.FK_M_REQUEST_M_WORK_ORDER) - parent keys not found
REM User : bcbiz
ALTER TABLE bcbiz.M_REQUEST ADD ( CONSTRAINT FK_M_REQUEST_M_WORK_ORDER FOREIGN KEY ( work_id ) REFERENCES bcbiz.M_WORK_ORDER ( work_id ) ON DELETE CASCADE );
I have read the FAQ section of the mwb site and from my understanding this error indicates that work_id should be primary key or unique key for the table m_work_order. I have checked the table m_work_order and have verified that the work_id field is the primary key for the m_work_order table.
I have tried dropping and creating the table from scratch and have received the same error.
Does anyone have any suggestions that I might try?
Thank you in advance,
-Ken
<HR></BLOCKQUOTE>
null -
Error: ORA-02298 while creating a new app at DRM 11.1.2.3.300
Hi All,
There's something weird happening when I try to create a new DRM app at DRM Management Console. After provide all information about database connection and admin long on i am getting the following error during the repository creation :
Creating Repository ... Done.
Creating Tables ... Done.
Creating Views ... Done.
Creating Stored Procedures ... Done.
Creating Indexes ... Done.
Creating Primary Keys ... Done.
Initializing schema with predefined data ...
Database creation failed with this error: ORA-02298: cannot validate (EPM_DRM_DB.FK_CATUSER02) - parent keys not found
It is a fresh install and I don't know why I am having this error. Did someone had this issue too ? How to solve that ?
Thanks in advance...To whom it may concern.....
This issue was related to privileges in database. I've generated the scripts and ran with system user and it worked.
Case closed. -
Hi, During the exp/imp process,i have tried to enable the constraints once the import done,but for some of the constraints am getting ORA-02298: cannot validate (%s.%s) - parent keys not found error,can anyone assist me what are all the possible ways to fix this issue. database -ORACLE 11g,o/s -LINUX
Hi. Put the missing values into the parent table or Remove the rows in the child table which contain values that are not in the parent table
http://www.shutdownabort.com/errors/ORA-02298.php
Regards
Javid Hasanov
Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
Edited by: Javid Hesenov on Jul 6, 2012 2:03 AM -
ORA-02298 : cannot validate - parent keys not
Hi,
I am trying to create a FK-PK constraints.
In the alter table command i am using the caluse:
exceptions INTO ... in order to catch all the exception rows .
Can you please explain why i am getting this error message ?
I am using the following command:
SQL> ALTER TABLE STARQ.CALL_FACT ADD (
2 CONSTRAINT CALL_FACT_FK_cmcustdim1
3 FOREIGN KEY (CUST_ID)
4 REFERENCES STARQ.CM_CUST_DIM_1 (DWH_CUST_ID)
5 exceptions INTO starq.exceptions );
CONSTRAINT CALL_FACT_FK_cmcustdim1
ERROR at line 2:
ORA-02298: cannot validate (STARQ.CALL_FACT_FK_CMCUSTDIM1) - parent keys not foundHi,
>>Can you please explain why i am getting this error message ?
This is a normal behavior. After issued the "alter table add constraint ..." command, you need to query on EXCEPTIONS table.
LEGATTI@XE> create table a (id number constraint pk_a primary key);
Table created.
LEGATTI@XE> create table b (id number);
Table created.
LEGATTI@XE> insert into b values (1);
1 row created.
LEGATTI@XE> create table exceptions(row_id rowid,
2 owner varchar2(30),
3 table_name varchar2(30),
4 constraint varchar2(30));
Table created.
LEGATTI@XE> alter table b add constraint fk_b_a foreign key (id) references a exceptions into exceptions;
alter table b add constraint fk_b_a foreign key (id) references a exceptions into exceptions
ERROR at line 1:
ORA-02298: cannot validate (LEGATTI.FK_B_A) - parent keys not found
LEGATTI@XE> select * from exceptions;
ROW_ID OWNER TABLE_NAME CONSTRAINT
AAAD3mAAEAAAABoAAA LEGATTI B FK_B_ACheers
Legatti -
SQL> alter table jti.DIS_ROOM_REQUESTS
2 add constraint DIS_FK2_ROOM_REQUESTS_ST_ID foreign key (STUDENT_ID)
3 references jtisp.sis_students (STUDENT_ID);
add constraint DIS_FK2_ROOM_REQUESTS_ST_ID foreign key (STUDENT_ID)
ERROR at line 2:
ORA-02298: cannot validate (JTI.DIS_FK2_ROOM_REQUESTS_ST_ID) - parent keys not
found
plz help me...to come out this error...Hi:
From techonthenet.com
Cause:
You tried to execute an ALTER TABLE ENABLE CONSTRAINT command, but it failed because your table has orphaned child records in it.
Action:
The options to resolve this Oracle error are:
1- Remove the orphaned child records from the child table (foreign key relationship), and then re-execute the ALTER TABLE ENABLE CONSTRAINT command.
2- Create the missing parent records in the parent table (foreign key relationship), and then re-execute the ALTER TABLE ENABLE CONSTRAINT command.Saad,
http://saadnayef.blogspot.com -
ORA-02298: cannot validate .......
Hi,
I exported user cmsadmin with constraints=y and consistent=y as DBA user from 9i then Imported it using fromuser/touser =cmsadmin into oracle 10g..
i got the follwing error while importing:
IMP-00017: following statement failed with ORACLE error 2298:
"ALTER TABLE "RESPONSES" ENABLE CONSTRAINT "FK_RESPONSE_FK_CTF_RE_CERTIFIC""
IMP-00003: ORACLE error 2298 encountered
ORA-02298: cannot validate (CMSADMIN.FK_RESPONSE_FK_CTF_RE_CERTIFIC) - parent keys not found
The
ALTER TABLE "CMSADMIN"."RESPONSES" ADD CONSTRAINT
"FK_RESPONSE_FK_CTF_RE_CERTIFIC" FOREIGN KEY ("REP_CERTIFICATION_ID")
REFERENCES "CERTIFICATION" ("CTF_CERTIFICATION_ID") ENABLE NOVALIDATE ;
But when i checked number of rows of for CERTICATION table in 9i DB and target 10g DB they are same....
But when i run the following query:
select distinct REP_CERTIFICATION_ID from RESPONSES a where not exists (select CTF_CERTIFICATION_ID from CERTIFICATION where CTF_CERTIFICATION_ID = a.REP_CERTIFICATION_ID);The above query returns 288 rows meaning they are not in CERTIFICATION table.. but the count of number of rows are same in source and target DB..
What can be the reason..
can you pls help...
ThxHi,
here is my EXP and IMP commands:
exp cmsadmin/frora04_adm file=cmsdbt01_cmsadmin_29Mar07.dmp log=cmsdbt01_cmsadmin_29Mar07.log owner=cmsadmin consistent=y grants=y constraints=y rows=n
imp cmsadmin/orad1_adm file=cmsdbt01_cmsadmin_29Mar07.dmp log=cmsadmin_imp.log fromuser=cmsadmin touser=cmsadmin ignore=y
moreover, when i run the following query in source database on 9i from where i took the export it does not return any rows meaning that data is fine in both parent and child tables:
select distinct REP_CERTIFICATION_ID from RESPONSES a where not exists (select CTF_CERTIFICATION_ID from CERTIFICATION where CTF_CERTIFICATION_ID = a.REP_CERTIFICATION_ID);
But, when i run the same above query in target table after importing the schema (usng above imp command) i get 14 distinct CTF_CERTIFICATION_ID meaning that they are not in parent table..
Master Table --> CERTIFICATION
PK column --> CTF_CERTIFICATION_ID
Child Table --> RESPONSES
FK column to above PK --> REP_CERTIFICATION_ID
Hence issue still persists reg. parent key not found after importing..
Thx -
ORA-02298: cannot enable name - parent keys not found
Hi All,
I got this problem while creating Foreign Key constraints ORA-02298: cannot enable name - parent keys not found. How to rectify this problemalter table WORK_APPROVAL_DETAILS
add constraint FK_WRKAPPR_AUTH_APPR foreign key (APPROVER_CODE, PCC_INFO_CODE)
references AUTHORIZED_APPROVERS (APPROVER_CODE, PCC_INFO_CODE);
WORK_APPROVAL_DETAILS:
inspection_id number(16)
work_code varchar2(18)
approver_code varchar2(12)
approver_remarks varchar2(200)
approval_date date
role_code char(2)
reference_no varchar2(50)
pcc_info_code varchar2(9)
status_code number(4)
AUTHORIZED_APPROVERS
approver_code varchar2(12)
approver_name varchar2(30)
dept_code varchar2(3)
desg_code char(2)
is_active char(1)
address varchar2(250)
role_code char(2)
created_by varchar2(20)
created_date date
pcc_info_code varchar2(9)
qualification varchar2(50)
experience varchar2(25) -
hi
I disabled some constraints. But now, when I try to enable them then I get the error:
ORA-02298: cannot validate (PL_REM_FK_ES_EMP) - parent keys not found.
Plz guide me to resolve this problem.Hi,
there is most likely some orphaned records in the child table. what command did you use to delete the record? what the output of
select xxxxx from child_table a where not exists (select 'x' from
parent_table where primary_key = a.key_values);
dan -
How to resolve ora issue-parent key not found!
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.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. -
ORA-01031 with materialized view in stored procedure
USER1 has created a materialized view (MV). The MV is owned by USER2. USER1 needs to query the MV from within a stored procedure. How do I avoid the ORA-01031?
Here's the illustration:
SQL> show user
USER is "USER1"
SQL> CREATE MATERIALIZED VIEW USER2.ROLL
2 BUILD IMMEDIATE
3 REFRESH COMPLETE WITH ROWID
4 ON DEMAND
5 AS
6 select * from user2.test_roll;
Materialized view created.
SQL> select status,owner,object_name,object_type where OBJECT_TYPE='MATERIALIZED VIEW';
STATUS OWNER OBJECT_NAME OBJECT_TYPE
VALID USER2 ROLL MATERIALIZED VIEW
SQL> select count(*) from user2.roll;
COUNT(*)
959485
SQL> declare
2 n number;
3 begin
4 select count(*)
5 into n
6 from user2.roll
7 where rownum<100;
8 dbms_output.put_line(n);
9* end;
SQL> /
99
PL/SQL procedure successfully completed.
SQL> create procedure test_mv is
2 n number;
3 begin
4 select count(*)
5 into n
6 from as400_snpsht.roll
7 where rownum<100;
8 dbms_output.put_line(n);
9 end;
10 /
Warning: Procedure created with compilation errors.
SQL> select text from user_errors where name like 'TEST_MV';
TEXT
PL/SQL: ORA-01031: insufficient privileges
PL/SQL: SQL Statement ignored
So the point is:
* Ad hoc sql works on the MV
* Anonymous pl/sql works on the MV
* Stored procedure fails compilation with ora-01031
Any suggestions are appreciated.Sorry; In may example 'as400_snpsht' should have been 'USER2' (the owner of the MV). I changed the real user names to USER1, USER2 to make the example clearer but missed that one.
I meant to say...
SQL> create procedure test_mv is
2 n number;
3 begin
4 select count(*)
5 into n
6 from user2.roll
7 where rownum<100;
8 dbms_output.put_line(n);
9 end;
10 /
Warning: Procedure created with compilation errors.
SQL> select text from user_errors where name like 'TEST_MV';
TEXT
PL/SQL: ORA-01031: insufficient privileges
PL/SQL: SQL Statement ignored -
No database table exists for table ZTAB1 after ORA-01438
Dear friends,
We have a problem in our test system.
One developer performed a transport which tried to change column from length 11 to 10 and after the transport, table is missing from database. We observed ABAP dumps DBIF_RSQL_SQL_ERROR with ORA-01438 which suggested us that there was some problem with field lenght change. After discussin, we have find out the culprate filed.
But, with me now problem is Partially active table which Does not exist in the database.
So now, what i should do to fix this problem.. Shuld i again increase filed length manually in test system and then try to perform SE14>Continue adjustment or what ?
In SE14 : Analyze Adjustment provide this information :
Seq of steps
1 Initialization
2 Dropping of indexes, renaming of original table
3 No action
4 Activation of transparent table
5 Conversion of data to new table, deletion of renamed table
6 Creation of sec. indexes
Adjustment terminated in step 5
Initial table Table type Status
ZTAB1 Transparent Renamed
Renamed original table
QCMZTAB1 transparent Existent
Tgt.table
ZTAB1 Transparent Renamed
thanks
ashishI had tried to reactivate table.. but it will not work as I had Terminated conversion : Adjustment terminated in step 5.
database object itself was not existent.. so consistency check is not helpful.
We recognized the problem.. at present, we have DDIC object for table with a field length 10(new lenght), a QCMtable which contains original data with filed lenght 11(Old value) and a conversion table QCM8table which has filed lenght 10(new value).
Now, in my case, original table had some Rows for that column lenght 11 and it was unable to transfer them to QCM8table.
I had raised an OSS to SAP.
thanks
ashish -
ORA-12827: insufficient parallel query slaves
Hi All,
We are hitting ORA-12827 after setting up parameters related to parallelism. It was a suggestion from Oracle , just to boost up the performance by setting up auto parallelism and few other parameters complementing to it. We have made changes on 2 Database , but we are hitting this only one database, which has similar in configuration in terms of hardware (32 cpus, gobs of ram , sufficient I/O) but it has less SGA setup (7G) over 30G on other database, which seems fine as if now. Here ,ORA-12827 , clearly suggest that , the server does not have sufficient parallel slaves , may be , already in use by different users. I have a question here , what do you think , what is causing this issue to occur , is it no of users or memory or anything else. I know, parallel stuff is not scalable in terms of no of increased users. Also, since we are on 11GR2, we can go for "parallel statement queuing" and that will not fail us ,because of resources getting exhausted completely, right ? What do you think , would it be a right approach to go with or you would you go different approach? thanks a lot for all of your help in past.
OS -- Enterprise Linux Server release 5.8 (Tikanga)
DB --- 11.2.0.3.0
------------- Parameters suggested by Oracle -----------------------------
change parallel_min_servers=8
change parallel_max_servers=128
change parallel_degree_limit=8
change parallel_degree_policy=AUTO
change parallel_min_percent=50
----------------------------------- Current SGA and Parallel Settings ---------------------
NAME TYPE VALUE
fast_start_parallel_rollback string LOW
parallel_adaptive_multi_user boolean TRUE
parallel_automatic_tuning boolean FALSE
parallel_degree_limit string 8
parallel_degree_policy string AUTO
parallel_execution_message_size integer 16384
parallel_force_local boolean FALSE
parallel_instance_group string
parallel_io_cap_enabled boolean FALSE
parallel_max_servers integer 128
parallel_min_percent integer 50
parallel_min_servers integer 8
parallel_min_time_threshold string AUTO
parallel_server boolean FALSE
parallel_server_instances integer 1
parallel_servers_target integer 128
parallel_threads_per_cpu integer 2
recovery_parallelism integer 0
SQL> show parameter sga_
NAME TYPE VALUE
sga_max_size big integer 7G
sga_target big integer 7GRegardswhy posted this question then?Fran, it's not about the "ORA-12827" only. I also asked the , what is the reason , one can think of , when comparing other database , which has more memory other then that , pretty much identical. Please go through my question once again , you would realize , what was the question actually.
Regards -
I wrote below small function in pl/sql
==========================
CREATE OR REPLACE FUNCTION rec_id_chk (record_id IN NUMBER) RETURN CHAR IS
dummy NUMBER;
l_mesg_data VARCHAR2(1000);
BEGIN
SELECT NVL(INSTR (record_id, '-'),0) INTO dummy FROM DUAL;
IF dummy > 0 THEN
l_mesg_data := 'Error Type :'||'{'||record_id||'}'||sysdate||' Record Invalid';
RAISE_APPLICATION_ERROR(-20002,l_mesg_data);
END IF;
RETURN 'T';
END rec_id_chk;
===================
When I run it ; it gives ORA-6512;; any suggestions ?
SQL> select rec_id_chk(-11) from dual;
select rec_id_chk(-11) from dual
ERROR at line 1:
ORA-20002: Error Type :{-11}29-OCT-07 Record number format is invalid
ORA-06512: at "APPS.REC_ID_CHK", line 13Hi Amar
I don't understand why r u checking "-" sign in a number datatype. If u need to check whether the number is +ve or -ve go for a condition like (number<0). By the way error ORA-06512 comes due to error stack unwinding which is the result of unhandles exceptions. -
After registering any XML Schema export fails with ORA-24324. any suggestions?
Platform is Windows 2000, db characters: UTF-8
exp system/manager@syzxml owner=(syzem) file=a.dmpExport: Release 9.2.0.4.0 - Production on Sun Nov 23 09:52:13 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in EE8MSWIN1250 character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SYZEM
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SYZEM
About to export SYZEM's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
EXP-00056: ORACLE error 24324 encountered
ORA-24324: service handle not initialized
EXP-00056: ORACLE error 24324 encountered
ORA-24324: service handle not initialized
EXP-00000: Export terminated unsuccessfully
v$version:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for 32-bit Windows: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
dba_registry:
COMP_NAME STATUS
VERSION
Oracle9i Catalog Views VALID
9.2.0.4.0
Oracle9i Packages and Types VALID
9.2.0.4.0
Oracle Workspace Manager VALID
9.2.0.1.0
Oracle XML Database VALID
9.2.0.4.0
nls_session_parameters:
PARAMETER VALUE
NLS_CALENDAR GREGORIAN
NLS_COMP BINARY
NLS_CURRENCY z│
NLS_DATE_FORMAT RR/MM/DD
NLS_DATE_LANGUAGE POLISH
NLS_DUAL_CURRENCY z│
NLS_ISO_CURRENCY POLAND
NLS_LANGUAGE POLISH
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NUMERIC_CHARACTERS .,
PARAMETER VALUE
NLS_SORT POLISH
NLS_TERRITORY POLAND
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT RR/MM/DD HH24:MI:SSXFF
NLS_TIMESTAMP_TZ_FORMAT RR/MM/DD HH24:MI:SSXFF TZR
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZRTry use export utility version 9.0.1.1.1 or
store XMLType as CLOB.
Maybe you are looking for
-
IPhoto v9.5 - No more "burn" menu ?
Help please... I meet this really big problem for me. No more "burning DVD" function in iPhoto 9.5 ? And burning a DVD is ok from the finder. Someone to confirm the missing "burn" menu ?
-
Now T420 wont sleep due to srvnet????????
So last night my laptop wouldn't sleep when I shut the lid. I fixed that issue today, and now when I shut the lid or use Fn+F4 the sleep option works like a charm. Now, I have another problem today. I found out that my computer is not going to sleep,
-
Delivery Date getting Copied to Release Date in Purchase Requisition
Hello, When i am releasing the Purchase Requsition, what ever the Delivery Date the system is proposing based on the Planned Delivery Days given in Material Master is copied to the Purchase Requisition Release Date. Is there any error in Customizatio
-
Material Ledger x IFRS x Depreciation
Hi All In South America companies are used to run actual costing run (CKMLCP) to valuate the stock with actual price. This actual price uses local depreciation method in their depreciation activity. Due consolidation purposes and IFRS requirements co
-
Max. # of mail receipients? Max size of e-mail?
I tried to send a newsletter to about 150 people. The size of e-mail, including a 0.8 mb pdf attachment was 1.3 mb. The server kept on balking and wouldn't send it. Since trying that I've been unable to send anything out. Did I do something wrong or