Base solution for your next web application
Open Closed

Got the error "ORA-00972: identifier is too long" when running "Update-Database" on Oracle #9423


User avatar
0
quantavn created

We are trying migrating our project (ANZ v7.2.0 - ASP.NET Core + Angular) from MS SQL Server to Oracle 11g but we got this error when running "Update-Database":

PM> update-database --verbose
Applying migration '20170406083347_Initial_Migration'.
2020-07-27 23:02:16.447396 ThreadID:1   (ERROR)   OracleRelationalCommand.Execute() :  Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-00972: identifier is too long
ORA-06512: at line 2
   at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
   at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, Boolean isFromEF)
   at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery()
   at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
Failed executing DbCommand (38ms) [Parameters=[], CommandType='Text', CommandTimeout='0']
BEGIN 
EXECUTE IMMEDIATE 'CREATE TABLE 
"AbpNotifications" (
    "Id" RAW(16) NOT NULL,
    "CreationTime" TIMESTAMP(7) NOT NULL,
    "CreatorUserId" NUMBER(19),
    "Data" NCLOB,
    "DataTypeName" NVARCHAR2(512),
    "EntityId" NVARCHAR2(96),
    "EntityTypeAssemblyQualifiedName" NVARCHAR2(512),
    "EntityTypeName" NVARCHAR2(250),
    "ExcludedUserIds" NCLOB,
    "NotificationName" NVARCHAR2(96) NOT NULL,
    "Severity" NUMBER(3) NOT NULL,
    "TenantIds" NCLOB,
    "UserIds" NCLOB,
    CONSTRAINT "PK_AbpNotifications" PRIMARY KEY ("Id")
)';
END;

After investigating, we found the problem is because the column name is too long (EntityTypeAssemblyQualifiedName: 31 vs the limitation of Oracle 11g is 30).

Is there any suggestion to solve this issue? I know this limitation is solve from Oracle 12c but we must use Oracle 11g (even older versions as well).


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can refer to this https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4811