OMS Upgrade Fails At Repository Configuration With Error ORA-20251

Yesterday, one of my blog readers asked me how I didn’t encounter ORA-20251 error when upgrading my EM12c to EM13c. He also pointed My Oracle Support document (Doc ID 2095025.1). The document says a new record will be inserted into EM_COST_CENTERS table (in fact the table name is EM_COST_CENTERS_E but it’s not important) for all users whose department value is not blank during the upgrade. If there are more than one records with blank cost center then the second record will be considered as duplicate, resulting in the above error during the repository configuration.

Here’s the sample output:

I asked my reader to examine the EM users and he said there are not any EM users whose department value is not blank. So today, I examined the upgrade script and see that it’s not just about the department value. The upgrade scrip also tries to insert new “cost center” records for the users whose Line of business value is not blank.

Here’s the list of my EM users:

As you can see, there’s only one user whose department and line of business values are not blank. The upgrade script (cost_center_data_upgrade.sql) will create a new cost center for the department of this user, and there won’t be any error. On the other hand, if there were another user whose cost center value is blank but department or line of business value is not blank, the script would try to create another cost center and it would cause a duplicate record violating unique constraint (COST_CENTER_NAME, TENANT_ID) on EM_COST_CENTERS_E table.

So before you upgrade the EM13c, you better check your users with the following command (I break the line so it can fit to the page, you can write it as one-line):

If there are multiple users with department or line of business value but not assigned to a cost center, you will hit the bug. Unfortunately, the My Oracle Support document doesn’t provide clear instructions to fix the problem. I recommend you to contact support and ask them to update the document (Doc ID 2095025.1). Meanwhile, if you feel adventurous, you may use a script similar to the below one, to set department value (or line of business value) to cost center value:

Before executing the script:

After the executing the script:

After assigning cost centers to the users, the upgrade script will work without getting any error.

Please share

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.


  1. AlexVin

    I wrote the script, which at the time of installation determines whether the file has appeared, and replaces it with the text as described in 2095025.1

    echo `date`
    while [ "$var1" != "end" ] 
    if [[ $(find $dirto -type f -wholename "$filto") ]]; then
     /bin/grep -v "Rem drv: <migrate type=" $filto > $filfrom
     /bin/cat $filfrom > $filto
     echo "done"
     sleep 2
    echo `date`
    exit 0

Leave Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.