The upgrade from 6.3 to 6.5 fails with below error
ERROR (com.nolio.platform.server.dataservices.services.upgrade.UpgradeServiceImpl:268) - Error calling Flyway Migrate org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:Migration V6.4.0.0.201612191532037__alter_audit_table_datatypes_-_ORACLE.sql failed
During analysis we can see below error in the nolio_center_upgrade.log
2017-12-28 12:23:51,868 [localhost-startStop-1] ERROR (com.nolio.platform.server.dataservices.services.upgrade.UpgradeServiceImpl:268) - Error calling Flyway Migrate org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: Migration V6.4.0.0.201612191532037__alter_audit_table_datatypes_-_ORACLE.sql failed
-----------------------------------------------------------------------------------SQL State : 61000
Error Code : 54
Message : ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
ORA-06512: at line 10
Location : /opt/nolio/NolioAutomationCenter/webapps/datamanagement/resources/db/migration/oracle/V6.4.0.0.201612191532037__alter_audit_table_datatypes_-_ORACLE.sql (/opt/nolio/NolioAutomationCenter/webapps/datamanagement/resources/db/migration/oracle/V6.4.0.0.201612191532037__alter_audit_table_datatypes_-_ORACLE.sql)
The above error which reflect a NOWAIT or timeout occurred due to lock on one or more table (which ideally should not be the case), but in some environment the lock retains and blocks flyway from successful migration.
Below are the steps to follow to resolve above upgrade issue.
update "schema_version" set "success" = 1 where "version" = '6.4.0.0.201612191532037';
commit;
To minimize the likelihood of the script failing during the production upgrade:
-- substitute accordingly for the actual name of the RA_DB_USER
-- (1) How many running any open transactions for NOLIO user?
SELECT count(*)FROM v$transaction t, v$session s WHERE t.ses_addr = s.saddr AND s.username = 'RA_DB_USER';
-- (2) Get the sql for running transactions for NOLIO user
SELECT s.sql_id, sql.sql_text FROM v$transaction t inner join v$session s on t.ses_addr = s.saddr left join v$sql sql on sql.sql_id = s.sql_id where s.username = 'RA_DB_USER';