title: Oracle.ManagedDataAccess.EntityFramework - ORA-01918: user 'dbo' does not exist
body: <p>I am trying to implemente code First Migrations with Oracle.ManagedDataAccess 6.121.1.0 provider, but with no success at all.</p>
  
  <p>As I am receiving a ORA-code, I am assuming that the connection are been opened successfully. But the Migrations are failing because, maybe, the provider are behaving as a SQL Server, instead of Oracle. I think that beacause it is traying to use 'dbo' as default schema.</p>
  
  <p>Here is my web.config settings:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
     &lt;section name="entityFramework"
               type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
               requirePermission="false" /&gt;
      &lt;section name="Oracle.ManagedDataAccess.Client"
               type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /&gt;
    &lt;/configSections&gt;
    &lt;entityFramework&gt;
      &lt;contexts&gt;
        &lt;context type="MyProject.Context.MainContext, MyProject.Context"&gt;
          &lt;databaseInitializer type="MyProject.Context.Config.ContextInitializer, MyProject.Context" /&gt;
        &lt;/context&gt;
      &lt;/contexts&gt;
      &lt;defaultConnectionFactory type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess" /&gt;    
      &lt;providers&gt;    
        &lt;provider invariantName="Oracle.ManagedDataAccess.Client" 
                  type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    &lt;system.data&gt;
      &lt;DbProviderFactories&gt;
        &lt;remove invariant="Oracle.ManagedDataAccess.Client" /&gt;
        &lt;add name="ODP.NET, Managed Driver"
             invariant="Oracle.ManagedDataAccess.Client"
             description="Oracle Data Provider for .NET, Managed Driver"
             type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /&gt;
      &lt;/DbProviderFactories&gt;
    &lt;/system.data&gt;
    &lt;connectionStrings&gt;
      &lt;add name="MainContext"
           providerName="Oracle.ManagedDataAccess.Client"
           connectionString="Data Source=OracleServer:1521/BRSYSDS;User ID=USER;Password=PASSWORD;" /&gt;
    &lt;/connectionStrings&gt;
    &lt;!-- other settings --&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here the Stacktrace:</p>
  
  <blockquote>
    <p>[OracleException (0x77e): ORA-01918: user 'dbo' does not exist]<br>
    OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl connectionImpl, Int32&amp; cursorId, Boolean bThrowArrayBindRelatedErrors, OracleException&amp; exceptionForArrayBindDML, Boolean&amp; hasMoreRowsInDB, Boolean bFirstIterationDone) +652
    OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl connectionImpl, Int32&amp; cursorId, Boolean bThrowArrayBindRelatedErrors, OracleException&amp; exceptionForArrayBindDML, Boolean bFirstIterationDone) +39<br>
    OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]&amp; scnFromExecution, OracleParameterCollection&amp; bindByPositionParamColl, Boolean&amp; bBindParamPresent, OracleException&amp; exceptionForArrayBindDML, Boolean isFromEF) +7480<br>
    Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery() +678<br>
    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.b__0(DbCommand t, DbCommandInterceptionContext<code>1 c) +10<br>
    System.Data.Entity.Infrastructure.Interception.InternalDispatcher</code>1.Dispatch(TTarget target, Func<code>3 operation, TInterceptionContext interceptionContext, Action</code>3 executing, Action<code>3 executed) +72<br>
    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) +357<br>
    System.Data.Entity.Internal.InterceptableDbCommand.ExecuteNonQuery() +104<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteSql(DbTransaction transaction, MigrationStatement migrationStatement, DbInterceptionContext interceptionContext) +152<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable</code>1 migrationStatements, DbTransaction transaction, DbInterceptionContext interceptionContext) +82<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable<code>1 migrationStatements, DbConnection connection) +626<br>
    System.Data.Entity.Migrations.&lt;&gt;c__DisplayClass30.&lt;ExecuteStatements&gt;b__2e() +19<br>
    System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation) +9<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable</code>1 migrationStatements, DbTransaction existingTransaction) +194<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable<code>1 migrationStatements) +7<br>
    System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String migrationId, XDocument targetModel, IEnumerable</code>1 operations, IEnumerable<code>1 systemOperations, Boolean downgrading, Boolean auto) +825<br>
    System.Data.Entity.Migrations.DbMigrator.AutoMigrate(String migrationId, VersionedModel sourceModel, VersionedModel targetModel, Boolean downgrading) +564<br>
    System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable</code>1 pendingMigrations, String targetMigrationId, String lastMigrationId) +404<br>
    System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration) +447<br>
    System.Data.Entity.Migrations.&lt;>c__DisplayClassc.b__b() +13<br>
    System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +422<br>
    System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +78<br>
    System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func<code>3 createMigrator, ObjectContext objectContext) +89<br>
    System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) +116<br>
    System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +218<br>
    System.Data.Entity.DropCreateDatabaseAlways</code>1.InitializeDatabase(TContext context) +137   </p>
  </blockquote>