MView refresh error on 10gR2..(unique constraint error)
Hi. all.
The database is 2-node RAC 10gR2 on SunOS.
Today morining, I got the following error.
EXEC dbms_refresh.refresh('"ODSFAB"."CURRENTWIP"');
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (ODSFAB.CURRENTWIP_GLASS_IDX) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
ORA-06512: at "SYS.DBMS_IREFRESH", line 683
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
I checked both the source and target table, but there is no unique-key confliction.
The source table has no unique index, but the target table have one unique index
for a business purpose.
Finally, I dropped the miew log on a source table and mview , and recreated mview
log and mview with the same unique constraint and the same data.
I do not understand why I got "Unique constraint error".
Any advice will be welcomed.
Thanks in advance.
Have a good day.
Best Regards.
Message was edited by:
user507290
Let us say column A is the unique key on target DB and exists in source DB.
Now, on source DB,
- Value 'X' is inserted in col A
- Value "X" is again inserted in col A (or updated on colA)
- Then one of these 2 rows is deleted
Now, "if" Oracle applies all the transactions from the source to target in the
same sequence as they occured, there is chance you can get unique error.you do
But, if a full refresh, there won't be error.I would say that is a very plausible explanation. Somewhat difficult to verify, in the absence of low-level auditing on the source database.
The situation as described is a bit yucky. Is there no way of putting a unique key on the table in the source database? If not, it seems to me that this scenario is bound to re-occur.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/
Similar Messages
-
Toplink 10.1.3.1 Unique Constraint error
Hi All,
I'm working with toplink 10.1.3.1 using JDeveloper 10.1.3.1.
When I'm using the Sequence in the toplink work bench, I'm getting the unique constraint error.
What i did was, I checked the "Use sequencing" check box and filled the sequence name , table name and field in the toplink workbench wizard.
And I kept true for "Use Native Sequencing" in the sequence of login tab for sessions.xml default file. And checked the preallocation Size and set to the minimum value of the sequence. I didn't checked the "Table", "Name Field" and "Counter Field" check boxes.
The sequence is getting incremented for every execution. Its not getting the actual sequence current value. I don't know whether the value is getting cached.
for example if the actual sequence number in the database is 1740
but when I am running the toplink query It is generating the sequence number like 1738 and it is giving the Unique constraint when I am clicking on the button for three times (ie 1739,1740,1741)it is inserting successfully into the database.
But when I am running the application again then it is generating the sequence number as 1739 I am unable to understand where I am going wrong.
If I test The sequence in SQL Work Sheet it was working fine.
could anyone suggest me the correct way of using the sequence in the toplink workbench.
the Sequence was created using JDeveloper wizard with Increment 1.
Thanks in advance,
regards,
Satish Dasari.Hi,
Satish,Thanks for your reply.
Let me tell the scenario. I have two tables A and B. First I am inserting an event_no in table A. and after that I read the data from table A including event_no and I am going to insert it into table B. Rarely I am getting an exception like Unique constraint violation error.
I kept native sequencing true,preallocation size 1, Min value=1, Max-value=9999999, increment by 1, cache size=10, Enabled refresh only if new version.
What are all the values that i need to be changed in order to recover from this error. Our application is running in a load balancing environment.
Note: I am not able to simulate this in my desktop environment.
Regards,
P.Prasanna. -
I have a stored proc which runs every night. The stored proc is giving a unique constraint violation.
(Error) ORA-00001: unique constraint (WHSE_DBA.PK_DELPHI_TRANS_FACT) violated.
Any idea about how to debug this.I want to create an error table on the stored proc shown below. I know I have to add something in the exceptions. Can anyone give me the commands and where to add it.
CREATE OR REPLACE PROCEDURE WHSE_DBA.DM_LD_DELPHI_TRANS_FACT
IS
-- VARIABLE DECLARATIONS
LAST_LOAD_DATE DATE;
INSERTCOUNT NUMBER:=0;
-- LOGGING VARIABLES AND CONSTANTS
TARGETTABLE CONSTANT VARCHAR2(20):='DELPHI_TRANS_FACT';
MSGUNKNOWNERR CONSTANT VARCHAR2(20):='Error';
NBRIGNOREERR CONSTANT NUMBER:=12541;
DEFDATE CONSTANT DATE:='01-OCT-2006';
ERRDESCRIPTION VARCHAR2(255);
V_DELPHI_TRANS_TOTAL NUMBER;
V_DELPHI_TRANS_FACT_TOTAL NUMBER;
BEGIN
-- LOOK UP LAST LOADED RECORD
SELECT NVL(MAX(SNAPSHOT_DATE),DEFDATE)
INTO LAST_LOAD_DATE
FROM DELPHI_TRANS_FACT;
-- * LOAD ALL DIMENSION TABLES
-- BUDGET_YR_DIMENSION
INSERT INTO BUDGET_YR_DIMENSION (BUDGET_YEAR, SNAPSHOT_DATE)
(SELECT DISTINCT BUD_YR, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM BUDGET_YR_DIMENSION
WHERE BUDGET_YEAR=OUTER.BUD_YR));
-- EFF_DATE_DIMENSION
INSERT INTO EFF_DATE_DIMENSION (PAID_FIS_YEAR, PAID_QTR, EFFECTIVE_DATE, SNAPSHOT_DATE)
(SELECT DISTINCT CVT_DATE_TO_FISCAL_YEAR(EFF_DT), PD_QTR, EFF_DT, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM EFF_DATE_DIMENSION
WHERE EFFECTIVE_DATE=OUTER.EFF_DT));
-- PROC_DATE_DIMENSION
INSERT INTO PROC_DATE_DIMENSION (PROCESS_DATE, SNAPSHOT_DATE)
(SELECT DISTINCT PROC_DT, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM PROC_DATE_DIMENSION
WHERE PROCESS_DATE=OUTER.PROC_DT));
-- ORG_DIMENSION
INSERT INTO ORG_DIMENSION (ORG,COST_CTR,SNAPSHOT_DATE)
(SELECT DISTINCT ORG, CC_CD, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM ORG_DIMENSION
WHERE ORG=OUTER.ORG));
-- BPAC DIMENSION
INSERT INTO BPAC_DIMENSION (BPAC, AFC_CD, PE_CODE, SNAPSHOT_DATE)
(SELECT DISTINCT BPAC, AFC_CD, PE, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM BPAC_DIMENSION
WHERE BPAC=OUTER.BPAC));
-- FUND DIMENSION
INSERT INTO FUND_DIMENSION (FUND,APPROP_CD,LIM_CD,SNAPSHOT_DATE)
(SELECT DISTINCT FUND, APPROP_CD, APPLIM_CD, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM FUND_DIMENSION
WHERE FUND=OUTER.FUND));
-- OBJ_CD_DIMENSION
INSERT INTO OBJ_CD_DIMENSION (OBJ_CD,SNAPSHOT_DATE)
(SELECT DISTINCT OC_CD, SYSDATE
FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM OBJ_CD_DIMENSION
WHERE OBJ_CD=OUTER.OC_CD));
-- GLA DIMENSION
INSERT INTO GLA_DIMENSION (GLA_CD,SNAPSHOT_DATE)
(SELECT DISTINCT GLA, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM GLA_DIMENSION
WHERE GLA_CD=OUTER.GLA));
-- PROJECT_TASK_DIMENSION
INSERT INTO PROJECT_TASK_DIMENSION (PROJECT_NO,TASK_NO,SNAPSHOT_DATE)
(SELECT DISTINCT PROJ_NBR, TASK_NBR, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM PROJECT_TASK_DIMENSION
WHERE PROJECT_NO=OUTER.PROJ_NBR
AND TASK_NO=OUTER.TASK_NBR));
-- TRANS_DESC_DIMENSION
INSERT INTO TRANS_DESC_DIMENSION (DESCRIPTION,SNAPSHOT_DATE)
(SELECT DISTINCT DESCR, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM TRANS_DESC_DIMENSION
WHERE DESCRIPTION=OUTER.DESCR
AND OUTER.DESCR IS NOT NULL));
-- SUPPLIER_DIMENSION
INSERT INTO SUPPLIER_DIMENSION (SUPPLIER_NAME, SNAPSHOT_DATE)
(SELECT DISTINCT VENDOR_NAME, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM SUPPLIER_DIMENSION
WHERE SUPPLIER_NAME=OUTER.VENDOR_NAME));
-- DELPHI_INV_DIMENSION
INSERT INTO DELPHI_INV_DIMENSION (INVOICE_NO, SNAPSHOT_DATE)
(SELECT DISTINCT INV_NO, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM DELPHI_INV_DIMENSION
WHERE INVOICE_NO=OUTER.INV_NO));
-- DELPHI_PO_DIMENSION
INSERT INTO DELPHI_PO_DIMENSION (PO_NO, SNAPSHOT_DATE)
(SELECT DISTINCT PO_NO, SYSDATE FROM DELPHI_TRANS OUTER
WHERE NOT EXISTS
(SELECT 1
FROM DELPHI_PO_DIMENSION
WHERE PO_NO=OUTER.PO_NO));
-- TEMPORARILY DISABLE KEY FOR FASTER LOADING
DB_MISC.PRO_EXE_DDL('ALTER TABLE DELPHI_TRANS_FACT DISABLE CONSTRAINT PK_DELPH_TRANS_FACT');
-- MOVE DATA INTO TABLE
INSERT INTO DELPHI_TRANS_FACT (BPAC_KEY, ORG_KEY, FUND_KEY, OBJ_CD_KEY, GLA_KEY,
EFF_DATE_KEY, PROC_DATE_KEY, PROJECT_TASK_KEY, BUDGET_YR_KEY, DELPHI_TRANS_DESC_KEY,
BALANCE, COMMIT_AMT, UDO_AMT, AEU_AMT, AEP_AMT, OBLIGATION_AMT, SNAPSHOT_DATE,
SUPPLIER_KEY, DELPHI_INV_KEY, DELPHI_PO_KEY)
(SELECT BPAC_KEY, ORG_KEY, FUND_KEY, OBJ_CD_KEY, GLA_KEY, EFF_DATE_KEY, PROC_DATE_KEY,
PROJECT_TASK_KEY, BUDGET_YR_KEY, TRANS_DESC_KEY, SUM(BAL), SUM(COMMIT_AMT), SUM(UDO_AMT),
SUM(AEU_AMT), SUM(AEP_AMT), SUM(OBLIGATION_AMT), MAX(SYSDATE), SUPPLIER_KEY, DELPHI_INV_KEY,
DELPHI_PO_KEY
FROM BPAC_DIMENSION, ORG_DIMENSION, FUND_DIMENSION, OBJ_CD_DIMENSION, GLA_DIMENSION,
EFF_DATE_DIMENSION, PROC_DATE_DIMENSION, PROJECT_TASK_DIMENSION, BUDGET_YR_DIMENSION,
TRANS_DESC_DIMENSION, DELPHI_TRANS, SUPPLIER_DIMENSION, DELPHI_INV_DIMENSION, DELPHI_PO_DIMENSION
WHERE DELPHI_TRANS.SNAPSHOT_DATE>LAST_LOAD_DATE
-- JOIN WITH BPAC_DIMENSION
AND DELPHI_TRANS.BPAC=BPAC_DIMENSION.BPAC
-- JOIN WITH ORG_DIMENSION
AND DELPHI_TRANS.ORG = ORG_DIMENSION.ORG
-- JOIN WITH FUND_DIMENSION
AND DELPHI_TRANS.FUND = FUND_DIMENSION.FUND
-- JOIN WITH OBJ_CD_DIMENSION
AND DELPHI_TRANS.OC_CD=OBJ_CD_DIMENSION.OBJ_CD
-- JOIN WITH GLA_DIMENSION
AND DELPHI_TRANS.GLA=GLA_DIMENSION.GLA_CD
-- JOIN WITH EFF_DATE_DIMENSION
AND DELPHI_TRANS.EFF_DT=EFF_DATE_DIMENSION.EFFECTIVE_DATE
-- JOIN WITH PROC_DATE_DIMENSION
AND DELPHI_TRANS.PROC_DT=PROC_DATE_DIMENSION.PROCESS_DATE
-- JOIN WITH PROJECT_TASK_DIMENSION
AND (DELPHI_TRANS.PROJ_NBR=PROJECT_TASK_DIMENSION.PROJECT_NO
AND DELPHI_TRANS.TASK_NBR=PROJECT_TASK_DIMENSION.TASK_NO)
-- JOIN WITH BUDGET_YR_DIMENSION
AND DELPHI_TRANS.BUD_YR=BUDGET_YR_DIMENSION.BUDGET_YEAR
-- JOIN WITH TRANS_DESC_DIMENSION
AND DELPHI_TRANS.DESCR=TRANS_DESC_DIMENSION.DESCRIPTION
-- JOIN WITH SUPPLIER_DIMENSION
AND DELPHI_TRANS.VENDOR_NAME=SUPPLIER_DIMENSION.SUPPLIER_NAME
-- JOIN WITH DELPHI_PO_DIMENSION
AND DELPHI_TRANS.PO_NO=DELPHI_PO_DIMENSION.PO_NO
-- JOIN WITH DELPHI_INV_DIMENSION
AND DELPHI_TRANS.INV_NO=DELPHI_INV_DIMENSION.INVOICE_NO
GROUP BY BPAC_KEY, ORG_KEY, FUND_KEY, OBJ_CD_KEY, GLA_KEY, EFF_DATE_KEY, PROC_DATE_KEY,
PROJECT_TASK_KEY, BUDGET_YR_KEY,TRANS_DESC_KEY, SUPPLIER_KEY, DELPHI_INV_KEY, DELPHI_PO_KEY);
-- COUNT AFFECTED RECORDS
INSERTCOUNT:=0+SQL%ROWCOUNT;
-- RE-ENABLE KEY CONSTRAINT
DB_MISC.PRO_EXE_DDL('ALTER TABLE DELPHI_TRANS_FACT ENABLE VALIDATE CONSTRAINT PK_DELPH_TRANS_FACT');
-- STORE RESULTS OF OPERATION
IF INSERTCOUNT>0 THEN
DB_MISC.LOGFAILURE_EX('none', 'none', INSERTCOUNT||' new records loaded successfully.', TARGETTABLE, 'DM_LD_DELPHI_TRANS_FACT', FALSE);
END IF;
--- COMPARE BALANCE TOTAL FROM DELPHI_TRANS TABLE AND DELPHI_TRANS_FACT TABLE
SELECT SUM(BAL) INTO V_DELPHI_TRANS_TOTAL
FROM DELPHI_TRANS ;
SELECT SUM(BALANCE) INTO V_DELPHI_TRANS_FACT_TOTAL
FROM DELPHI_TRANS_FACT ;
VALIDATE_LOAD(V_DELPHI_TRANS_TOTAL,V_DELPHI_TRANS_FACT_TOTAL);
-- EXCEPTION HANDLING ROUTINES * * * * * * * * * * * * * * * * * * * * * *
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
IF SQLCODE!=NBRIGNOREERR THEN
ERRDESCRIPTION:=SQLERRM;
-- CALL ROUTINE TO PROCESS ERROR
DB_MISC.LOGFAILURE_EX('none', 'none', ERRDESCRIPTION, TARGETTABLE, 'DM_LD_DELPHI_TRANS_FACT', TRUE);
COMMIT;
END IF;
-- END EXCEPTION HANDLING ROUTINES * * * * * * * * * * * * * * * * * * * * * *
END -
ORA-00001 UNIQUE CONSTRAINT ERROR ON SYS.WRH$_SQLTEXT_PK?
/u01/app/oracle/admin/bill02/bdump/bill02_m000_10074.trc
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /u01/app/oracle/product/10.1.0
System name: SunOS
Node name: bill02
Release: 5.9
Version: Generic_117171-17
Machine: sun4u
Instance name: bill02
Redo thread mounted by this instance: 1
Oracle process number: 55
Unix process pid: 10074, image: oracle@bill02 (m000)
*** 2005-10-27 02:03:14.682
*** ACTION NAME:(Auto-Flush Slave Action) 2005-10-27 02:03:14.667
*** MODULE NAME:(MMON_SLAVE) 2005-10-27 02:03:14.667
*** SERVICE NAME:(SYS$BACKGROUND) 2005-10-27 02:03:14.667
*** SESSION ID:(519.24807) 2005-10-27 02:03:14.667
*** KEWROCISTMTEXEC - encountered error: (ORA-00001: unique constraint (SYS.WRH$_SQLTEXT_PK) violated
*** SQLSTR: total-len=570, dump-len=240,
STR={INSERT INTO wrh$_sqltext (sql_id, dbid, sql_text, command_type, snap_id, ref_count) SELECT /*+ ordered use_nl(s1) index(s1) */ sie.sqlid_kewrsie, :dbid, s1.sql_fulltext, }
*** KEWRAFM1: Error=13509 encountered by kewrfteh
How to fix?
Thanks!Have you tried searching Metalink? A unique constraint violation on a SYS table by MMON will almost certainly require Oracle Support's assistance to resolve. Something rather deep inside Oracle has done something wrrong.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
ORA-00001: unique constraint error..
Hi There,
We were trying to do an insert when we started having ORA-00001: unique constraint error.. to speed our testing we decided to disable all the constraints on the table; however we still having the same issue.
How can we resolve this please.
SQL> select constraint_name,constraint_type,status from dba_constraints where table_name='MEMBER_LATEST';
CONSTRAINT_NAME C STATUS
MEMBER_LATEST_PK P DISABLED
SYS_C0017577 C DISABLED
SYS_C0017576 C DISABLED
SYS_C0017575 C DISABLED
SYS_C0017574 C DISABLED
SYS_C0017573 C DISABLED
SYS_C0017572 C DISABLED
SYS_C0017571 C DISABLED
SYS_C0017570 C DISABLED
MEMBER_LATEST_FK R DISABLED
10 rows selected.
SQL>
SQL>
SQL> INSERT INTO MEMBER_LATEST (DIS_ID, TIMESTAMP, LAST_NAME, FIRST_NAME, MIDDLE_NAME, DIS_COUNT)
2 SELECT DIS_ID, 'TEST', LAST_NAME, FIRST_NAME, MIDDLE_NAME, 0
3 FROM MV_DIS_MEM, MV_DIS_COUNT
4 WHERE MV_DIS_MEM.P_CODE = MV_DIS_COUNT.P_CODE
5 ORDER BY 1,3,4;
INSERT INTO MEMSCH.MEMBER_LATEST (DIS_ID, TIMESTAMP, LAST_NAME, FIRST_NAME,
ERROR at line 1:
ORA-00001: unique constraint (MEMSCH.MEMBER_LATEST_PK) violated
SQL>Anything else we can do please?
Thanksrsar001 wrote:
but isn't the unique index constraint part of the disabled constraints on the table as shown above?Not if index used by PK was created separately prior to PK:
SQL> create table emp1 as select * from emp;
Table created.
SQL> alter table emp1
2 add constraint emp1_pk
3 primary key(empno);
Table altered.
SQL> insert into emp1 select * from emp;
insert into emp1 select * from emp
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
SQL> alter table emp1 disable primary key;
Table altered.
SQL> insert into emp1 select * from emp;
14 rows created.
SQL> rollback;
Rollback complete.
SQL> alter table emp1 drop primary key;
Table altered.
SQL> create unique index emp1_pk on emp1(empno);
Index created.
SQL> alter table emp1
2 add constraint emp1_pk
3 primary key(empno)
4 using index emp1_pk;
Table altered.
SQL> insert into emp1 select * from emp;
insert into emp1 select * from emp
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
SQL> alter table emp1 disable primary key;
Table altered.
SQL> insert into emp1 select * from emp;
insert into emp1 select * from emp
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
SQL> But by dropping index you are simply delaying the issue. Yes, you will be able to insert, but what's then? You will not be able to recreate PK - same violation error will be raised.
SY. -
PK with TIMESTAMP causes insert unique constraint error at DST switch
Hi,
I have a test that inserts rows in a table that has a TIMESTAMP in its PK.
When inserting rows that cross over the November DST change, it tries to insert these dates:
--- Sun Nov 02 02:00:00 EST 2008
--- Sun Nov 02 01:00:00 EST 2008
--- Sun Nov 02 01:00:00 EDT 2008
This is the output of 3 different UTC dates. We can see that there are 2 x 1am, but they differ in their DST. They are really 3 different UTC dates.
But I get this error:
--- Expected error: ORA-00001: unique constraint (DDLTEST1.SYS_C00142622) violated
But I can get around that error and can insert these same dates if I set my JVM to UTC. The inserts work so I suspect this to be a JDBC issue.
I am using the Oracle Thin driver in a spring app:
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:db" />
I can post the sample code but wonder if there is an obvious answer to this.
Note that MySql had the same problem. I fixed it by specifying the UTC timezone in the connection string, like this:
jdbc:mysql://[host]/[db]?useLegacyDatetimeCode=false&useTimezone=true&sessionVariables=time_zone='UTC'
Any idea how to get around that problem without setting JVM to UTC ?
Claude
Edited by: user2678899 on 10 juin 2009 10:09
I removed #2 work around which was wrong
Edited by: user2678899 on 10 juin 2009 10:23Timur Akhmadeev wrote:
Hi,
I suspect this to be a JDBC issue.Nope, this is your schema design gap. It breaks the main principle of PK: to uniquely identify a row in a table always. Your PK doesn't satisfy it, since it depends on client's settings.Why is setting the JVM to UTC working ? This is the part that confuses me.
I create the 3 dates in Eastern time, then change the JVM default to UTC: the 3 inserts work.
I create the 3 dates in Eastern time, then leave the JVM to Eastern time , the 3rd insert gets the unique constraint error.
To me, the PK principle is not broken: these are 3 different UTC dates. -
Unique constraint error on delete/insert
Hi,
I am using Jdeveloper 11.1.1.3.0. I have a ADF table where we can copy lines and delete lines. I get unique constraint error when I save. Looks like the insert operation in happening before the delete operation. Is there a way to set the execution order so that the logical behaviour is delete/update/insert.
Thanks
SVHi,
The unquie contraint is not from the primary key. There are three columns in the table (batch_id, line_number, line_type) which must be unique. In the UI, the user can delete lines, update lines and add lines and finally click the save button that does the commit. On delete the line_number gets re-numbered. So when committing, the unique error occurs because the line number already exists. Looks like insert is happening before update/delete. I cannot do commit after each delete/update/insert. I have to do it only if the user clicks the save button in the end. Is there a way to control the order of execution?
SR -
Unique Constraint Error at Apply side
We have streams configured between two databases. Source database is of Version 9.2.0.3 and target database is of 9.2.0.4
I have a table TEST with primary key PK_TEST on column A.
Performed the following steps on the source database:
Step1:
insert into test values (1);
1 row inserted.
Total no of lcr's propagated : 1
Step2:
insert into test values (1);
ORA-00001: unique constraint (TEST_USER.PK_TEST)violated.
Total no of lcr's propagated : 1
Step 3:
Commit;
Total no of lcr's propagated : 1
On the source database, i have only one row in the TEST table but in the target schema iam getting "ORA-00001: unique constraint" error on applying the lcr's propagated from the source. If i remove the constraint from the target table then two rows are getting inserted in the target table rather only one rows should be inserted in the target table.
Total 3 lcr's are propagated from source to target. For Step2, 2 lcr's should be propagated but only one is propagating.
It looks strange but this is what happening in our environment. Has anyone faced this problem before? Please let me know how to solve this problem.Hi,
I believe your problem is with the transaction.
1) First you insert a row
2) you try to insert it again, it fails
3) you commit your work
When propagated to your destination, the transaction does not commit because it failed in the second.
Try inserting, commit and inserting again. It should work that way. Or else you may need to write an error handler to ignore ORA-0001 errors and commit (which I don't think it is good practice).
Hope this helps, -
Help with unique constraint ERROR!!!
This error occurs after invoking a Stored Procedure program. When it tries to insert, the PK table goes beserk:
ORA-00001: unique constraint (HASUNI.THA_OTHER_ACTIVITY_PK) violated
ORA-06512: at "HASUNI.POPULATE_GDW_ACTIVITY", line 203
ORA-06512: at "HASUNI.GDW_MASTER", line 21
ORA-06512: at line 9
I tried to clear the PK table to get past the unique constraint error, but I can't seem to delete contents.
PLEASE HELP!!!!The other queries are erroring out. It doesn't like the HASUNI.THA_OTHER_ACTIVITY_PK. It says this is an undefined table.
Insert Statement:
INSERT INTO HASUNI.THA_OTHER_ACTIVITY <-- line 203
SELECT
viewActivity.GROUPID,
SUBSTR(viewActivity.MEMBERID,11,9)||SUBSTR(viewActivity.MEMBERID,21,9),
viewActivity.ACTIVITYSEQUENCE,
val_first_day,
TO_DATE('31DEC9999'),
viewActivity.PRODUCTID,
viewActivity.PRODPLANTYPE,
SUBSTR(viewActivity.MEMBERID,11,9),
SUBSTR(viewActivity.MEMBERID,21,9),
viewActivity.CLASSVAL,
viewActivity.PCC,
viewActivity.BRANCH,
viewActivity.ARC,
viewActivity.LOCATION,
viewActivity.MEMBERID,
viewActivity.DOB,
viewActivity.GENDER,
viewActivity.MEMBERSTATUS,
viewActivity.CHPNID,
viewActivity.SSN,
NULL,
NULL,
SUBSTR(viewActivity.ZIPCODE,1,5),
SUBSTR(viewActivity.ZIPCODE,7,4),
viewActivity.ST,
viewActivity.SOURCESYSTEMID,
viewActivity.SOURCE,
viewActivity.INITIATEDBY,
viewActivity.OUTCOMES,
viewActivity.OUTCOMESDATE,
viewActivity.INITACTDATE,
viewActivity.INITACTTAKEN,
viewActivity.INITACTTAKENDATE,
viewActivity.INITUSERID,
viewActivity.LASTMODUSRID,
viewActivity.LASTMODDATE,
'HAS',
val_last_day,
NULL
FROM
HASUNI.VW_GDW_ACTIVITY viewActivity,
HASUNI.HA_OUTREACH outreach
WHERE
viewActivity.MEMBERID IN (SELECT viewActivity.MEMBERID FROM HASUNI.VW_GDW_ACTIVITY viewActivity)
AND outreach.MMBR_ID = viewActivity.MEMBERID
AND viewActivity.INITACTTAKEN = 'OTHER'
AND (TRUNC(viewActivity.INITACTDATE) BETWEEN val_first_day AND val_last_day
OR (TRUNC(viewActivity.INITACTDATE) < val_first_day
AND TRUNC(viewActivity.LASTMODDATE) BETWEEN val_first_day AND val_last_day)); -
ORA-00001 - Unique Constraint error in Oracle forms 6i
Hi,
I am using Forms 6i. I have an issue while inserting records into a custom table. Below is the functionality.
When I check the check box, and press the 'APPROVE' button, the record gets inserted into the custom table. But while inserting I am getting 'ora-00001-unique constraint violated error'.
But the custom table doesn't have any data in it. (So the inserting record should not be a duplicate record).
Any suggestions would be of great help.
Thanks
DeeptiIs it a sql statement that is performing the insert, or are you using the native data block DML functionality in your form? Secondly have you identified candidate columns that could be causing your issue?
If you are using sql statement have you debugged to comfirm that you are not firing the same block of code more that once, and that if it is required to execute multiple times are you incrementing the sequence values that should be unique.
Regards
Q -
Unique Constraint error while executing statspack.snap procedure
The following is the error which popped up when i was trying to execute statspack.snap procedure from perfstat user:
ORA-00001: unique constraint (PERFSTAT.STATS$LATCH_CHILDREN_PK) violated
ORA-06512: at "PERFSTAT.STATSPACK", line 1619
ORA-06512: at "PERFSTAT.STATSPACK", line 71
ORA-06512: at line 1
How could i resolve such a problem, as all the constraints and objects for this user are created while running the oracle supplied script 'spcreate.sql'.
If any 1 knows how to handle such a situation , can come forward n please help me out.SQL> execute statspack.snap (i_snap_level=>10);
ERROR at line 1:
ORA-00001: unique constraint (PERFSTAT.STATS$LATCH_CHILDREN_PK) violated
ORA-06512: at "PERFSTAT.STATSPACK", line 1619
ORA-06512: at "PERFSTAT.STATSPACK", line 71
ORA-06512: at line 1
Cause
-- Its because of the bug # 2384758.
"STATSPACK.SNAP GIVES ORA-1 ON STATS$LATCH_CHILDREN_PK WHEN I_SNAP_LEVEL=>10"
-- The STATS$LATCH_CHILDREN table has a primary key constraint on (snap_id, dbid, instance_number, latch#, child#).
Fix
-- This is fixed in 9.0.2 and will not be backported to earlier versions because the level 10 is not a normal level to be setting unless requested by oracle support. -
Getting "unique constraint" error while mapping customized jsp
Hi,
We are implementing iStore R12 (12.1.3).
We have customized ibeCCtdMenu.jsp, renamed it as xxibeCCtdMenu.jsp and moved it to $OA_HTML/ folder.
Now in template manager, we are creating a new source file (xxibeCCtdMenu.jsp) under "Menu generation template".
However when we select site and language as "All", it gives following error:
Error in saving logical to physical mapping
ORA-00001: unique constraint (IBE.IBE_DSP_LGL_PHYS_MAP_U2) violated in Package IBE_PhysicalMap_GRP Procedure save_physicalmap
All sites and all language exists already exists for deliverable 7670
How can we overcome this error? Please advise.
Thanks,
Vivekfor a given combination of Site and Language, only one template can exists.
Default file provided by Oracle is set with combination as All Sites - All Languages, and you will not be able to change it.
Register your file with combination such as All Sites - English Language
or <specific site>, All language.
Then it will work fine.
Hrishikesh -
Unique constraint ERROR How to update the task order customly?
I am using DAC to load data from Siebel database into Oracle Business Analytic Data Warehouse for BI Apps. Now we encounter a question. I need some help.
When I run current execute plan, the Custom_shyy_SIL_ActivityFact is failured.Beause the *'unique constraint (SHYY_OLAP_DEV.W_ACTIVITY_F_U1) violated'* ORA_00001 ERROR. I analyse this question.At last, I think this question is caused with some below reason.
My custom execute plan include some Update Dimension from Dimension tasks. They are SIL_EmployeeDimension_SCDUpdate and SIL_ProductDimension_SCDUpdate and so no. that tasks that marked Update Dimension from Dimension run before the Custom_shyy_SIL_ActivityFact. And, in the w_product_d one integration_id corresponding with two records, but the curent_flag ='Y' recored is only. Now ,I Think the SDCU Task is run before the Load fact tack. I discoved it does't work. please help me !Hey
When Doing a full Load through DAC it drops all the unique indexes and then inserts the data and recreates the indexes again.The Index Creation fails if there are duplicate rows (Rows with same integration_id).
So start Checking the Data right from the Source Level.
First check the Source (do this using the integration_id thats repeating,Go through the informatica Mappings(ETL Mappings).
If its Fine there Come to the Staging Level and Check for Duplicate Columns.
Then Check in the final Table for Duplicate records.
My Guess is that you are having duplicate rows at the Source level.
If your are using informatica try using distinct for the SQL in the Source Qualifier(think that should block any duplicate records).
Update here If you are able to solve this.
Thanks
Hemanth -
Unique constraint error but key when inserting unique keys!
Hi,
I am tring to update an existing database with some older data, I am getting an error which complains about a unique constraint being violated although there is no voilation evident after testing.
I am puzzled by this and was wondering if someone could give me any extra info on another possible cause.
I googled but found that this error is caused by duplicating primary keys which I am not doing though I still get this error.
I run this query then the update and get the output below:
desc test_sales;
desc sales_order;
SELECT order_id FROM sales_order WHERE order_id IN (SELECT order_id FROM test_Sales);
INSERT INTO sales_order
(order_id,order_date,customer_id, ship_date,total)
SELECT
order_id,
order_date,
cust_id,
ship_date,
total
FROM
test_sales;
desc test_sales;
Name Null Type
------------------------------ -------- CUST_ID NUMBER(6)
OLD_SYSTEM_ID VARCHAR2(25)
DESCRIPTION VARCHAR2(35)
ORDER_DATE DATE
SHIP_DATE DATE
QUANTITY NUMBER
ORDER_ID NOT NULL NUMBER(4)
ITEM_ID NOT NULL NUMBER(4)
SITE_COUNT NUMBER(2)
TOTAL NUMBER(8,2)
PRODUCT_CODE NUMBER(6)
LIST_PRICE NUMBER(8,2)
12 rows selected
desc sales_order;
Name Null Type
------------------------------ -------- ORDER_ID NOT NULL NUMBER(4)
ORDER_DATE DATE
CUSTOMER_ID NUMBER(6)
SHIP_DATE DATE
TOTAL NUMBER(8,2)
5 rows selected
ORDER_ID
0 rows selected
Error starting at line 7 in command:
INSERT INTO sales_order
(order_id,order_date,customer_id, ship_date,total)
SELECT
order_id,
order_date,
cust_id,
ship_date,
total
FROM
test_sales
Error report:
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00001: unique constraint (MICHAELKELLY.SYS_C00210356) violatedMessage was edited by:
Mike1981
Message was edited by:
Mike1981ORA-00001: unique constraint (MICHAELKELLY.SYS_C00210356) violated
=> check dba_cons_columns to see what the constraint actually exists off -
CreateException: error message for unique constraint isn't very helpful
When I create a CMP bean in a table containing a unique constraint, I receive the expected CreateException. However, the error message looks like:
"Error creating EntityBean: ORA-00001: unique constraint (SID.SYS_C005934) violated"
This message isn't particularly helpful, especially if there are, say, three unique constraints, and the only difference is the "SYS_CXXXXXX" number. There is no way to tell which number applies to which constraint, and this makes it difficult to give a "readable" error message to the end-user.
Is there a way of either (a) Setting the error message to be thrown by a unique constraint violation or (b) A means of getting the column name that was the focus of the violation? Either of these would make it easier to map an "readable" error message to the exception.
Much thanks,
-RogerHi Roger,
How about trying to give meaningfull names while creating the table, so that when the exception is throw, it would be easy to find the column
which generated the exception.
something like,
SQL>create table table1
id number(10) constraint UNIQUE_TABLE1_ID unique
Table created
SQL> insert into table1 values(1);
1 row created.
SQL> insert into table1 values(1);
insert into table1 values(1)
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.UNIQUE_TABLE1_ID) violated
Hope this helps
Regards
Elango.
Maybe you are looking for
-
Error while compiling CUSTOM.PLL with frmcmp_batch
We have a strange issue here. One of the users is unable to compile custom.pll . He is getting the issue PDE-PLI038 Cannot open file for use as a PL/SQL Library This is the below file permission for the custom.pll -rwxrwxrwx 1 applmgr oaa 20480 Apr 2
-
How do change the default "Save As" from PSD to JPG?
I know a while back, Photoshop was offering to save my files as JPEGs as default. But now it defaults to saving as a PSD file, and I am having some difficulty figuring out how to make it save as a JPG file instead. OS: CS 5.1 Production Premium, Mac
-
Want to make iTunes and mac apple id's the same
Having issues with iTunes purchases and discovered that apple id on my mac is different from apple id in iTunes. I know I can't merge apple id's and it won't let me change apple id on mac to the iTunes apple id. Says that apple id is already in use
-
Excluding Block for Payment Invoice from Correspondance list in F.62 tran
Hi All, My requirement is Excluding those invoices for which Payment Block indicator is 'P' from Correspondance List in Transaction F.62 for SAP11 Variant. i.e. BSEG-ZLSPR = 'P'. Kindly advise me is there any BADI or User Exit or any other possibilit
-
What file types get classed as 'Movies' in Macbook Pro?
I'm creating space on my Macbook hard drive by moving movies onto a hard drive. I've moved virtually all of them over, and emptied the trash can. However a system storage report is still showing 59GB of movies. What else does macbook class as movi