Entity Framework Oracle and Sql Server - how to build a database independent application Entity Framework Oracle and Sql Server - how to build a database independent application oracle oracle

Entity Framework Oracle and Sql Server - how to build a database independent application


There is no way to have single EDMX for both SQL Server and Oracle. EDMX consists of three parts CSDL (entity definition), SSDL (database definition), MSL (mapping between those definitions). SSDL must always target concrete database so you need at least separate SSDL for Oracle and SQL Server and if you are lucky you will not need separate MSL as well (mapping must be exactly same which will probably not happen if you are using any tool to generate the database).

So you always need at least part of EDMX file for second DB and manually maintain it.

If you need DB migration supporting Oracle you must look for tool from Oracle (or third party). For example RedGate offers tools supporting schema migration for both SQL Server and Oracle.

Visual Studion Premium and Ultimate edition also offers tools for comparing database schemas. It by default supports only SQL Server but Toad Extensions should add support for Oracle as well.

Once you have any of these tools you just need to compare schema deployed on customer server with your new schema and the tool should create migration script for you.


The best article I found on this topic is from Paul Reynolds Blog.Try to go through from part 5 to part 9.

There are so many gotchas about Oracle mentioned there... is very helpful!