ORA-00001 error
Hi all,
After we restarted portal,we cannot start jcontrol,and we get a strange ORA-00001 error,when we check the log:
Here is the log defaulttrace:
Date : 12/10/2007
Time : 15:13:26:500
Message : ORA-00001: unique constraint (SAPSR3DB.SYS_C005260) violated
com.sap.caf.eu.gp.base.exception.EngineException: ORA-00001: unique constraint (SAPSR3DB.SYS_C005260) violated
at com.sap.caf.eu.gp.model.pfw.wfc.local.db.impl.AbstractLocalProcessPersistence.createBlockInputLocal(AbstractLocalProcessPersistence.java:904)
at com.sap.caf.eu.gp.model.pfw.wfc.local.db.impl.LocalProcessPersistence.createBlock(LocalProcessPersistence.java:250)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.startBlock(StatusWriter.java:984)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.startActivity(StatusWriter.java:927)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.changeParentBlockStatus(StatusWriter.java:2710)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.changeParentBlockStatus(StatusWriter.java:2728)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.updateProcessStatusUserDecisionBlock(StatusWriter.java:2574)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.updateProcessStatus(StatusWriter.java:2235)
at com.sap.caf.eu.gp.model.pfw.wfc.local.status.StatusWriter.completeAction(StatusWriter.java:223)
at com.sap.caf.eu.gp.model.pfw.wfc.local.impl.LocalWorkflowConnector.completeAction(LocalWorkflowConnector.java:247)
at com.sap.caf.eu.gp.model.pfw.wfc.local.impl.BackGroundActionProcessorHelper.processAction(BackGroundActionProcessorHelper.java:223)
at com.sap.caf.eu.gp.model.pfw.wfc.local.impl.queue.BackgroundCOQueueProcessor.run(BackgroundCOQueueProcessor.java:269)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPSR3DB.SYS_C005260) violated
at com.sap.sql.jdbc.common.CommonPreparedStatement.executeUpdate(CommonPreparedStatement.java:259)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:240)
at com.sap.caf.eu.gp.model.pfw.wfc.local.db.impl.AbstractLocalProcessPersistence.createBlockInputLocal(AbstractLocalProcessPersistence.java:901)
... 15 more
And i also check the startlog.It seems ok.
Someone knows what's happening and how to solve this?
Best regards
delma
Hi,Shikhil
Thank you for your reply.
But actually,we just install a WEB AS FOR JAVA on the portal server,no ABAP at all.
I think it may be the database problem.
Thank you.
Best regards
delma
Similar Messages
-
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. -
ORA: 00001 error when issued commit_form
I have a question about finalizing the changes when using commit_form.
There is a database trigger on the table which records all the changes update, insert, delete into an audit table. The actual sequence of actions going on in the form are
1. Update a row in a table (No explicit update stmt is issued as the block is a database block)
2. Key-Commit(issues commit_form)
3. Delete the same row which was previously updated (happens thru explicit delete stmt in the Post-Forms-Commit/Post-Database-Commit
4. forms_ddl(commit_form)
Actions 1 & 2 are working fine. Action 3 is throwing an error ORA: 00001. And if the trigger is disabled then the form is working fine.
I wanna know if the forms issues a commit_form, will it finalizes the changes in the database or will it waits for the post-forms-commit trigger to get completed and then finalizes the changes.
Can anyone help me with this?
Thanks for your timeHere is the help on Post-Database-Commit Trigger:
Fires once during the Post and Commit Transactions process, after the database commit occurs. Note that the Post-Forms-Commit trigger fires after inserts, updates, and deletes have been posted to the database, but before the transaction has been finalized by issuing the Commit.
I think you are fine at this point, as long as you use changed values in the WHERE clause of your DELETE statement.
ORA: 00001 is violation of UNIQUE CONSTRAINT, which really does not make any sense in context of DELETE statement, because you are not adding a new record but deleting one (Step 3).
With limited info I have here, I think that you are running into constraint issues on your audit table, because update and delete are happening almost at the same time, and you will be effectively getting two records in your audit table, that depending how UNIQUE constraints are setup on your audit table might cause the issue.
By the way it boggles my mind: why would you change and delete record from the table at the same time? -
Hi all,
I am facing 'ora-00001: Unique constraint(SYSMAN.MGMT_PRIV_GRANTS_PK) violated' while upgrading 10.2.0.4 database to 11.2.0.3 using DBUA. Need urgent help in resolving this.
Thanks
SandeepHi srini,
Yes, all the actions required by pre-upgrade tool are performed.
In our case dbua related logs are present in $ORACLE_BASE/cfgtoollogs/dbua/logs folder.
Files under this folder are:
1.) sqls.log 2.) trace.log
Last 100 lines from trace.log file
[Thread-52] [ 2012-10-24 13:59:01.749 GMT+05:30 ] [Util.<init>:95] Util Instance created.
[Thread-52] [ 2012-10-24 13:59:01.762 GMT+05:30 ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: null
[Thread-52] [ 2012-10-24 13:59:01.768 GMT+05:30 ] [InventoryUtil.getOUIInvSession:347] setting OUI READ level to ACCESSLEVEL_READ_LOCKLESS
[Thread-52] [ 2012-10-24 13:59:01.769 GMT+05:30 ] [OracleHome.getVersion:908] Homeinfo /nhi2/app/oracle11g/product/11.2.0/dbhome_1,7
[Finalizer thread] [ 2012-10-24 13:59:01.822 GMT+05:30 ] [Util.finalize:126] Util: finalized called for oracle.ops.mgmt.has.Util@a360a36
[Finalizer thread] [ 2012-10-24 13:59:01.822 GMT+05:30 ] [Util.finalize:126] Util: finalized called for oracle.ops.mgmt.has.Util@1700170
[Thread-52] [ 2012-10-24 13:59:01.960 GMT+05:30 ] [OracleHome.getVersion:936] OracleHome.server.getVersion Version: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:01.960 GMT+05:30 ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:01.960 GMT+05:30 ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:01.961 GMT+05:30 ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:01.961 GMT+05:30 ] [CommonUtils.createPasswordFile:604] calling new orapwd for 11.1 or higher
[Thread-52] [ 2012-10-24 13:59:01.963 GMT+05:30 ] [OsUtilsBase.execProg:2183] beginning execProg with input array.
[Thread-52] [ 2012-10-24 13:59:02.046 GMT+05:30 ] [OsUtilsBase.execProg:2220] finished execProg with input array. Status:0
[Thread-52] [ 2012-10-24 13:59:02.046 GMT+05:30 ] [OracleHome.initOptions:1236] Initializing Database Options with for dummy sid=DBUA5901749 using initfile=/nhi2/app/oracle11g/product/11.2.0/dbhome_1/dbs/initDBUA5901749.ora using pwdfile=/nhi2/app/oracle11g/product/11.2.0/dbhome_1/dbs/orapwDBUA5901749
[Thread-52] [ 2012-10-24 13:59:02.047 GMT+05:30 ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.047 GMT+05:30 ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.047 GMT+05:30 ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.047 GMT+05:30 ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.047 GMT+05:30 ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.048 GMT+05:30 ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.048 GMT+05:30 ] [SQLPlusEngine.getCmmdParams:222] m_home 11.2.0.3.0
[Thread-52] [ 2012-10-24 13:59:02.048 GMT+05:30 ] [SQLPlusEngine.getCmmdParams:223] version > 112 true
[Thread-52] [ 2012-10-24 13:59:02.048 GMT+05:30 ] [SQLEngine.getEnvParams:555] Default NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[Thread-52] [ 2012-10-24 13:59:02.049 GMT+05:30 ] [SQLEngine.getEnvParams:565] NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[Thread-52] [ 2012-10-24 13:59:02.049 GMT+05:30 ] [SQLEngine.initialize:325] Execing SQLPLUS/SVRMGR process...
[Thread-52] [ 2012-10-24 13:59:02.087 GMT+05:30 ] [SQLEngine.initialize:362] m_bReaderStarted: false
[Thread-52] [ 2012-10-24 13:59:02.090 GMT+05:30 ] [SQLEngine.initialize:366] Starting Reader Thread...
[Thread-52] [ 2012-10-24 13:59:02.227 GMT+05:30 ] [OracleHome.initOptions:1248] executing: startup nomount pfile='/nhi2/app/oracle11g/product/11.2.0/dbhome_1/dbs/initDBUA5901749.ora'
[Thread-52] [ 2012-10-24 13:59:29.944 GMT+05:30 ] [OracleHome.initOptions:1259] executing: select parameter from v$option where value='TRUE'
[Thread-52] [ 2012-10-24 13:59:29.966 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Partitioning is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Objects is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Advanced replication is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Bit-mapped indexes is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Connection multiplexing is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Connection pooling is ON
[Thread-52] [ 2012-10-24 13:59:29.967 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Database queuing is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Incremental backup and recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Instead-of triggers is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Parallel backup and recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Parallel execution is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Parallel load is ON
[Thread-52] [ 2012-10-24 13:59:29.968 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Point-in-time tablespace recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.969 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Fine-grained access control is ON
[Thread-52] [ 2012-10-24 13:59:29.969 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Proxy authentication/authorization is ON
[Thread-52] [ 2012-10-24 13:59:29.969 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Change Data Capture is ON
[Thread-52] [ 2012-10-24 13:59:29.969 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Plan Stability is ON
[Thread-52] [ 2012-10-24 13:59:29.969 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Online Index Build is ON
[Thread-52] [ 2012-10-24 13:59:29.972 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Coalesce Index is ON
[Thread-52] [ 2012-10-24 13:59:29.972 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Managed Standby is ON
[Thread-52] [ 2012-10-24 13:59:29.972 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Materialized view rewrite is ON
[Thread-52] [ 2012-10-24 13:59:29.973 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Database resource manager is ON
[Thread-52] [ 2012-10-24 13:59:29.973 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Spatial is ON
[Thread-52] [ 2012-10-24 13:59:29.973 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Export transportable tablespaces is ON
[Thread-52] [ 2012-10-24 13:59:29.973 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Transparent Application Failover is ON
[Thread-52] [ 2012-10-24 13:59:29.973 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Fast-Start Fault Recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Sample Scan is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Duplexed backups is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Java is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option OLAP Window Functions is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Block Media Recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.974 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Fine-grained Auditing is ON
[Thread-52] [ 2012-10-24 13:59:29.975 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Application Role is ON
[Thread-52] [ 2012-10-24 13:59:29.975 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Enterprise User Security is ON
[Thread-52] [ 2012-10-24 13:59:29.975 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Oracle Data Guard is ON
[Thread-52] [ 2012-10-24 13:59:29.975 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option OLAP is ON
[Thread-52] [ 2012-10-24 13:59:29.975 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Basic Compression is ON
[Thread-52] [ 2012-10-24 13:59:29.976 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Join index is ON
[Thread-52] [ 2012-10-24 13:59:29.976 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Trial Recovery is ON
[Thread-52] [ 2012-10-24 13:59:29.976 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Data Mining is ON
[Thread-52] [ 2012-10-24 13:59:29.976 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Online Redefinition is ON
[Thread-52] [ 2012-10-24 13:59:29.976 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Streams Capture is ON
[Thread-52] [ 2012-10-24 13:59:29.977 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option File Mapping is ON
[Thread-52] [ 2012-10-24 13:59:29.977 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Block Change Tracking is ON
[Thread-52] [ 2012-10-24 13:59:29.977 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Flashback Table is ON
[Thread-52] [ 2012-10-24 13:59:29.977 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Flashback Database is ON
[Thread-52] [ 2012-10-24 13:59:29.977 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Transparent Data Encryption is ON
[Thread-52] [ 2012-10-24 13:59:29.978 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Backup Encryption is ON
[Thread-52] [ 2012-10-24 13:59:29.978 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Unused Block Compression is ON
[Thread-52] [ 2012-10-24 13:59:29.978 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Result Cache is ON
[Thread-52] [ 2012-10-24 13:59:29.978 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option SQL Plan Management is ON
[Thread-52] [ 2012-10-24 13:59:29.978 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option SecureFiles Encryption is ON
[Thread-52] [ 2012-10-24 13:59:29.979 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Real Application Testing is ON
[Thread-52] [ 2012-10-24 13:59:29.979 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Flashback Data Archive is ON
[Thread-52] [ 2012-10-24 13:59:29.979 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option DICOM is ON
[Thread-52] [ 2012-10-24 13:59:29.992 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Active Data Guard is ON
[Thread-52] [ 2012-10-24 13:59:29.992 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Server Flash Cache is ON
[Thread-52] [ 2012-10-24 13:59:29.992 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Advanced Compression is ON
[Thread-52] [ 2012-10-24 13:59:29.992 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option XStream is ON
[Thread-52] [ 2012-10-24 13:59:29.993 GMT+05:30 ] [OracleHome.initOptions:1265] Database Option Deferred Segment Creation is ON
[Thread-52] [ 2012-10-24 13:59:29.993 GMT+05:30 ] [OracleHome.initOptions:1269] executing: select version from v$timezone_file
[Thread-52] [ 2012-10-24 13:59:29.997 GMT+05:30 ] [OracleHome.initOptions:1275] Timezone file version is 14
[Thread-52] [ 2012-10-24 13:59:31.019 GMT+05:30 ] [SQLEngine.done:2189] Done called
[Thread-52] [ 2012-10-24 13:59:31.020 GMT+05:30 ] [OsUtilsBase.deleteFile:1863] OsUtilsBase.deleteFile: /nhi2/app/oracle11g/product/11.2.0/dbhome_1/dbs/initDBUA5901749.ora
[Thread-52] [ 2012-10-24 13:59:31.034 GMT+05:30 ] [OsUtilsBase.deleteFile:1863] OsUtilsBase.deleteFile: /nhi2/app/oracle11g/product/11.2.0/dbhome_1/dbs/orapwDBUA5901749
[Thread-52] [ 2012-10-24 13:59:31.042 GMT+05:30 ] [OracleHome.initOptions:1316] Diag cleanup /nhi2/app/oracle11g/product/11.2.0/dbhome_1/log/diag/rdbms/dbua5901749
[Thread-52] [ 2012-10-24 13:59:31.564 GMT+05:30 ] [OracleHome.initOptions:1324] Database Options queried: 60
[Thread-52] [ 2012-10-24 13:59:31.564 GMT+05:30 ] [CompManager.setLoggingDirForDB:6992] Create logging folder for database=baan
[Thread-52] [ 2012-10-24 13:59:31.565 GMT+05:30 ] [CompManager.createUniqueDirs:6953] create createUniqueDirs logging folder=/nhi2/app/oracle11g/cfgtoollogs/dbua/baan/upgrade
[Thread-52] [ 2012-10-24 13:59:31.566 GMT+05:30 ] [CompManager.createUniqueDirs:6965] create createUniqueDirs logging folder=/nhi2/app/oracle11g/cfgtoollogs/dbua/baan/upgrade1
[Thread-52] [ 2012-10-24 13:59:31.574 GMT+05:30 ] [CompManager.createUniqueDirs:6973] create SUCCESS for folder=/nhi2/app/oracle11g/cfgtoollogs/dbua/baan/upgrade1
Thanks,
Sandeep Vadlamudi -
I found ORA-00001 ERROR but there is not Unique Constraint or Primary key
Tell me is the error in following code
declare
cursor c1 is
select a.cust_no as loan_id,a.cust_no as instrf,152 as l_code,cor_brwr,
a.name,21 as pro_id,FRST_CT_DT,
ADD_MONTHS(C.ct_DaTe,c.PERIOD_MM)as maturity,'S'as secured,irr as IRATE,
'HEAD OFFICE'AS branch_id,'F'as FACNAT,lease_amt as tlimit
from cu_customer a ,cor_brwr b ,le_contract c
where a.name=b.name
and a.cust_no=c.cust_no
and c.ct_no in (select ct_no from le_contract d
where cust_no=a.cust_no
and
(DISB_POST_DT IS NOT NULL OR DISB_POST_DT<=:dated)
AND (TERM_TYPE IS NULL)
OR (TERM_TYPE='T'
AND TERM_POST_DT IS NULL OR TERM_POST_DT>=:dated)
OR (TERM_TYPE='M' AND TERM_DATE IS NULL OR TERM_DATE>=:dated)
begin
for a in c1 loop
insert into cor_loan
(loan_id,instrf,LCOD,cor_brwr,name,PROD_ID,ldate,maturity,secured,irate,branch_Id, FACNAT)
values (a.loan_id,a.instrf,a.l_code,a.cor_brwr,a.name,a.pro_id,a.FRST_CT_DT,a.maturity,a.secured,a.irate,a.branch_id,a.FACNAT);
end loop;
commit;
end;Hi,
can you provide the results of the above query ?
select owner, constraint_name, constraint_type
from all_constraints
where table_name = 'COR_LOAN'and
select owner, constraint_name, constraint_type
from user_constraints
where table_name = 'COR_LOAN'Regards
JeanYves -
ORA-00001 uniqueness error yet no apparent violation in the data
I have a simple insert statement that generates an ORA-00001 error on the primary key. There are no other unique constraints on the table. The SQL statement is basic:
insert into X
query;
Fortunately, the result set is small enough that I can just examine it brute force. But, when I run the query alone, the result set does not reveal any obvious uniqueness errors. (And yes, I've checked to see if the data is in the table before I ran the insert).
So, I converted the insert statement to a PL/SQL block with a cursor loop:
declare
cursor cX is query;
for rec in cX loop
insert into X values (rec.values);
end loop;
exception
when others output sqlerrm
end;
Yet, when I run this cursor loop, there is no exception raised! (and all the data inserts successfully with no errors).
So, I suppose I should be satisfied that the cursor loop works, yet it disturbs me that this "nonexistent" uniqueness error occurred to begin with.
Any idea why this could be happening?
Thanx in advance.I'm actually writing to a log table in the exception handler, so server output is not an issue.
Ok, here's the insert statement. The line numbers skip as I removed the column mappings for the table. The primary key for agg_daily_sales is (invoice_dt, company_cd, branch_nbr, ordr_nbr, dist_nbr, ship_nbr, ordr_dt).
12:30:00 SQL> insert into ods.agg_daily_sales
12:30:24 52 select inv.invoice_dt
12:30:24 53 , os.company_cd
12:30:24 54 , os.branch_nbr
12:30:24 55 , os.ordr_nbr
12:30:24 56 , os.dist_nbr
12:30:24 57 , os.ship_nbr
12:30:24 58 , ol.line_nbr
12:30:24 59 , os.ordr_dt
12:30:24 60 , inv.invoice_nbr
12:30:24 61 , o.cust_ordr_nbr
12:30:24 62 , o.bill_to_branch_nbr
12:30:24 63 , o.bill_to_cust_nbr
12:30:24 64 , os.branch_nbr_ship_from
12:30:24 65 , o.is_slsmn
12:30:24 66 , o.os_slsmn
12:30:25 67 , trim(inshed.inv_part_nbr)
12:30:25 68 , inshed.vendor_nbr
12:30:25 69 , inshed.seq_nbr
12:30:25 70 , inshed.vendor_part_nbr
12:30:25 71 , ol.unit_prc
12:30:25 72 , ol.unit_prc * ccy.USD_per_unit
12:30:25 73 , ol.unit_cost
12:30:25 74 , ol.unit_cost * ccy.USD_per_unit
12:30:25 75 , ol.adj_cost
12:30:25 76 , ol.adj_cost * ccy.USD_per_unit
12:30:25 77 , ol.qty_shpd
12:30:25 78 , ol.qty_orded
12:30:25 79 , ol.qty_bild
12:30:25 80 , ol.qty_bord
12:30:25 81 , o.ccy_cd
12:30:25 82 , ccy.usd_per_unit
12:30:25 83 , ol.qty_shpd * ol.unit_prc
12:30:25 84 , ol.qty_shpd * ol.unit_cost
12:30:26 85 , ol.qty_shpd * ol.adj_cost
12:30:26 86 , ol.qty_shpd * (ol.unit_prc - ol.unit_cost)
12:30:26 87 , ol.qty_shpd * (ol.unit_prc - ol.adj_cost)
12:30:26 88 , case when (ol.qty_shpd * ol.unit_prc) = 0 then 0
12:30:26 89 when (ol.qty_shpd * ol.unit_prc) < 1 then 100
12:30:26 90 else ( (ol.unit_prc - ol.unit_cost) / ol.unit_prc ) * 100
12:30:26 91 end
12:30:26 92 , case when (ol.qty_shpd * ol.unit_prc) = 0 then 0
12:30:26 93 when (ol.qty_shpd * ol.unit_prc) < 1 then 100
12:30:26 94 else ( (ol.unit_prc - ol.adj_cost) / ol.unit_prc ) * 100
12:30:26 95 end
12:30:26 96 , ol.qty_shpd * ccy.USD_per_unit * ol.unit_prc
12:30:26 97 , ol.qty_shpd * ccy.USD_per_unit * ol.unit_cost
12:30:26 98 , ol.qty_shpd * ccy.USD_per_unit * ol.adj_cost
12:30:27 99 , ol.qty_shpd * ccy.USD_per_unit * (ol.unit_prc - ol.unit_cost)
12:30:27 100 , ol.qty_shpd * ccy.USD_per_unit * (ol.unit_prc - ol.adj_cost)
12:30:27 101 , case when (ol.qty_shpd * ol.unit_prc) = 0 then 0
12:30:27 102 when (ol.qty_shpd * ol.unit_prc) < 1 then 100
12:30:27 103 else ( (ol.unit_prc - ol.unit_cost) / ol.unit_prc ) * 100
12:30:27 104 end
12:30:27 105 , case when (ol.qty_shpd * ol.unit_prc) = 0 then 0
12:30:27 106 when (ol.qty_shpd * ol.unit_prc) < 1 then 100
12:30:27 107 else ( (ol.unit_prc - ol.adj_cost) / ol.unit_prc ) * 100
12:30:27 108 end
12:30:27 109 , ol.frt_in_amt_bild
12:30:27 110 , ol.frt_out_amt_bild
12:30:28 111 , ol.pc_tax_amt
12:30:28 112 , sysdate
12:30:28 113 from ods.ods_order_invoice_nbr inv
12:30:28 114 , ods.ods_order o
12:30:28 115 , ods.ods_order_shipment os
12:30:28 116 , ods.ods_order_line ol
12:31:13 117 , ods.ods_currency_rate ccy
12:31:13 118 , (select distinct
12:31:13 119 inshed2.company
12:31:13 120 , hpx.vendor_nbr
12:31:13 121 , inshed2.inv_part_nbr
12:31:13 122 , inshed2.seq_nbr
12:31:13 123 , inshed2.vendor_part_nbr
12:31:13 124 from ods.hierarchy_product_xref hpx
12:31:13 125 , ods.ref_company co2
12:31:13 126 , ods.ims_prod_inshed inshed2
12:31:13 127 where co2.business_region = 'EU'
12:31:13 128 and hpx.hierarchy_ID = 1
12:31:13 129 and hpx.company_cd = co2.company_cd
12:31:13 130 and hpx.company_cd = inshed2.company
12:31:13 131 and hpx.IM_part_nbr = inshed2.inv_part_nbr
12:31:13 132 ) inshed
12:31:13 133 where
insert into ods.agg_daily_sales
ERROR at line 1:
ORA-00001: unique constraint (ODS.AGG_DAILY_SALES_PK) violated
Elapsed: 00:09:16.01
12:40:32 SQL> -
Truncate, then reload causes ora-00001 unique constraint on apply side
I setup schema level replication using the maintain_schema procedure. Its replicating DML and not DDL.
I have a source side process that truncates a table then reloads it every day. Since DDL is not replicating, the reload produces generates an ora-00001 errors in apply process.
I don't want to replicate all DDL because of apply errors it creates
I've added a DDL schema rule to replicate truncate statements on the capture and apply rule, but the truncate is still not replicating. Here are the rules I'm using:
dbms_streams_adm.add_schema_rules(
schema_name => 'PRODUCT',
streams_type => 'CAPTURE',
streams_name => '&src_db$CAP',
queue_name => 'STRMADMIN.&src_db$CAPQ',
include_dml => TRUE,
include_ddl => FALSE,
include_tagged_lcr => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE);
DBMS_STREAMS_ADM.add_schema_rules (
schema_name => 'PRODUCT',
streams_type => 'CAPTURE',
streams_name => '&src_db$CAP',
queue_name => 'STRMADMIN.&src_db$CAPQ',
include_dml => FALSE,
include_ddl => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''TRUNCATE TABLE'')');Here's the capture rule_condition from dba_streams_rules:
((:dml.get_object_owner() = 'PRODUCT') and :dml.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )
((((:ddl.get_object_owner() = 'PRODUCT' or :ddl.get_base_table_owner() = 'PRODUCT') and :ddl.is_null_tag() = 'Y' and :ddl.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )) and ((:ddl.get_command_type() = 'TRUNCATE TABLE')))
On the apply side I have the following
dbms_streams_adm.add_schema_rules(
schema_name => 'PRODUCT',
streams_type => 'APPLY',
streams_name => '',
queue_name => 'STRMADMIN.&src_db$APPQ',
include_dml => TRUE,
include_ddl => FALSE,
include_tagged_lcr => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE);
DBMS_STREAMS_ADM.add_schema_rules (
schema_name => 'PRODUCT',
streams_type => 'APPLY',
streams_name => '',
queue_name => 'STRMADMIN.&src_db$APPQ',
include_dml => FALSE,
include_ddl => TRUE,
source_database => '&src_db..&gbl_nm',
inclusion_rule => TRUE,
and_condition => '(:ddl.get_command_type() = ''TRUNCATE TABLE'')');And the corresponding rule_conditions look like:
((:dml.get_object_owner() = 'PRODUCT') and :dml.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )
((((:ddl.get_object_owner() = 'PRODUCT' or :ddl.get_base_table_owner() = 'PRODUCT') and :ddl.is_null_tag() = 'Y' and :ddl.get_source_database_name() = 'PKIO.LOUDCLOUD.COM' )) and ((:ddl.get_command_type() = 'TRUNCATE TABLE')))
When the source side process that truncates and reloads the table, the apply process crashes. To workaround this I manually truncate the table on the target side and execute DBMS_APPLY_ADM.EXECUTE_ALL_ERRORS then restart apply.
What do I need to do to replicate truncate statements with out replicating other DDL statements?
Thanks!Hi,
You can create rule for truncate using below:
BEGIN
DBMS_RULE_ADM.CREATE_RULE(
rule_name => 'TRUNCATE_RULE',
condition => '(:ddl.get_object_owner() = ''HR'' AND ' ||
':ddl.get_object_name() = ''TEST'') AND ' ||
':ddl.get_command_type() = ''TRUNCATE TABLE'' ');
END;
Thanks,
Reena -
Users getting APP-FND-01934:ora-00001 unique constraint
users getting APP-FND-01934:ora-00001 unique constraint(ENI.ENI_OLTP_ITEM_STAR_U3) violated in package ENI_ITEMS_STAR_PKG Procedure INsERT_ITEMS_IN_STAR on Master ITEM's in 11i EBS.
Please see these MOS Docs.
APP-FND-01934 ORA-00001 Error Occurs When Creating Items [ID 1072935.1]
APP-FND-01934 ORA-00001: Unique Constraint Error at Master Items [ID 465008.1]
ORA-02291: Integrity Constraint (GMI.IC_LOTS_MST_IC_ITEM_MST_B_FK) Violated [ID 302368.1]
Thanks,
Hussein -
when our developer tries to insert few records in a table
it throws error
ora-00001 & ora-06512,
when i tried to disable or drop the constraint indicated in the error 0ra-06512
it throws ora-02431 - constraint not existing
please guide us to solve this error.
santhanam.I agree with Centinul, you probably do not want to get rid of the uniquenes enforced on the column. Better to find out why the developer is inserting duplicate records and fix that, or, if it is possible that you might get duplicate records in production, then develop a method of handling the error that properly meets your business needs.
The ORA-00001 error can come from 3 sources. A PK constraint, a unique constraint and a unique index without a formal constraint.
SQL> create table t (id number);
Table created.
SQL> create unique index t_unq on t(1d);
Index created.
SQL> insert into t values (1);
1 row created.
SQL> insert into t values (1);
insert into t values (1)
ERROR at line 1:
ORA-00001: unique constraint (OPS$ORACLE.T_UNQ) violatedDropping the constraint t_unq is not possible, I would need to drop the index. But I wouldn't, since in the vast majority of cases, the requirement for uniqueness is a business requirement, and not something put in to anoy developers.
John -
Error while adding Image: ORA-00001: unique constraint
Dear all,
I have an error while adding images to MDM I can´t explain. I want to add 7231 images. About 6983 run fine. The rest throws this error.
Error: Service 'SRM_MDM_CATALOG', Schema 'SRMMDMCATALOG2_m000', ERROR CODE=1 ||| ORA-00001: unique constraint (SRMMDMCATALOG2_M000.IDATA_6_DATAID) violated
Last CMD: INSERT INTO A2i_Data_6 (PermanentId, DataId, DataGroupId, Description_L3, CodeName, Name_L3) VALUES (:1, :2, :3, :4, :5, :6)
Name=PermanentId; Type=9; Value=1641157; ArraySize=0; NullInd=0;
Name=DataId; Type=5; Value=426458; ArraySize=0; NullInd=0;
Name=DataGroupId; Type=4; Value=9; ArraySize=0; NullInd=0;
Name=Description_L3; Type=2; Value=; ArraySize=0; NullInd=0;
Name=CodeName; Type=2; Value=207603_Img8078_gif; ArraySize=0; NullInd=0;
Name=Name_L3; Type=2; Value=207603_Img8078.gif; ArraySize=0; NullInd=0;
Error: Service 'SRM_MDM_CATALOG', Schema 'SRMMDMCATALOG2_m000', ERROR CODE=1 ||| ORA-00001: unique constraint (SRMMDMCATALOG2_M000.IDATA_6_DATAID) violated
Last CMD: INSERT INTO A2i_Data_6 (PermanentId, DataId, DataGroupId, Description_L3, CodeName, Name_L3) VALUES (:1, :2, :3, :4, :5, :6)
Name=PermanentId; Type=9; Value=1641157; ArraySize=0; NullInd=0;
Name=DataId; Type=5; Value=426458; ArraySize=0; NullInd=0;
Name=DataGroupId; Type=4; Value=9; ArraySize=0; NullInd=0;
Name=Description_L3; Type=2; Value=; ArraySize=0; NullInd=0;
Name=CodeName; Type=2; Value=207603_Img8085_gif; ArraySize=0; NullInd=0;
Name=Name_L3; Type=2; Value=207603_Img8085.gif; ArraySize=0; NullInd=0;
I checked all data. There is no such dataset in the database. Can anybody give me a hint how to avoid this error.
One thing I wonder: The PermanentId is allways the same but I can´t do anything here.
BR
Roman
Edited by: Roman Becker on Jan 13, 2009 12:59 AMHi Ritam,
For such issues, can you please create a new thread or directly email the author rather than dragging back up a very old thread, it is unlikely that the resolution would be the same as the database/application/etc releases would most probably be very different.
For now I will close this thread as unanswered.
SAP SRM Moderators. -
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 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. -
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.
Maybe you are looking for
-
Facebook and Google Video Chatting in iChat
I added my facebook and google contacts into iChat the normal way and txt chat with them. But it won't let me video chat with them through iChat...the little button won't let me press it. How do i get it to work?
-
Hi All, I am getting this error message when i am trying to open an infopackage : *""Data target 'ZEMPRACE$T' removed from list of loadable targets; not loadable""* This infopackage is loading text till PSA for one of the attributes of the masterdata
-
Hi we changed the recon account without clearing the open items,which made balances not tallied with FS10N to customer balances,now we want to transfer open items from old recon account to new recon account,is there any standard programme for that. T
-
My MacBook Pro freezes after opening any application or trying to update
HELP! I haven't used my mac for a while and when I booted it up, I did all my usual things when I didn't use my mac for a long time, like opening software update. But software update froze after trying to download a firmware and iTunes update. I thou
-
BO XI R2 - Random connection problem
Hi, I installed a Citrix server dedicated for BO training. One user is domain admin. Seven users are users without special rights. Everybody can connect to the universe and can work correctly using deski. But approximatively every hours, the 7 users