Getting into a consulting business has its own set of challenges that I cherish big time. Recently I was consulted by a product team that had some of the best guys in the market. I was surprised why they might need my services. But I had an open mind to go through what they were doing. They were migrating their current application that was running fine in Oracle to SQL Server. My first thought was – “Wow”. Currently enterprises and organizations do think of SQL Server as a viable, competent alternative when it comes to database choice.
Now this was obviously not the problem. They had some application logic and were actually doing the same code of ETL to push data from Oracle to SQL Server. It was all fine, but suddenly when there was considerable load they were seeing some performance problems. I was not sure why something behaves so differently when compared to Oracle.
I started the profiler and I was waiting to see what were some of the plans that were getting generated. I was surprised to see tons of implicit converts happening in the system when the profiler was working at the backend. On further investigation the Application team said they used a number of options working inside Oracle like Number (x) datatypes and were using a safe bet of Int / BigInt when working with SQL Server. Worst was, the application that was sending the generic code had no clue of this.
This set me into this journey of educating the migration team on how important it is to send the appropriate data when working inside SQL Server. These might not be simple and I don’t recollect writing about these. See below a pseudo mapping of datatypes that one needs to use when doing such migration exercise.
It is important to take the time to do profiling on the data in your source database to know what you are moving over. People often use data types that are too big and unnecessary for the application – this needs to be avoided. For example, if the application only uses ‘Int’ then use ‘Int’. Again, this is an opportunity to improve the architecture and implementation as part of a migration.
Note: that “Blobs” can be difficult to move over. SSIS is the best tool to use in this case.
As I wrap up, I would love to hear about how you used or mapped datatypes when migrating or working with Oracle and SQL Server? Do share your tips and tricks as we can learn together.
Reference: Pinal Dave (https://blog.sqlauthority.com)