Cannot insert a key value pair into the secure store fails; see output of l

Hi,
how can I fix this problem ?
SAPNW2004sJavaSP9_Trial\SAP_NetWeaver_2004s_SR_1
jdkversion 142_09 .
ERROR 2008-07-10 13:13:31
CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log: SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
Regds
sas

Hi Arzu,
thank you for your replying.
The current OS I am using is Microsoft Windows XP
Service Pack 2.
The very last installation was made with JDK version 142_12.
However it was pointless. I can try to reinstall with
the mentioned newest JCE policy files .
Can tell me from where I can obtain these above
JCE policy files ?
Regards
Erdem Sas

Similar Messages

  • Java Install,  Cannot insert a key value pair into the secure store fails,

    Dear All,
    I'm doing Java Intallaion in BI7 on CI and in the midle of installtions we encounter,
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    NWException thrown: nw.secureStore.cannotInsertIntoSecureStore:
    Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    ERROR      2008-04-23 11:36:21
               CJSlibModule::writeError_impl()
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    TRACE      [iaxxejsbas.hpp:460]
               EJS_Base::dispatchFunctionCall()
    JS Callback has thrown unknown exception. Rethrowing.
    ERROR      2008-04-23 11:36:21 [iaxxgenimp.cpp:731]
               showDialog()
    FCO-00011  The step insertAdminDataInSecStore with step key |NW_Addin_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|8|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|insertAdminDataInSecStore was executed with status ERROR .
    TRACE      [iaxxgenimp.cpp:719]
               showDialog()
    There's any want in here can help us Please,
    Thanks and Best Regards,
    Chrisna

    The clean way to Uninstall JAVA is through SAPINST. 
    Make user you drop only the JAVA Schema ID (SAPSR3DB)
    If you want to uninstall manually, follow as mentioned below :
    1. Stop the central services instance and all dialog instances of your SAP system:
    a) Log on to the corresponding instance host as user <sapsid>adm.
    b) Execute the following commands:
       To stop the central services instance:
                 stopsap r3 <SCSinstanceName>
       To stop a dialog instance:
                stopsap r3 <DialogInstanceName>
    2. Stop the J2EE Engine of the central instance:
    a) Log on to your SAP system.
    b) Call transaction SMICM.
    c) Choose Administration J2EE Instance (local) Send Hard Shutdown
    2. Drop the J2EE DB schema (the db schema for this one SAP SID) BE VERY CAREFUL, do not drop the DB schema for another existing system or
    the ABAP schema.
    a. Log on as user ora<dbsid>.
    b. Start sqlplus and connect to the database. Enter:
    sqlplus /nolog
    c. SQLPLUS>connect / as sysdba
    d. Enter the following command to delete the database objects of the database schema:
    SQLPLUS> drop user SAP<SCHEMA_ID>DB cascade;
    e. Enter the following command to get the file name of the corresponding data file in the file system:
    SQLPLUS> select file_name from dba_data_files where \
    tablespace_name = ’PSAP<SCHEMA_ID>DB’;
    f. Enter the following command to delete the tablespace of the database schema:
    SQLPLUS> drop tablespace PSAP<SCHEMA_ID>DB including contents;
    g. Exit sqlplus:
    SQLPLUS> exit
    3. Remove folder "data" at: /sapmnt/QO1/global/security/data
    4. Remove folder "SDM" at: /usr/sap/<sid>/<Central instance>/SDM
    5. Remove folder "j2ee" at:  /usr/sap/<sid>/<Central instance>/j2ee
    6. Revert CI instance profile to their original state (backup copies should exist) # they should be in the state before the start of the JavaAdd In
    7. If lines beginning with the following parameters appear, delete these lines from the default profile, /usr/sap/<SAPSID>/SYS/profile/DEFAULT.PFL:
    j2ee/dbname =
    j2ee/dbtype =
    j2ee/dbhost =
    j2ee/dbadminurl =
    j2ee/scs/host =
    j2ee/scs/system =
    j2ee/ms/port =
    8. If lines beginning with the following parameters appear, delete these lines from the central instance pro?le and from all dialog instance pro?les,
    /usr/sap/<SAPSID>/SYS/profile/<SAPSID>_<INSTANCE_NAME>_<host_name>:
    exe/j2ee =
    exe/jlaunch =
    rdisp/j2ee_start_control =
    rdisp/j2ee_start =
    rdisp/j2ee_timeout =
    rdisp/j2ee_libpath =
    rdisp/frfc_fallback =
    jstartup/trimming_properties =
    jstartup/instance_properties =
    jstartup/protocol =
    jstartup/vm/home =
    jstartup/max_caches =
    jstartup/release =
    j2ee/dbdriver =
    9. Delete the central services instance
    10. Restart ABAP and Install JAVA Add-in
    Edited by: Shaji Jacob on Apr 27, 2008 11:46 AM

  • Is it possible to load 1 billion key-value pairs into BerkeleyDB database?

    Hello,
    I experiment with loading huge datasets into BerkeleyDB database. The procedure is as follows:
    1. Generate a dump-like file using a script. The file contains key-value pairs (on separate lines, exactly in the format of the dump file, that can be produced by db_dump). The index is hash.
    2. Use db_load to create a database. The OS is windows server 2003.
    Both key and values are 64-bit longs.
    Using this procedure, I succeeded to load 25 million pairs in the database. It took about 1-2 hours.
    Next, I tried to load 250 million pairs into an empty database. db_loader runs already 15 hours. It's memory consumption is very low: private bytes ~2M, working set ~2M, virtual size ~13M. db_loader already read all the pairs from disk, as IO is very low now: ~4M per second. I am not sure if db_loader will finish in next 24h hours.
    My goal is to load eventually 3 billion key-value pairs into one DB.
    I will appreciate if someone will advise me:
    1. If BerkeleyDB is capable of dealing with such database volume.
    2. Is my procedure good, how to optimize it. Is it possible to allocate more RAM to db_load? Are there other ways to optimize loading time?
    Thank you,
    Gregory.

    Hello Sandra,
    The version is: Berkeley DB 5.0.21: (March 30, 2010).
    The data: keys and values are random 64 bit numbers.
    The header of the "dump" file that I am trying to load is (there are 256 * 1e6 key-value pairs in the file):
    VERSION=3
    format=bytevalue
    type=hash
    h_nelem=512000000
    db_pagesize=8192
    HEADER=END
    The db_load allocates 1G memory cache.
    Thank you,
    Gregory.

  • A key/value pair with this key already exists in the store

    Hi all,
    In the installation of PI components on the AS ABAP+ AS JAVA with finalization of the Java Addin the iam facing this problem :
    In short it mentioning that the " A key/value pair with this key already exists in the store.", Please see below for more information....:
    CJSlibModule::writeWarning_impl()
    Execution of the command "/opt/java1.4/bin/java -classpath
    /oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedli
    b/launcher.jar -Xmx256m -d64 com.sap.engine.offline.OfflineToolStart
    com.sap.security.core.server.secstorefs.SecStoreFS
    /usr/sap/PID/SYS/global/security/lib/tools/iaik_jce.jar:/usr/sap/PID/SYS/global/security/lib
    /tools/iaik_jsse.jar:/usr/sap/PID/SYS/global/security/lib/tools/iaik_smime.jar:/usr/sap/PID/
    SYS/global/security/lib/tools/iaik_ssl.jar:/usr/sap/PID/SYS/global/security/lib/tools/w3c_ht
    tp.jar:/oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/l
    ib:/oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/share
    dlib:/oracle/client/10x_64/instantclient/ojdbc14.jar insert -s PID -f
    /usr/sap/PID/SYS/global/security/data/SecStore.properties -k
    /usr/sap/PID/SYS/global/security/data/SecStore.key admin/host/PID tern" finished with return
    code 2. Output:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store.
    ERROR      2007-02-15 18:35:29
               CJSlibModule::writeError_impl()
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log
    file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    ERROR      2007-02-15 18:35:29 [iaxxgenimp.cpp:731]
               showDialog()
    FCO-00011  The step insertAdminDataInSecStore with step key
    |NW_Addin_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|8|0|NW_CI_Instance_Configure
    _Java|ind|ind|ind|ind|4|0|insertAdminDataInSecStore was executed with status ERROR

    Hi Kamalakar
    I think this problem happens due to wrong content of SDMKIT.JAR - incorrect crypto SDA is deployed.I dont know the installation procedure you followed because normally this error wont come.
    I would rather suggest a work around seeing your problem
    <b>Edit the keydb.xml exchanging [ERROR] with [OK]</b>
    Follow the above step and restart your installation.
    Do not forget to reward points:

  • Key value pair error

    Hello
    how can I fix this problem ?
    SAPNW2004sJavaSP9_Trial\SAP_NetWeaver_2004s_SR_1
    jdkversion 142_09 .
    ERROR 2008-07-09 23:56:30
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log: SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    ERROR 2008-07-09 23:56:30
    FCO-00011  The step insertAdminDataInSecStore with step key |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CI_Instance|ind|ind|ind|ind|11|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|3|0|insertAdminDataInSecStore was executed with status ERROR .
    Thanks
    sas

    Hi this the content of  SecureStoreInsert .
    com.sap.security.core.server.secstorefs.NoEncryptionException: Encryption or decryption is not possible because the full version of the SAP Java Crypto Toolkit was not found (iaik_jce.jar is required, iaik_jce_export.jar is not sufficient) or the JCE Jurisdiction Policy Files don't allow the use of the "PbeWithSHAAnd3_KeyTripleDES_CBC" algorithm.
    at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1975)
    at com.sap.security.core.server.secstorefs.SecStoreFS.handleInsert(SecStoreFS.java:963)
    at com.sap.security.core.server.secstorefs.SecStoreFS.main(SecStoreFS.java:1276)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: java.lang.SecurityException: The provider IAIK may not be signed by a trusted party
    at javax.crypto.SunJCE_b.a(DashoA12275)
    at javax.crypto.Cipher.a(DashoA12275)
    at javax.crypto.Cipher.getInstance(DashoA12275)
    at com.sap.security.core.server.secstorefs.Crypt.<init>(Crypt.java:220)
    at com.sap.security.core.server.secstorefs.SecStoreFS.<init>(SecStoreFS.java:1346)
    at com.sap.security.core.server.secstorefs.SecStoreFS.handleInsert(SecStoreFS.java:954)
    ... 6 more

  • The Secure Store Service application Secure Store Service Proxy is not accessible

    I am working on setting up a new SharePoint 2013 Farm for our external web site which is currently running on 2010 SharePoint. Because this is an External Website for our organization we have an internally available Publishing Site and there is an Web App
    Extension to provide Anon Access to users using the www address. Currently I am doing everything on a single server for testing with HOSTS entries to loop back so I can test with real host headers and not impact the 2010 prod environment. We will be setting
    up 2 more WFEs with a NLB before moving this into prod but it isn't there yet. We brought the Site Collection Databases over but are still running in 2010 mode for now.
    I migrated a copy of the Secure Store Database over from 2010 and had it put on the 2013 Farm's Database Server. Set up Secure Store and the Secure Store Proxy. I went into the Secure Store Proxy in CA and refreshed the Key with the proper Pass Phrase. After
    doing that I could see the Target Application IDs listed. Everything was looking good so I went off to test. If I am on the publishing site I can go to a page that has the solution on it and it operates as expected. It does a query to a non SharePoint database
    and returns information filtered based on the search parameters. The only odd thing I see is if I click on the "Site Actions" I get a message "An error has occurred with the data fetch. Please refresh page and retry." Need to look into
    that more but it only happens on pages that have these solutions. Maybe a clue. If I go to the Anonymous Access page (www......) and try and use the solution, it immediately (way too quick to appear like it is doing anything) comes back with "The security
    token request cannot be completed."
    If I dig through the usage logs I am finding the following.
    The Secure Store Service application Secure Store Service Proxy is not accessible. The full exception text is: The security token request cannot be completed.
    Unexpected exception from endpoint address : https://[Servername]:32844/4e87fd3aabb640fb8cc3ed52188cf5c0/SecureStoreService.svc/https
    Logging unknown/unexpected client side exception: InvalidOperationException. This will cause this application server to be removed from the load balancer queue. Exception: System.InvalidOperationException: The security token request cannot be completed.
        at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForServiceContext(Uri contextUri)     at Microsoft.SharePoint.SPChannelFactoryOperations.InternalCreateChannelActingAsLoggedOnUser[TChannel](ChannelFactory`1 factory, EndpointAddress
    address, Uri via)     at Microsoft.Office.SecureStoreService.Server.SecureStoreServiceApplicationProxy.GetChannel(Uri address)     at Microsoft.Office.SecureStoreService.Server.SecureStoreServiceApplicationProxy.Execute[T](String operationName,
    Boolean validateCanary, ExecuteDelegate`1 operation).
    Initially I was fighting a firewall issue because it wasn't working (different errors) on both sides. Had Network Engineers open firewall ports needed and now it works on the publishing side. Still the same error on the Anon side. I suspect I have missed
    something when it comes to configuring the Secure Store to allow access to anonymous connections.
    Let me know if you need any more information but that should paint a pretty good picture as to how things are set up.
    Thanks for any help on this one. Searches haven't found much that has helped so far.

    Hi Sennister,
    I recommend to verify the things below:
    Did this issue occur with all the pages in the anonymous side?
    Check if the Claims to Windows Token Service is started.
    Change the <identity impersonate="true" /> in the web.config to see if the issue still occurs.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • [SQL Server]Violation of PRIMARY KEY constraint 'DeploymentSummary_PK'. Cannot insert duplicate key in object 'dbo.DeploymentSummary'. The duplicate key value is

    I have migrated my SCCm 2007 environment to SCCM 2012 SP1 CU4.
    I noticed in the System Status\Component Status\SMS_STATE_SYSTEM a lot of errors like the one below:
    Microsoft SQL Server reported SQL message 2627, severity 14: [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'DeploymentSummary_PK'. Cannot insert duplicate key in object 'dbo.DeploymentSummary'. The duplicate key value is (1, 0, S0220438, 0). : spUpdateClassi
    Please refer to your Configuration Manager documentation, SQL Server documentation, or the Microsoft Knowledge Base for further troubleshooting information.
    When looking up the deployment ID and recreate the Deployment the problem is solved. But I have 700 packages and don't want to manually do this action on all packages. I think it is related to the migration i did and something went wrong there :-(
    Besides it will retriggers the deployment to the clients which is also not preferred.
    Is there another way to solve this by e.e.g do something directly in the SQL database tables ?

    Hi,
    It is not supported by Microsoft that do something directly in SQL database.
    If you want to do that, you could make a call to CSS.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • SSIS - "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object ' tablename '. The duplicate key value is 1234 . Though there are no duplicate records.

    Hi,
    I am providing support to one of our clients, where we have jobs scheduled to load the data from the tables in the source database to the destination database via SSIS packages. The first time load is a full load where we truncate all the tables in the destination
    and load them from the source tables. But from the next day, we perform the incremental load from source to destination, i.e., only modified records fetched using changed tracking concept will be loaded to the destination. After full load, if we run the incremental
    load, the job is failing with the error on one of the packages "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<tablename>'. The duplicate key value is <1234>, even though there are no duplicate records. When we
    try debugging and running the failing package, it runs successfully. We are not able to figure out why the package fails and when we run the next day it runs successfully. Request you to help me in this regard.
    Thank you,
    Bala Murali Krishna Medipally.

    Hi,
    I am providing support to one of our clients, where we have jobs scheduled to load the data from the tables in the source database to the destination database via SSIS packages. The first time load is a full load where we truncate all the tables in the destination
    and load them from the source tables. But from the next day, we perform the incremental load from source to destination, i.e., only modified records fetched using changed tracking concept will be loaded to the destination. After full load, if we run the incremental
    load, the job is failing with the error on one of the packages "Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<tablename>'. The duplicate key value is <1234>, even though there are no duplicate records. When we
    try debugging and running the failing package, it runs successfully. We are not able to figure out why the package fails and when we run the next day it runs successfully. Request you to help me in this regard.
    Thank you,
    Bala Murali Krishna Medipally.
    I suspect you are trying to insert modified records instead of updating.

  • *** [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of UNIQUE KEY constraint 'ClientPushMachine_G_AK'. Cannot insert duplicate key in object 'dbo.ClientPushMachine_G'. The duplicate key value is (16777412). : sp_CP_CheckNewAss

    *** [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of UNIQUE KEY constraint 'ClientPushMachine_G_AK'. Cannot insert duplicate key in object 'dbo.ClientPushMachine_G'. The duplicate key value is (16777412). : sp_CP_CheckNewAssignedMachine
    CCCRT::RunSQLStoredProc - Failed to execute SQL cmd exec [sp_CP_CheckNewAssignedMachine] N'xxx', 1
    CCRQueueRequest::GetRequestFromQueue - Failed to execute SQL cmd sp_CP_CheckNewAssignedMachine
    I get the above issue and the one below at a client site; the error started with the error below then changed to the one reported above and back to the one below. Everything is working as it should but the issues
    started when one of the admins at the data-centre incorrectly applied a gpo which affected a number of service accounts (sccm inclusive) and they expired....hence reporting in sccm got broke as well as this error in the ccm.log file appeared.
    Remote client install still works but I believe this error affects new client discovered by sccm, so in other words devices discovered by sccm do not get the client installed automatically....but if all access and permissions are in place...pushing out the
    client to the new discovered system works, it just not done automatically, which kinda defeats one the reasons for using sccm.
    I have searched the breadth of the tinternet and I can only find two technet reference to the same error  - one says to edit the stored procedure on the sql server which I don't think should be done... Like Jason said and I concur....its bad joo joos.
    The second suggestion, said you should select all the options in the Client Push Installation properties, I have tried this but hasn't solved the problem.
    I am planning to upgrade the site to the R2 CU3 before the end of the year but I would like to resolve this error before the upgrade.
    The site is currently sccm 2012 sp1 
    Any idea?> Resolution? sil vous plait!
    Merci

    Hi ,
    Please back up the database of the SCCM site. Then run the following query against the Site DB and see how it goes.
    DELETE FROM System_SMS_Resident_ARR
    WHERE ItemKey IN (
    SELECT ItemKey FROM vSystem_SMS_Resident_ARR
    GROUP BY ItemKey
    HAVING COUNT(ItemKey) > 1
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Msg 2601, Level 14, State 1, Procedure sp_flush_commit_table, Line 15 Cannot insert duplicate key row in object 'sys.syscommittab' with unique index 'si_xdes_id'. The duplicate key value is (2238926153). The statement has been terminated.

    I am using SQL server 2008 R1 SP3. And when we are doing back up operations we are facing the below error
    Msg 2601, Level 14, State 1, Procedure sp_flush_commit_table, Line 15
    Cannot insert duplicate key row in object 'sys.syscommittab' with unique index 'si_xdes_id'. The
    duplicate key value is (2238926153).
    The statement has been terminated.
    Please assist me with your inputs.
    Thanks,
    Rakesh.

    Hello,
    Did you enable change tracking on the database? If so, please try to disable and re-enable the change tracking.
    The following thread is about the similar issue, please refer to:
    http://social.msdn.microsoft.com/forums/sqlserver/en-US/c2294c73-4fdf-46e9-be97-8fade702e331/backup-fails-after-installing-sql2012-sp1-cu1-build-3321
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?

    Hi team,
    How resolve the below error 
    Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?
    Thanks,
    Ram
    RAM

    Hi team,
    How resolve the below error 
    Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?
    Thanks,
    Ram
    RAM
    There can be two reasons
    1. The insert script used is having multiple instances of the records with Key as 12610 returned from the source query. If this is the issue add a logic to include only the unique set of id values for records by avoiding duplicates. There are several approaches
    for this like using ROW_NUMBER with PARTITION BY, using a join with derived table etc
    2. The record with Key 12610 already exist in your destination table and your script is again trying to insert another instances of record with same key. This can be avoided by adding a NOT EXISTS condition with a subquery which will check and return only
    those records which doesnt already exist in the source
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to combine large number of key-value pair tables into a single table?

    I have 250+ key-value pair tables with the following characteristics
    1) keys are unique within a table but may or may not be unique across tables
    2) each table has about 2 million rows
    What is the best way to create a single table with all the unique key-values from all these tables? The following two queries work till about 150+ tables
    with
      t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select coalesce(t1.key, t2.key, t3.key) as key
    ,      max(t1.val) as val1
    ,      max(t2.val) as val2
    ,      max(t3.val) as val3
    from t1
    full join t2 on ( t1.key = t2.key )
    full join t3 on ( t2.key = t3.key )
    group by coalesce(t1.key, t2.key, t3.key)
    with
      master as ( select rownum as key from dual connect by level <= 5 )
    , t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select m.key as key
    ,      t1.val as val1
    ,      t2.val as val2
    ,      t3.val as val3
    from master m
    left join t1 on ( t1.key = m.key )
    left join t2 on ( t2.key = m.key )
    left join t3 on ( t3.key = m.key )
    /

    A couple of questions, then a possible solution.
    Why on earth do you have 250+ key-value pair tables?
    Why on earth do you want to consolodate them into one table with one row per key?
    You could do a pivot of all of the tables, without joining. something like:
    with
      t1 as ( select 1 as key, 'a1' as val from dual union all
              select 2 as key, 'a1' as val from dual union all
              select 3 as key, 'a2' as val from dual )
    , t2 as ( select 2 as key, 'b1' as val from dual union all
              select 3 as key, 'b2' as val from dual union all
              select 4 as key, 'b3' as val from dual )
    , t3 as ( select 1 as key, 'c1' as val from dual union all
              select 3 as key, 'c1' as val from dual union all
              select 5 as key, 'c2' as val from dual )
    select key, max(t1val), max(t2val), max(t3val)
    FROM (select key, val t1val, null t2val, null t3val
          from t1
          union all
          select key, null, val, null
          from t2
          union all
          select key, null, null, val
          from t3)
    group by keyIf you can do this in a single query, unioning all 250+ tables, then you do not need to worry about chaining or migration. It might be necessary to do it in a couple of passes, depending on the resources available on your server. If so, I would be inclined to create the table first, with a larger than normal percent free, then do the first set as a straight insert, and the remaining pass or passes as a merge.
    Another alternative might be to use the approach above, but limit the range of keys in each pass. So pass one would have a predicate like where key between 1 and 10 in each branch of the union, pass 2 would have key between 11 and 20 etc. That way everything would be straight inserts.
    Having said all that, I go back to my second question above, why on earth do you want/need to do this? What is the business requirement you are trying to solve. There might be a much better way to meet the requirement.
    John

  • Cannot insert duplicate key in ddm.log

    Hello,
    I have been noticing the below on many occasions:
    *** IF EXISTS (select ItemKey from DiscItemAgents where ItemKey = 278482 and DiscArchKey = 5 and AgentID = 15 and AgentSite = 'auto') update DiscItemAgents set AgentTime = '07/31/2014 16:26:11'  where ItemKey = 278482 and DiscArchKey = 5 and AgentID =
    15 and AgentSite = 'auto'~ ELSE insert into DiscItemAgents (AgentTime, ItemKey, DiscArchKey, AgentID, AgentSite) values ('07/31/2014 16:26:11', 278482, 5, 15, 'auto')
    SMS_DISCOVERY_DATA_MANAGER
    8/1/2014 5:53:01 AM 4104 (0x1008)
    *** [23000][2627][Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'DiscItemAgents_PK'.
    Cannot insert duplicate key in object 'dbo.DiscItemAgents'. The duplicate key value is (278482, 15, 5, aut).
    SMS_DISCOVERY_DATA_MANAGER 8/1/2014 5:53:01 AM
    4104 (0x1008)
    CDiscoverySource_SQL::UpdateItem - could not execute sql- IF EXISTS (select ItemKey from DiscItemAgents where ItemKey = 278482 and DiscArchKey = 5 and AgentID = 15 and AgentSite = 'auto') update DiscItemAgents set AgentTime = '07/31/2014 16:26:11'  where
    ItemKey = 278482 and DiscArchKey = 5 and AgentID = 15 and AgentSite = 'auto'~ ELSE insert into DiscItemAgents (AgentTime, ItemKey, DiscArchKey, AgentID, AgentSite) values ('07/31/2014 16:26:11', 278482, 5, 15, 'auto')
    SMS_DISCOVERY_DATA_MANAGER 8/1/2014 5:53:01 AM
    4104 (0x1008)
    CDiscoverDataManager::ProcessDDRs_PS - Unable to update data source
    SMS_DISCOVERY_DATA_MANAGER 8/1/2014 5:53:01 AM
    4104 (0x1008)
    I then ran a query in SQL based on error Cannot insert duplicate key in object 'dbo.DiscItemAgents'. The duplicate key value is (278482, 15, 5, aut) : select * from DiscItemAgents where ItemKey = '278482'
    I got the result stating that the record has AgentSite as 'aut'
    Now when I check distinct values for AgentSite column I am able to see all site code values that are present in the hierarchy.
    I, then ran a query to find the no of rows for AgentSite = 'aut'. It returned me 7 which are some client machines.
    To resolve, when I run this sql query, DDM starts working fine: Delete from DiscItemAgents where AgentSite = 'aut'
    Now I am wondering what makes a client send a DDR with SiteCode as 'aut' and not the assigned or reporting site code? How can I resolve this, without having to run the delete statement?
    Thanks
    Rajiv

    ok, We were using a custom client health solution that was creating a DDR with the site code as AUTO. The DDR process only accepts 3 digit code, which was causing the DDM to fault. Reinstalling the agent and re-configuration of the client health solution
    seems to have fixed the issue.
    Thanks, Rajiv

  • Cannot insert duplicate key row in object

    This is a JPA question. The tbHardware table has a PK identity column and a unique non-clustered index on CoxBarcode column.
    I have a SFSB in a Seam2.0.0.GA app running on JBoss 4.2.1.GA. I am using flushMode=FlushModeType.MANUAL (Seam specific when beginning a conversation) and that's why you see the flush() reference at the end of the following code snippet.
    Query query = entityManager.createNativeQuery("INSERT INTO tbHardware "+
                                                 "VALUES (:coxBarCode, :serialNo, :currentStatus, :currentLocationNo, "+
                                                 ":desc, :hardwareModelId, :ownerTypeCode, :firstEnteredDate, :enteredByUser, :lastAuditDate, :hardwarePrice, null)")
                                              .setParameter("coxBarCode", coxBarcode)
                                              .setParameter("serialNo", serialNo)
                                              .setParameter("currentStatus", curstatus)
                                              .setParameter("currentLocationNo", curloc)
                                              .setParameter("desc", desc)
                                              .setParameter("hardwareModelId", selmodid)
                                              .setParameter("ownerTypeCode", selectedOwner)
                                              .setParameter("firstEnteredDate", firstEnteredDate)
                                              .setParameter("enteredByUser", enteredByUser)
                                              .setParameter("lastAuditDate", lastAuditedDate)
                                              .setParameter("hardwarePrice", unitPrice);
                             query.executeUpdate();
                             query = entityManager.createNativeQuery("INSERT INTO TbHardwareHistory "+
                                            "VALUES (:hardwareId, :currentStatus, :currentLocationNo, :firstEnteredDate, null, :enteredByUser, :ownerTypeCode)")
                                             .setParameter("hardwareId", findHardwareId(coxBarcode))                                        
                                             .setParameter("currentStatus", curstatus)
                                             .setParameter("currentLocationNo", curloc)          
                                             .setParameter("firstEnteredDate", firstEnteredDate)
                                             .setParameter("enteredByUser", enteredByUser)
                                             .setParameter("ownerTypeCode", selectedOwner);
                             query.executeUpdate();
                             //TO DO: following query should return only one entity, need to refactor and remove the for loop below
                             TbHardware hw = (TbHardware)entityManager.createNativeQuery("SELECT t FROM tbHardware t WHERE t.coxBarCode = :coxBarCode AND t.serialNo = :serialNo", TbHardware.class)
                                                                                    .setParameter("coxBarCode", coxBarcode)
                                                                                    .setParameter("serialNo", serialNo)
                                                                                    .getSingleResult();
                             Integer hardwareId = hw.getHardwareId();
                             query = entityManager.createNativeQuery("INSERT INTO tbHardwareNote VALUES (:hardwareId, :hardwareNote)")
                                                   .setParameter("hardwareId", hardwareId).setParameter("hardwareNote", hardwareNote);
                             query.executeUpdate();
                             entityManager.flush();I am getting the following in the server.log:
    10:10:57,552 ERROR [STDERR] Caused by: org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
    10:10:57,552 ERROR [STDERR]      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:174)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1163)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:334)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:48)
    10:10:57,552 ERROR [STDERR]      ... 138 more
    10:10:57,552 ERROR [STDERR] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.tbHardware' with unique index 'IX_tbHardwar_coxBarCode_UNIQUE'.
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)
    10:10:57,552 ERROR [STDERR]      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
    10:10:57,552 ERROR [STDERR]      at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:165)
    10:10:57,552 ERROR [STDERR]      ... 141 moreHow should I handle this SQLServerException? What is the best practice regarding this from a JPA perspective? I thought about executing a select query prior to the insert in tbHardware to check to see if a record with that particular coxBarCode exists or not. Would the exception be handled differently if I used the persist() method instead of the createNativeQuery() and executeUpdate() combination? thx.
    Edited by: asookazian on May 7, 2008 11:07 AM

    kajbj wrote:
    What do you mean by control? Yes, you can find duplicates and remove them (by e.g. implementing a Comparator and adding them to a Set)
    KajI mean to say replace the duplication with just a single value for insert!
    Any psuedo for the comparactor suggested?

  • Getting constraint errorr for INSERT? Cannot insert duplicate key row in object 'etag.Tag_Processed' with unique index 'IX_Tag_Processed'

    I have an index constraint "IX_Tag_Processed" on the field "Tag_Name" for the table "Tag_Processed". I keep getting this constraint error:
    Msg 2601, Level 14, State 1, Line 15
    Cannot insert duplicate key row in object 'etag.Tag_Processed' with unique index 'IX_Tag_Processed'. The duplicate key value is (AZPS_TEMUWS0110BL4_CISO).
    The statement has been terminated.
    For this INSERT: I have tried using tagstg.Tag_Name NOT IN with same result:
    INSERT into [Forecast_Data_Repository].[etag].[Tag_Processed] (Tag_Name, Tag_Type,Start_Datetime, End_Datetime, Source_SC, Sink_SC, Source_CA, Sink_CA, Source, Sink, Load_dt, Energy_product_code_id)
    SELECT DISTINCT (Tag_Name), Tag_Type,Start_Datetime, End_Datetime, Source_SC, Sink_SC, Source_CA, Sink_CA, Source, Sink, GETUTCDATE(),  [Forecast_Data_Repository].rscalc.GetStubbedEngProductCodeFromStaging(tagstg.Tag_Name)
    FROM [Forecast_Data_Repository].[etag].[Tag_Stg] tagstg
    WHERE tagstg.Id BETWEEN @minTId AND @maxTId --AND
    --tagstg.Tag_Name NOT IN (
    -- SELECT DISTINCT tproc.Tag_Name from [Forecast_Data_Repository].[etag].[Tag_Processed] tproc
    thank you  in advance, 
    Greg Hanson

    I have even tried a merge with the same constraint error,
    DECLARE @minTId bigint, @minTRId bigint, @minEId bigint
    DECLARE @maxTId bigint, @maxTRId bigint, @maxEId bigint
    DECLARE @errorCode int
    DECLARE @ReturnCodeTypeIdName nvarchar(50)
    SELECT @minTRId = Min(Id) FROM [etag].[Transmission_Stg]
    SELECT @maxTRId = Max(Id) FROM [etag].[Transmission_Stg]
    SELECT @minTId = Min(Id) FROM [etag].[Tag_Stg]
    SELECT @maxTId = Max(Id) FROM [etag].[Tag_Stg]
    DECLARE @MergeOutputTag TABLE
    ActionType NVARCHAR(10),
    InsertTagName NVARCHAR(50)
    --UpdateTagName NVARCHAR(50)
    --DeleteTagName NVARCHAR(50)
    DECLARE @MergeOutputEnergy TABLE
    ActionType NVARCHAR(10),
    InsertTagId BIGINT
    --UpdateTagName NVARCHAR(50)
    --DeleteTagName NVARCHAR(50)
    DECLARE @MergeOutputTransmission TABLE
    ActionType NVARCHAR(10),
    InsertTagId BIGINT
    --UpdateTagName NVARCHAR(50)
    --DeleteTagName NVARCHAR(50)
    MERGE [Forecast_Data_Repository].[etag].[Tag_Processed] tagProc
    USING [Forecast_Data_Repository].[etag].[Tag_Stg] tagStg
    ON 
    tagProc.Tag_Name = tagStg.Tag_Name AND
    tagProc.Tag_Type = tagStg.Tag_Type AND
    tagProc.Start_Datetime = tagStg.Start_Datetime AND
    tagProc.End_Datetime = tagStg.End_Datetime AND
    tagProc.Source_SC = tagStg.Source_SC AND
    tagProc.Source_CA = tagStg.Source_CA AND
    tagProc.Sink_CA = tagStg.Sink_CA AND
    tagProc.Source = tagStg.Source AND
    tagProc.Sink = tagStg.Sink 
    WHEN MATCHED THEN
    UPDATE
    SET Tag_Name = tagStg.Tag_Name,
    Tag_Type = tagStg.Tag_Type,
    Start_DateTime = tagStg.Start_Datetime,
    End_Datetime = tagStg.End_Datetime,
    Source_SC = tagStg.Source_SC,
    Sink_SC = tagStg.Sink_SC,
    Source_CA = tagStg.Source_CA,
    Sink_CA = tagStg.Sink_CA,
    Source = tagStg.Source,
    Sink = tagStg.Sink,
    Load_dt = GETUTCDATE()
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (Tag_Name, Tag_Type, Start_Datetime, End_Datetime, Source_SC, Sink_SC, Source_CA, Sink_CA, Source, Sink, Load_dt)
    VALUES (tagStg.Tag_Name, tagStg.Tag_Type, tagStg.Start_Datetime, tagStg.End_Datetime, tagStg.Source_SC, tagStg.Sink_SC, tagStg.Source_CA, tagStg.Sink_CA, tagStg.Source, tagStg.Sink, GETUTCDATE())
    OUTPUT
    $action,
    INSERTED.Tag_Name
    --UPDATED.Tag_Name
    INTO @MergeOutputTag;
    SELECT * FROM @MergeOutputTag;
    Greg Hanson

Maybe you are looking for

  • Advice on how to setup my systems (xen, gpu passthrough, X)

    Hello Archers I'll try to keep it as short as possible What I want: I want to run different operating systems at the same time. I want to be able to switch between them fast. I want all keys to work in the guest systems (I've had trouble getting alon

  • Red lines/glitched 1080p video streaming XBMC in Mavericks

    Hello, This is so weird because I don't think this was happening the first weekend after installing Mavericks, but in the last few days, my XBMC is playing 1080p videos I'm streaming all messed up.  There are odd red lines and glitches in the video t

  • Error 500 when open  CMC- need help

    hi i install bo 4X pathch 3 2 month it workes well until - suddenly it get an error when opening CMC. PLEASE I WILL GLADE TO HERE SOME SUGGESTION . WHAT GOES WRONG? message HTTP STATUS 500 description The server encountered an internal error () that

  • Mysaifu: a simple question about dll

    Hi, I have downloaded the software Mysaifu. I have installed only Mysaifu JVM and nothing else on my Pocket PC. I have to write an application that use JNI and it have to work in a pocket PC. I have write a simple program, the usual Hello World, that

  • Address bar and backward/forward arrow

    Somehow the backward and forward arrows have disappeared off of the top of my Safari page, as has the area on top where you would type in an internet address. Any ideas?