How to Migrate On-Premise Oracle Database onto AWS RDS Microsoft SQL Server

Introduction

This article will demonstrate step by step how to migrate on-premise Oracle database onto AWS RDS SQL Server, the issues encountered plus their solutions and workarounds during the migration.

The following environment and tools will be involved in this activity:

  • Oracle Database 19c
  • SQL Server 2019
  • AWS RDS SQL Server 2019
  • Oracle Client 19c
  • AWS Database Migration Service ( DMS) or AWS S3
  • SQL Server Management Studio ( SSMS )
  • Microsoft SQL Server Migration Assistant (SSMA) for Oracle

There is no direct migration on-premise Oracle database onto AWS SQL Server RDS, so the the high level migration procedure will be:

  1. Migrate on-premise Oracle database by using SSMA to on-premise SQL Server database.
  2. Migrate on-premise SQL Server database onto AWS RDS SQL Server.

Subscribe to get access

Read more of this content when you subscribe today.

Oracle Large Tables Partially Migrated by SSMA from Oracle to SQL Server

In SSAM ( migration data from Oracle to SQL Server, there are big table with more than 10m records always partially migrated.

The following messages will be seen from SSMA console or SSMA logs.

...
..
.
Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
  Errors: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
...
..
.

OR

Starting data migration Engine
Starting data migration…
The data migration engine is migrating table '"DBUSER"."CDR"': > [DBPROD].[DBUSER].[CDR], 12129453 rows total
Table "DBUSER"."CDR" data migration: 1215859 rows processed.
Table "DBUSER"."CDR" data migration: 2427701 rows processed.
Table "DBUSER"."CDR" data migration: 3640494 rows processed.
Table "DBUSER"."CDR" data migration: 4852614 rows processed.
Completing migration of table "DBUSER"."CDR"…
Migration complete for table '"DBUSER"."CDR"': > [DBPROD].[DBUSER].[CDR], 5377300 rows migrated (Elapsed Time = 00:00:36:35:747).
Data migration operation has finished.
0 table(s) successfully migrated.
1 table(s) partially migrated.
0 table(s) failed to migrate.

Check the SSMA log ( C:\Users\USERNAME\AppData\Roaming\Microsoft SQL Server Migration Assistant\Oracle\log:

[Error: Datamigrator] [5696/37] [2020-10-31 13:53:37]: Error occurred while adding/enabling the constraints and indexes in bulk load optimization.
[Error: Datamigrator] [5696/37] [2020-10-31 13:53:37]: Exception: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
 site: Void OnError(System.Data.SqlClient.SqlException, Boolean, System.Action`1[System.Action])
 source: .Net SqlClient Data Provider
 error code: -2146232060
 data: [HelpLink.ProdName] = [Microsoft SQL Server]
 data: [HelpLink.ProdVer] = [14.00.3257]
 data: [HelpLink.EvtSrc] = [MSSQLServer]
 data: [HelpLink.EvtID] = [-2]
 data: [HelpLink.BaseHelpUrl] = [http://go.microsoft.com/fwlink]
 data: [HelpLink.LinkId] = [20476]
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.SSMA.Framework.Generic.DbUtilities.SsmaDbCommand.Execute[T](ExecutionDelegate`1 executionMethod)
   at Microsoft.SSMA.Framework.Generic.DbUtilities.SsmaDbCommand.ExecuteNonQuery()
   at Microsoft.SSMA.Framework.Generic.DefaultDataMigrationEngine.DataMigrationEngineBase`1.ExecuteSPWithParameters(IDbConnection connection, String query, String keyType, ConstraintsActionMode mode, Boolean parallelDM, Boolean bulkLoadOptimize)
   at Microsoft.SSMA.Framework.Generic.DefaultDataMigrationEngine.DataMigrationEngineBase`1.EnableOrDisableNonClusteredIndex(Boolean parallelDM, Boolean isEnable)
   at Microsoft.SSMA.Framework.Generic.DefaultDataMigrationEngine.DataMigrationEngineBase`1.PostBulkLoadOptimization(Boolean parallelDM, Boolean bulkLoadOptimize)
[Error: Datamigrator] [5696/37] [2020-10-31 13:53:37]: Inner Exception #1: The wait operation timed out
 site: 
 source: 
 error code: -2147467259

WORKAROUND

Subscribe to get access

Read more of this content when you subscribe today.

SQL Server Migration Assistant (SSMA) Tables Partially Migrated and High Memory Usage

PROBLEM

While we migrate a relatively big size database from Oracle to Microsoft SQL Server, all the small tables are migrated successfully without any issues. But the following issues occur from big tables migration.

  • “SSMAforOracle.exe” process consumes high memory, so the server got 99% memory utilization consistently.
  • For big tables with more than 10 million records, they are always partially migrated.
  • After big tables migration failure, we can see sometime the follow message in the migration log.

“Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.”

DataMigration Error. 
From : "SCHEMANAME"."TABLENAME"
To : [DBNAME].[SCHEMANAME].[TABLENAME] Execution Timeout [Error: Datamigrator] [9812/41] [2020-11-01 21:21:34]: Exception: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

It is not really a timeout issue. Even after increasing the “Data Migration Timeout” from default 5 mins to maximum 1440 mins( 24 hrs), the migration of big tables still fails.

SOLUTION

Subscribe to get access

Read more of this content when you subscribe today.