oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
417 stars 190 forks source link

dotnet8:ORA-00904: "DEFAULT_COLLATION" #419

Open blackmaple opened 1 week ago

blackmaple commented 1 week ago

Oracle version:11.2.0.4.0

Scaffold-DbContext -Force "User Id=xxx;Password=xxx;Data Source=xxx/ORCL;" Oracle.EntityFrameworkCore Build started... Build succeeded. To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. 2024-11-08 14:41:10.610814 ThreadID:1 (ERROR) OracleDatabaseModelFactory.Create() : Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-00904: "DEFAULT_COLLATION": 标识符无效 https://docs.oracle.com/error-help/db/ora-00904/ at OracleInternal.ServiceObjects.OracleFailoverMgrImpl.OnError(OracleConnection connection, CallHistoryRecord chr, Object mi, Exception ex, Boolean bTopLevelCall, Boolean& bCanRecordNewCall) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteScalar() at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.gGetCollation|9_0(DbConnection connection, String schema) at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.Create(DbConnection connection, IEnumerable1 tables, IEnumerable1 schemas) Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-00904: "DEFAULT_COLLATION": 标识符无效 https://docs.oracle.com/error-help/db/ora-00904/ at OracleInternal.ServiceObjects.OracleFailoverMgrImpl.OnError(OracleConnection connection, CallHistoryRecord chr, Object mi, Exception ex, Boolean bTopLevelCall, Boolean& bCanRecordNewCall) at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteScalar() at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.gGetCollation|9_0(DbConnection connection, String schema) at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.Create(DbConnection connection, IEnumerable1 tables, IEnumerable1 schemas) at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.Create(DbConnection connection, DatabaseModelFactoryOptions options) at Oracle.EntityFrameworkCore.Scaffolding.Internal.OracleDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions) at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable1 schemas, IEnumerable1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable1 schemaFilters, IEnumerable1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>cDisplayClass0_0.<.ctor>b0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>cDisplayClass3_0`1.b0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) ORA-00904: "DEFAULT_COLLATION": 标识符无效 https://docs.oracle.com/error-help/db/ora-00904/

alexkeh commented 1 week ago

Which version of Oracle EF Core are you using?

If you have scaffolded with an earlier EF Core version, did it succeed? If it succeeded, what Oracle EF Core version did you use and did you change anything when using EF Core 8?

Can you share the verbose scaffolding trace and test case? The DB scripts will be the key part of the test case.

The main challenge will be that DB 11.2.0.4 is no longer supported. ODP.NET is no longer tested against that version. If the problem is specific to DB 11.2.0.4, we may not be able to fix it.