Icxr12mi.sql fails on ORA-00001
Dear All,
When applying patch 6678700 to UPGRADE FROM 11.5.10.2 TO 12.1.1, it was failed on icxr12mi.sql and showed following error:
sqlplus -s APPS/***** @/erpapfs/erpprod/apps/apps_st/appl/icx/12.0.0/patch/115/sql/icxr12mi.sql &un_inv &batchsize 4 28
DECLARE
ERROR at line 1:
ORA-20000: icxr12mi.sql(1700): ORA-00001: unique constraint
(ICX.ICX_CAT_ITEMS_CTX_HDRS_TLP_PK) violated
ORA-06512: at line 215
HELP!!!
Thanks,
Jackie
Edited by: Jackie Han on Jul 6, 2011 2:12 AM
Hi,
Pls check solution provided in below MOS:-
Upgrade From 11.5.10 To 12.1 Failing On ICXR12MI.SQL Unique Constraint [ID 1050849.1]
Errors On Script icxr12mi.sql During Upgrade To Release 12.1.1 - ORA-20000 ORA-01403 ORA-06512 [ID 1114603.1]
Icxr12mi.Sql Getting Unique Constraint Error While Applying Driver U4440000.Drv [ID 464798.1]
Thanks,
JD
Similar Messages
-
Business Rule Design Transformer fails with ORA-00001
I'm stuck with the Business Rule Design Transformer Utility of Headstart. After running this utility over one BR it is impossible to run it over other BR's because of violation of the unique constraint HST65.QMS_MSP_PK (table QMS_MESSAGE_PROPERTIES). The problem is that the utility tries to insert a record (message, specified in the Notes property of Designer) into QMS_MESSAGE_PROPERTIES with the code "ABI-10000", that was already created by running the utility for the first time.
Exact error message: "Activity aborted with ORACLE internal errors.
-1 ORA-00001: unique constraint (HST65.QMS_MSP_PK) violated"
I'm using Designer 6i (6.5.52.1.0) and Headstart 6.5.1.3
If someone has any clue about this I would be very grateful
Cheers,
DimceJan,
The name of the business rule is already in the CONSTRAINT_NAME of the QMS_MESSAGE_PROPERTIES table.
I already tested by deleting the records in the two tables, QMS_MESSAGE_PROPERTIES and QMS_MESSAGE_TEXT, and ran the utility, but it didn't help either. I can run the utility for one rule, but when I want to run it again at some later point, it fails with this error.
But, I managed to create rule definitions using the HSU Create Business Rule Design Definition, rule by rule. I only had to add references in the business rule to the used module.
Dimce -
How to resolve ORA-00001 Error in SQL Insert?
Hi all, I need your appreciated help.
I make a plsql procedure that is inserting a row according cursor value, I'm having oracle error ORA-00001: unique constraint (constraint_name) violated.
You may see this message if a duplicate entry exists at a different level: in RDBMS MySQL I have the syntax IGNORE to resolve this duplication error... and in Oracle ?
Thanks for your time and hints.
Miguelitouser6317803 wrote:
How to resolve ORA-00001 Error in SQL Insert?ORA-00001 means table has unique/primary key/index and you are trying to insert a row with key value that already exists in the table. I'll assume table COUNTRIES has primary key on COUNTRY_ID. Then change SQL to:
SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ')"There is a good chance table COUNTRIES also has unique key/index on COUNTRY_NAME. If so use:
SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ' OR COUNTRY_NAME = 'BLZ')"SY. -
While creating a simple VIEW Error comes ORA-00604,ORA-00001
I am using
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
a simple view statement gives an error.
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_COL1) violated
what may be the reasonHi,
It seems that SHORT_NAME cause problem.
SQL> CREATE OR REPLACE FORCE VIEW V_META_IMAGELIST
2 AS
3 SELECT A.SEQ_NUM, A.SHORT_NAME, A.DESCRIPTION, A.MULTISELECT, A.ENTITY_SEQ_NUM, A.SECTION_TYPE_
SEQ_NUM,
4 B.SHORT_NAME, A.ACTIVE, A.ENTERED_BY,
5 A.ENTRY_DATE, A.IMAGELIST_LEVEL, A.STARTINGSENTENCE, A.SEPARATOR, A.CONJUNCTION, A.ENDINGSENTEN
CE,
6 A.META_IMAGELIST_ELEMENT_SEQ_NUM
7 FROM meta_imagelist A, SECTION_TYPES B
8 WHERE A.SECTION_TYPE_SEQ_NUM = B.SEQ_NUM(+) ;
B.SHORT_NAME, A.ACTIVE, A.ENTERED_BY,
ERROR at line 4:
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_COL1) violated
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE FORCE VIEW V_META_IMAGELIST
2 AS
3 SELECT A.SEQ_NUM, A.SHORT_NAME, A.DESCRIPTION, A.MULTISELECT, A.ENTITY_SEQ_NUM, A.SECTION_TYPE_
4 B.SHORTNAME, A.ACTIVE, A.ENTERED_BY,
5 A.ENTRY_DATE, A.IMAGELIST_LEVEL, A.STARTINGSENTENCE, A.SEPARATOR, A.CONJUNCTION, A.ENDINGSENTEN
6 A.META_IMAGELIST_ELEMENT_SEQ_NUM
7 FROM meta_imagelist A, SECTION_TYPES B
8* WHERE A.SECTION_TYPE_SEQ_NUM = B.SEQ_NUM(+)
SQL> /
Warning: View created with compilation errors. --this is because I haven't any tables
SQL> show error
No errors.
SQL> Try to rename SHORT_NAME to an other word.
Nicolas. -
RMAN backup fails atlast during resync catalog with ORA-00001
Hi Everyone,
Database version:10.2.0.2.0
single instance database
My Rman backups were running fine but today i got the error , almost at the end of backup
Finished Control File and SPFILE Autobackup
released channel: t1
released channel: t2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03008: error while performing automatic resync of recovery catalog
ORA-00001: unique constraint (RMAN.CKP_P) violated
Recovery Manager complete.
This problem occured 2 days before.I connected to catalog and ran a resync catalog and the backup worked fine for next day.
Now again today iam experiencing the same problem.
Any help would be greatThanks for the reply
SQL> select * from rman.rcver;
VERSION
10.02.00.00
10.02.00.02
when i do the resync catalog manually it works fine.only during the end of backup it throws me the error;
was wondering whether can i disable the primary key constraint on CKP table so that i can avoid the error.
since its a live system im thinking lot before i do anything
Thanks
Edited by: centerB on 14-Apr-2011 06:40
Edited by: centerB on 14-Apr-2011 06:57
Edited by: centerB on 14-Apr-2011 07:03 -
ORA-00001: unique constraint during "Configure Database Security Store for OIM Domain"
Hi Guru's,
I am following the below steps for OIM 11.1.2.1 with SOA 11.1.1.7 Installation and facing below error during step "Configure Database Security Store for OIM Domain".
Installed Database 11.2.0.3
Installed RCU (Here I used two versions.
RCU 11.1.2 - Used IDAM prefix for (Metadata Services, OPSS, OIM)
RCU 11.1.1.7 - Used SOA prefix for(Metadata Services,SOA Infrastructure, User Messaging service)
Installed JDK 7 (Java 1.7)
Installed WL 10.3.6 (MW_HOME-/u01/Middleware/fmw, WL_HOME=/u01/Middleware/fmw/wlserver_10.3)
Installed FMW 11.1.2.1 for OIM. (ORACLE_HOME=Oracle_IDM1)
Installed FMW 11.1.1.7 for SOA (ORACLE_HOME=Oracle_SOA1)
WL Domain creation. (Domain Name – idam_domain1)
Configure Database Security Store for OIM Domain.
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (IDAM_OPSS.IDX_JPS_RDN_PDN) violated
Also followed the below bug solution, but issue still occurs.
Bug 16690836 : CONFIGURE DATABASE SECURITY STORE (CONFIGURESECURITYSTORE.PY) SCRIPT IS FAILING
@ 1. Delete the Schemas using RCU.
@ 2. Recreate the OAM schemas.
@ 3. Reinstall the WLS and OAM software.
@ 4. Run config.sh to create a new domain.
@ 5. Run setDomainEnv.sh from user_projects/domains/<Domain_name>/bin
@ 6. Run the configureSecurityStore.py from same window.
Not sure if anyone tried with different steps that fixed the issue? Could you please help.
Thanks
VGHi Gurus, I got the solution from Oracle. SOA 11.1.1.7.0 shouldn't be used with Identity Management 11.1.2.1.0(11GR1-PS1) version. Identity Management 11.1.2.1.0(11GR1-PS1) is bundled with SOA 11.1.1.6.0. When used this SOA version, Installation went smooth. Thanks VG
-
Bulk table update returning ORA-00001: unique constraint
I'm trying to update every record in a PROPERTY table that has a CLASS of either 1 or 9 and a STATUS of 'LHLD'. CLASS and STATUS descriptor records are in different tables to the PROPERTY table but reference the PROPERTY records by the PROPERTY tables unid.
I have wrote the following update command,
UPDATE RNT_PROPERTY_DESCRIPTOR SET DESCRIPTOR = 'PROP', DESCRIPTOR_VALUE = '1', EFFECT_DATE = '01-APR-04', USER_ID = 'USER'
WHERE RNT_PROPERTY_DESCRIPTOR.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROPERTY_CLASS_STATUS
WHERE PROPERTY_CLASS_STATUS.PROP_CLASS = '1'
OR PROPERTY_CLASS_STATUS .PROP_CLASS = '9'
AND PROPERTY.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROP_STATUS_HIST
WHERE PROP_STATUS_HIST.code = 'LHLD'));
However, after executing for around 10 mins the process update fails and the following error is returned:
ORA-00001: unique constraint (RNT_PROPERTY_DESCRIPTOR_IDX) violated
I know that the IDX suffix refers to the table INDEX but I'm not sure why I'm getting a key constraint, none of the colums that I'm trying to update must be unique.
For info the PROPERTY table has around 250,000 rows.
Any ideas? Is there an error in my update statement?
Thanks in advance.Gintsp,
can you explain a little more? I'm not sure what you are suggesting that I try.
Here is the output of what I have tried
SQL> UPDATE RNT_PROPERTY_DESCRIPTOR SET DESCRIPTOR = 'PROP', DESCRIPTOR_VALUE = '1', EFFECT_DATE = '01-APR-04', USER_ID = 'USER'
2 WHERE RNT_PROPERTY_DESCRIPTOR.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROPERTY_CLASS_STATUS
3 WHERE PROPERTY_CLASS_STATUS.PROP_CLASS = '1'
4 OR PROPERTY_CLASS_STATUS.PROP_CLASS = '9'
5 AND PROPERTY.UNID IN (SELECT PROPERTY.UNID FROM PROPERTY, PROP_STATUS_HIST
6 WHERE PROP_STATUS_HIST.CODE = 'LHLD'));
UPDATE RNT_PROPERTY_DESCRIPTOR SET DESCRIPTOR = 'PROP', DESCRIPTOR_VALUE = '1', EFFECT_DATE = '
ERROR at line 1:
ORA-00001: unique constraint (RNT_PROPERTY_DESCRIPTOR_IDX) violated
SQL> select owner, constraint_type, table_name, search_condition from user_constraints where constraint_name = 'RNT_PROPERTY_DESCRIPTOR_IDX';
no rows selected
The RNT_PROPERTY_DESCRIPTOR table structure is as follows:
Name Null? Type
UPRN NOT NULL NUMBER(7)
DESCRIPTOR NOT NULL VARCHAR2(4)
DESCRIPTOR_VALUE VARCHAR2(11)
EFFECT_DATE NOT NULL DATE
VALUE_DESCRIPTION VARCHAR2(35)
POINTS NUMBER(2)
POUNDS NUMBER(5,2)
SUPERSEDED VARCHAR2(1)
CURRENT_FLAG VARCHAR2(1)
FUTURE VARCHAR2(1)
END_EFFECT_DATE DATE
USER_ID NOT NULL VARCHAR2(10)
CREATE_DATE DATE
------------------------------------------------------------- -
ORA-00604: error occurred at recursive SQL level 1 ORA-01882: timezone
Hi
I'm trying to config my base_domain for SOA11g but i'm getting the following error when connecting to my Oracle XE DB to configure SOA,
please help thanks
Software installed
OS: Windows 7 64bit
DB: Oracle XE 10g
Oracle SOA 11.1.1.4.0
Oracle RCU 11.1.1.4.0
Oracle wls1034_generic
Error Detials
Component Schema=SOA Infrastructure
Driver=oracle.jdbc.xa.client.OracleXADataSource
URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
User=DEV_SOAINFRA
Password=********
SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='SOAINFRA' and version='11.1.1.4.0'
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
CFGFWK-60850: Test Failed!
Component Schema=User Messaging Service
Driver=oracle.jdbc.OracleDriver
URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
User=DEV_ORASDPM
Password=********
SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='ORASDPM' and version='11.1.1.2.0'
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
CFGFWK-60850: Test Failed!
Component Schema=OWSM MDS Schema
Driver=oracle.jdbc.OracleDriver
URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
User=DEV_MDS
Password=********
SQL Test=select 1 from schema_version_registry where
owner=(select user from dual) and mr_type='MDS' and
version='11.1.1.4.0'
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
CFGFWK-60850: Test Failed!
Component Schema=SOA MDS Schema
Driver=oracle.jdbc.OracleDriver
URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
User=DEV_MDS
Password=********
SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='MDS' and version='11.1.1.4.0'
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
CFGFWK-60850: Test Failed!
Component Schema=OSB JMS Reporting Provider
Driver=org.apache.derby.jdbc.ClientDriver
URL=jdbc:derby://127.0.0.1:1521/XE;create=true;ServerName=127.0.0.1;databaseName=XE
User=DEV_SOAINFRA
Password=********
SQL Test=SELECT 1 FROM SYS.SYSTABLES
Insufficient data while reading from the network - expected a minimum of 6 bytes and received only 0 bytes. The connection has been terminated.
CFGFWK-60850: Test Failed!Hi,
Please check the timezone set in your server where Weblogic is installed. Also ensure the timezone on which your weblogic is running, the same is present in in database by querying V$TIMEZONE_NAMES table. If it is not present then please change the timezone of the server. then try to execute the steps what you are doing, it will not throw any error.
if this helps please mark.
Thanks,
Kishore -
Hi all,
i have the following code:
DROP TYPE unit_function FORCE
DROP TYPE unit_moving_point FORCE
DROP TYPE moving_point_tab FORCE
DROP TYPE moving_point FORCE
DROP TABLE moving_object_ref
DROP TABLE moving_point_ref
CREATE OR REPLACE TYPE unit_function AS OBJECT
xi NUMBER,
yi NUMBER
CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
p tau_tll.d_period_sec,
m unit_function
CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
CREATE OR REPLACE TYPE moving_point AS OBJECT
u_tab moving_point_tab
CREATE TABLE moving_point_ref OF moving_point NESTED TABLE u_tab STORE AS m_u_tab
When i execute this for the first time the drop commands fail, as expected and the types/tables are successfully created. But if i try to run again the same code i get this error:
ORA-00604: error occurred at recursive SQL level 1 ORA-04063: table "HERMESL.MOVING_POINT_REF" has errors
I have tried to first drop the tables and after the types but then I get this error:
ORA-00604: error occurred at recursive SQL level 1 ORA-22914: DROP of nested tables not supported
this error occurs when the "DROP TYPE unit_function FORCE" and "DROP TYPE unit_moving_point FORCE" commands is to be executed...
Can anyone help me?
Thanks...Works on 10.1.0.3.
What is your exact version?
SQL> DROP TYPE unit_function FORCE
2 /
DROP TYPE unit_function FORCE
ERROR at line 1:
ORA-04043: object UNIT_FUNCTION does not exist
SQL> DROP TYPE unit_moving_point FORCE
2 /
DROP TYPE unit_moving_point FORCE
ERROR at line 1:
ORA-04043: object UNIT_MOVING_POINT does not exist
SQL> DROP TYPE moving_point_tab FORCE
2 /
DROP TYPE moving_point_tab FORCE
ERROR at line 1:
ORA-04043: object MOVING_POINT_TAB does not exist
SQL> DROP TYPE moving_point FORCE
2 /
DROP TYPE moving_point FORCE
ERROR at line 1:
ORA-04043: object MOVING_POINT does not exist
SQL> DROP TABLE moving_object_ref
2 /
DROP TABLE moving_object_ref
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> DROP TABLE moving_point_ref
2 /
DROP TABLE moving_point_ref
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT
2 (
3 xi NUMBER,
4 yi NUMBER
5 );
6 /
Type created.
SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
2 (
3 m unit_function
4 );
5 /
Type created.
SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
2 /
Type created.
SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT
2 (
3 u_tab moving_point_tab
4 );
5 /
Type created.
SQL> CREATE TABLE moving_point_ref OF moving_point
2 NESTED TABLE u_tab
3 STORE AS m_u_tab
4 /
Table created.
SQL> DROP TYPE unit_function FORCE
2 /
Type dropped.
SQL> DROP TYPE unit_moving_point FORCE
2 /
Type dropped.
SQL> DROP TYPE moving_point_tab FORCE
2 /
Type dropped.
SQL> DROP TYPE moving_point FORCE
2 /
Type dropped.
SQL> DROP TABLE moving_object_ref
2 /
DROP TABLE moving_object_ref
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> DROP TABLE moving_point_ref
2 /
Table dropped.
SQL>
SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT
2 (
3 xi NUMBER,
4 yi NUMBER
5 );
6 /
Type created.
SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
2 (
3 m unit_function
4 );
5 /
Type created.
SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
2 /
Type created.
SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT
2 (
3 u_tab moving_point_tab
4 );
5 /
Type created.
SQL> CREATE TABLE moving_point_ref OF moving_point
2 NESTED TABLE u_tab
3 STORE AS m_u_tab
4 /
Table created.
SQL> disconnect
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options -
Scheduled Web Intelligence report fails with ORA-01013 and WIS 10901
Hi,
the environment I'm working in is BOXI R2 SP4 on a Solaris 10 server using WebLogic running against Oracle 9i database.
I have a report written by one of the users. In SQL Viewer the SQL detailed is two joined Select statements. Each time this report is either scheduled or refreshed is fails with an ORA-01012 and WIS 10901 error.
I am of the understanding that this failure relates to the fact that the 'Limit Execution Time To;' value is being exceeded.
I also understand that this value is infact divided by the number of Select statements present, and that each Select statment is them allocated an equal portion of this value.
If any of this is incorrect please correct me.
I therefore have two questions
1. As such would I be correct in assuming that in my scenario where 2 Select statments are present and where the execution limit is set to 30 minutes, that each Select has 15 minutes to complete, and that if either fails the ORA-01012 and WIS 10901 error is generated.
2. Also would this error message get generated as soon as the first failure occurred, or would BO initiate a cancellation of the SQL by Oracle, ORA-01012, only when the final request has either succeeded or failed.The queries are not executed in parallel but in serial. So the total execution time configured will be for all the Select statements in the report combined.
As for your second question, since the execution is not parallel hence BO will not initiate any error message until the total execution time exceeds the defined limit. This could be during the execution of first select statement or the second.
Try executing the queries directly in database one by one and see how much time they are taking.
- Noman Jaffery -
Hi everybody
I can't understand why my data pump import execution with parameter TABLE_EXISTS_ACTION=TRUNCATE returned ORA-00001 (unique constraint violation), while importing schema tables from a remote database where the source tables have the same unique constraints as the corresponding ones on the target database.
Now my question is "If the table would be truncated, why I get unique constraint violation when inserting records from a table where the same unique constraint is validated?
Here are the used parameter file content and the impdp logfile.
parfile
{code}
DIRECTORY=IMPEXP_LOG_COLL2
CONTENT=DATA_ONLY
NETWORK_LINK=PRODUCTION
PARALLEL=1
TABLE_EXISTS_ACTION=TRUNCATE
EXCLUDE=STATISTICS
{code}
logfile
{code}
Import: Release 10.2.0.1.0 - Production on Gioved� 22 Ottobre, 2009 15:33:44
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connesso a: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "IMPEXP"."PROVA_REFRESH_DBCOLL": impexp/********@dbcoll SCHEMAS=test_pump LOGFILE=test_pump.log parfile=refresh_dbcoll.par JOB_NAME=prova_refresh_dbcoll
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 523 MB
ORA-31693: Table data object "TEST_PUMP"."X10000000_TRIGGER" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (TEST_PUMP.SYS_C00726627) violated
ORA-31693: Table data object "TEST_PUMP"."X10000000_BASIC" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (TEST_PUMP.SYS_C00726625) violated
Job "IMPEXP"."PROVA_REFRESH_DBCOLL" completed with 2 error(s) at 15:34:04
{code}
Thank you
Bye AlessandroI forgot to read the last two lines of the documentation about TABLE_EXISTS_ACTION where it says:
"TRUNCATE cannot be used on clustered tables or over network links."
So it seems that it ignored the clause for the use of NETWORK_LINK and unreasonably opted for an APPEND action instead of throwing an error to highlight the conflicting parameters in the used configuration.
Bye Alessandro -
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 while inserting 2 similar records from source
Hi,
in TEST1 there are records:
10 20 ABC
10 20 DEF
I amt trying to insert into TEST which has CODE as Primary Key.
declare
type cur is ref cursor;
cur_t cur;
type v_t is table of TEST%rowtype;
tab v_t;
v_act_cnt_str VARCHAR2(4000);
v_act_cnt NUMBER:=0;
BEGIN
v_act_cnt_str:=' SELECT COUNT(*) '||' FROM TEST '||' WHERE '||'('||CODE||')'||' IN '||'('||'SELECT '||CODE||' FROM TEST1'||')';
DBMS_OUTPUT.PUT_LINE('The Actual Count String is'||v_act_cnt_str);
EXECUTE IMMEDIATE v_act_cnt_str INTO v_act_cnt;
open cur_t for select * from TEST1 ORDER BY ROWNUM;
loop
fetch cur_t bulk collect into tab limit 10000;
if v_act_cnt=0 THEN
forall i in 1..tab.count
insert into TEST values tab(i);
commit;
ELSE
v_merge_act_str :=
'MERGE INTO TEST '||
' DEST' || ' USING TEST1 '||
' SRC' || ' ON (' || DEST.CODE=SRC.CODE || ')' ||
' WHEN MATCHED THEN ';
first_str := 'UPDATE ' || ' SET ' ||
'DEST.NAME=SRC.NAME,DEST.DEPT_NAME=SRC.DEPT_NAME;
execute immediate v_merge_act_str || first_str;
v_merge_act_str := '';
first_str := '';
commit;
END IF;
end loop;
END;
ITS GIVING ERROR as:
ORA-00001: unique constraint (PK_TEST1) violated
Any help will be needful for me
Edited by: user598986 on Sep 22, 2009 4:20 AM
Edited by: user598986 on Sep 22, 2009 4:22 AMYour code makes absolutely no sense whatsover. The whole point of MERGE is that it allows us to conditionally apply records from a source table as inserts or updates to a target table. So why have you coded two separate statements? And why are you using such horrible dynamic SQL?
Sorry to unload on you, but you seem to have your code unnecessarily complicated, and that it turn makes it unnecessarily harder to debug. As an added "bonus" this approach will also perform considerably slower than a single MERGE statement. SQL is all about set operations. Don't do anything procedurally which can be done in a set.
Cheers, APC
blog: http://radiofreetooting.blogspot.com -
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 -
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.
Maybe you are looking for
-
Firmware upgrade from 2.1(3a) to 2.1(3b).
I don't find any documentation on the web for firmware upgrade from 2.1(3a) to 2.1(3b).. is it wise to follow this link http://www.cisco.com/en/US/docs/unified_computing/ucs/sw/upgrading/from1.4/to2.1/b_UpgradingCiscoUCSFrom1.4To2.1.html Any best pra
-
I m using Macbook Air 2013 model, recently i m facing wifi disconnection problem on my mac. It keeps disconnect for few mins and reconnect automatically. And this disconnecting & reconnecting continues for regular interval (5 mins once). Its really m
-
How to start IGS on our portal/java server?
We are running Portal EP6 sp21 / Netweaver 2004 and require IGS to display some performance graphs. Ive created the RFC connection, and the jCo connector on the java engine, the SM59 'test connection' works. I see an IGS directory on our portal/j2ee
-
Html text anchor tag uses the whole line
Here's one. When I pull in html formatted text into a text field and set the paragraph to align right, the whole line is set as a link. Is there anyway to make it so the link is not made for the whole line? Example: <p align="right"><a href="link">Li
-
Updating internal table in loop
Hi All, UID GRP1 GRP2 UPD1 001 1 1 1 001 1 2 2 001 1 3 3 001 2 4 1 002 1 3 1 002 1 2 2 003 1 4 1 004 1 1 1 004 2