Issue
When attempting to create or import a Style Book, the following error appears in the logs:
ORA-00904: "MVCCVERSION": invalid identifier.
Environment
- DXP 7.3 SP3
- DXP 7.4 Update 4
Resolution
This issue occurs because the STYLEBOOKENTRY and STYLEBOOKENTRYVERSION database tables were not successfully upgraded. The root cause is linked to the missing MVCCVERSION column, which was not added due to the bug described in https://liferay.atlassian.net/browse/LPS-127285
To resolve this issue, follow one of the two approaches below:
-
Re-run the Upgrade Process
Ensure that LPS-162305 is applied in your environment, then perform the upgrade again. This will correctly add the missing MVCCVERSION column. - Add the Missing Columns: if re-running the upgrade is not feasible, use the following Groovy script to manually add the missing MVCCVERSION columns to the affected tables:
import com.liferay.portal.kernel.dao.jdbc.DataAccess; import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; out.print("SQL update script for fix column \n") out.print("--------------------------------------------------------\n") Connection connection = DataAccess.getConnection(); String[] tables = ["styleBookEntry","styleBookEntryVersion"]; for(String table : tables){ sql = "ALTER TABLE "+ table + " ADD COLUMN mvccVersion int8 default 0 NOT NULL"; try{ Statement stmt = connection.createStatement(); out.print("\nSQL: "+sql); stmt.executeUpdate(sql); }catch(Exception e){ out.print("\n\tWarning: table not found: " + e); } } out.print("--------------------------------------------------------\n") out.println("\n\nEND OF SCRIPT");
Additional information
- Ensure you back up your database before applying any changes.
- After adding the columns, test the functionality to confirm the issue is resolved.
- By following these steps, you should be able to successfully create or import Style Books without encountering the MVCCVERSION error.
- Article about similar error updating to 7.4