Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-22158

Ambari schema upgrade fails when upgrading ambari from 2.5.1.0 to 2.6.0.0 and using oracle as database

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.6.0
    • 2.6.0
    • ambari-server
    • None

    Description

      While upgrading ambari from 2.5.1.0 to 2.6.0.0 using oracle database, schema upgrade fails with the below exception

      05 Oct 2017 08:23:00,312  INFO [main] DBAccessorImpl:874 - Executing query: ALTER TABLE VIEWURL DROP PRIMARY KEY
      05 Oct 2017 08:23:00,342 ERROR [main] DBAccessorImpl:880 - Error executing query: ALTER TABLE VIEWURL DROP PRIMARY KEY
      java.sql.SQLSyntaxErrorException: ORA-02273: this unique/primary key is referenced by some foreign keys
      
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
      at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
      at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
      at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1890)
      at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1855)
      at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:304)
      at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:877)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1045)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1053)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1344)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.addViewUrlPKConstraint(UpgradeCatalog260.java:206)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:196)
      at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
      05 Oct 2017 08:23:00,347 ERROR [main] SchemaUpgradeHelper:202 - Upgrade failed.
      java.sql.SQLSyntaxErrorException: ORA-02273: this unique/primary key is referenced by some foreign keys
      
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
      at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
      at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
      at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1890)
      at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1855)
      at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:304)
      at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:877)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1045)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1053)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1344)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.addViewUrlPKConstraint(UpgradeCatalog260.java:206)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:196)
      at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
      05 Oct 2017 08:23:00,347 ERROR [main] SchemaUpgradeHelper:437 - Exception occurred during upgrade, failed
      org.apache.ambari.server.AmbariException: ORA-02273: this unique/primary key is referenced by some foreign keys
      
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:203)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:418)
      Caused by: java.sql.SQLSyntaxErrorException: ORA-02273: this unique/primary key is referenced by some foreign keys
      
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
      at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
      at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:999)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
      at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1890)
      at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1855)
      at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:304)
      at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:877)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1045)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1053)
      at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccessorImpl.java:1344)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.addViewUrlPKConstraint(UpgradeCatalog260.java:206)
      at org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:196)
      at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923)
      at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:200)
      ... 1 more
      

      Cluster info :
      Base Ambari : 2.5.1.0
      Upgraded Ambari : 2.6.0.0-183

      Attachments

        1. AMBARI-22158.patch
          2 kB
          Dmitry Lysnichenko

        Issue Links

          Activity

            People

              dmitriusan Dmitry Lysnichenko
              dmitriusan Dmitry Lysnichenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: