Saturday, May 9, 2026

Execution Phase In Migrating Oracle Database to SQL Server on Azure VM WITH VLDBs

Execution Phase In Migrating Oracle Database to SQL Server on Azure VM


1. What “During Migration” Really Means

This phase includes:

  1. Initial data load (bulk transfer)

  2. Continuous sync (change tracking)

  3. Monitoring performance and errors

  4. Final cutover (switch users to SQL Server on EC2)


2. Choose Your Migration Method (Final Decision)

For large databases:

Best Practice: Hybrid Online Migration

You will:

  1. Do initial bulk load

  2. Keep syncing changes

  3. Do final cutover with minimal downtime


3. Architecture Overview 

You now have:

  • Oracle (still running, production)

  • SQL Server on Azure VM (target)

  • Migration tool (Azure DMS or SSMA)


4. Step 1: Prepare Target Database (SQL Server)


4.1 Create Empty Database

CREATE DATABASE MigrationDB
ON 
(
    NAME = MigrationDB_Data,
    FILENAME = 'D:\SQLData\MigrationDB.mdf',
    SIZE = 500GB,
    FILEGROWTH = 10GB
)
LOG ON
(
    NAME = MigrationDB_Log,
    FILENAME = 'E:\SQLLogs\MigrationDB.ldf',
    SIZE = 200GB,
    FILEGROWTH = 5GB
);

4.2 Set Recovery Model

For large migration:

ALTER DATABASE MigrationDB SET RECOVERY BULK_LOGGED;

This improves bulk insert speed


5. Step 2: Deploy Schema (From SSMA)


5.1 Apply Converted Schema

In SSMA:

 Click “Synchronize with Database”


5.2 Validate Objects

SELECT name, type_desc
FROM sys.objects
ORDER BY type_desc;

6. Step 3: Initial Data Load (Bulk Migration)


Option A (Recommended): Azure Data Migration Service (DMS)


6.1 Create Migration Project

Steps:

  1. Go to Azure Portal

  2. Create Azure Database Migration Service

  3. Choose:

    • Source: Oracle

    • Target: SQL Server


6.2 Configure Migration

  • Mode: Online

  • Select schemas

  • Enable parallel load


6.3 Start Migration

This begins full data load while Oracle is still running


Option B: SSMA Data Migration (Smaller Segments)


6.4 Migrate Data via SSMA

  • Right-click schema

  • Select “Migrate Data”


For 10TB+, do NOT rely only on SSMA


7. Step 4: Parallel Data Transfer (VERY IMPORTANT)


For large databases, you must split work.


7.1 Example Strategy

Instead of  one huge table transfer

Do: Partition-based transfer


7.2 Example Parallel Insert Script

INSERT INTO dbo.BigTable WITH (TABLOCK)
SELECT *
FROM OPENQUERY(ORACLE_LINKED_SERVER, 
'SELECT * FROM BIG_TABLE WHERE PARTITION_ID = 1');

Run multiple jobs:

  • Partition 1

  • Partition 2

  • Partition 3


This reduces migration time from weeks → days


8. Step 5: Enable Change Tracking (Sync Phase)


You must capture ongoing changes.


Oracle Side (Log-based approach)

Use:

  • Archive logs

  • Or CDC tools (via DMS)


SQL Server Side

ALTER DATABASE MigrationDB
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 7 DAYS, AUTO_CLEANUP = ON);

9. Step 6: Continuous Sync


Azure DMS will:

  • Capture inserts

  • Capture updates

  • Capture deletes


This keeps SQL Server almost up to date


10. Step 7: Monitor Migration (CRITICAL)


10.1 Monitor SQL Server Activity

SELECT 
    session_id,
    status,
    command,
    cpu_time,
    total_elapsed_time
FROM sys.dm_exec_requests;

10.2 Check Wait Stats

SELECT wait_type, wait_time_ms
FROM sys.dm_os_wait_stats
ORDER BY wait_time_ms DESC;


10.3 Monitor Disk Performance

SELECT * FROM sys.dm_io_virtual_file_stats(NULL, NULL);


10.4 Azure Monitoring

Use:

  • Azure Monitor

  • Log Analytics


11. Step 8: Handle Common Migration Problems


Problem 1: Migration is TOO SLOW

Causes:

  • Network bottleneck

  • Disk I/O slow

Fix:

  • Increase VM size

  • Use Premium SSD

  • Increase parallel jobs


Problem 2: Data Type Errors

Example:

  • Oracle DATE vs SQL DATETIME

Fix:

Manual conversion


Problem 3: Deadlocks

SELECT * FROM sys.dm_tran_locks;

Reduce batch size


Problem 4: Transaction Log Full


Fix:

BACKUP LOG MigrationDB 
TO DISK = 'E:\Backup\log.trn';


12. Step 9: Data Validation (While Running)


12.1 Row Count Check

SELECT COUNT(*) FROM dbo.BigTable;

Compare with Oracle



12.2 Checksum Validation

SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*)) 
FROM dbo.BigTable;


13. Step 10: Final Cutover (THE BIG MOMENT)


This is where everything switches.


13.1 Announce Downtime

Example:

“System will be unavailable for 30 minutes”



13.2 Stop Application Writes

  • Disable app connections

  • Put system in read-only mode



13.3 Final Sync

Run last sync via DMS



13.4 Verify Data

  • Row counts match

  • No missing records



13.5 Switch Connection String

From:

OracleConnectionString

To:

SQLServerConnectionString


13.6 Bring System Online


14. Step 11: Immediate Post-Cutover Checks


Check 1: Login Success

SELECT name FROM sys.sql_logins;


Check 2: Application Queries

Run test queries



Check 3: Performance

Compare with baseline



15. Real-World Migration Timeline Example


Day 1–3:
Schema conversion

Day 4–10:
Initial data load

Day 11–14:
Continuous sync

Day 15:
Final cutover (30–60 min downtime)


16. Emergency Rollback Plan (VERY IMPORTANT)


If something fails:


Option 1: Revert to Oracle

  • Switch connection back

  • Resume operations



Option 2: Partial rollback

  • Fix issues

  • Resume sync



17. War Room Execution Script (Real-Life)


During cutover:


DBA:

“Stopping writes now”

App Team:

“Confirmed, no active transactions”

DBA:

“Running final sync”

DBA:

“Validation complete”

DBA:

“Switching connection strings”

Team:

“System live”


Common Challenges in The Execution Phase of Migrating Oracle Databases to SQL Server On Azure VM WITH VLDBS

Common Challenges in The Execution Phase of Migrating Oracle Databases to SQL Server On Azure VM WITH VLDBS 


Once the "Go" button is pressed, the nature of the project shifts from planning to active execution. This phase is often the most stressful because it involves a lot of moving parts and real-time risks.

Here are the most common challenges encountered during the migration process and how to handle them.


1. Unexpected Data Corruption

Even with clean source data, packets can be lost or corrupted during the actual transit. This leads to "broken" files or database records that look fine on the surface but fail when accessed by an application.

  • The Solution: Implement Checksum Validation. Use automated scripts to compare the hash of the data at the source and the destination. If the hashes don't match exactly, the system should automatically re-run the transfer for that specific block.

2. Real-Time Performance Bottlenecks

Moving large volumes of data can saturate your network or CPU, causing "throttling." This slows down the migration to a crawl and can even crash the systems you are trying to move from.

  • The Solution: Use Rate Limiting and Traffic Shaping. Schedule heavy data movements during off-peak hours and use tools that allow you to cap bandwidth usage. This ensures the migration doesn't "choke" the very business operations it's trying to support.

3. Configuration Drift

In the time between your last pre-migration audit and the actual move, someone might have changed a setting or updated a patch on the source system. This "drift" means you are migrating something different than what you tested.

  • The Solution: Use Infrastructure as Code (IaC). By using scripts (like Terraform or Ansible) to deploy your new environment, you ensure that the destination is built to exact specifications, regardless of small manual changes that occurred on the old hardware.


4. Latency Between Hybrid Components

During a phased migration, some parts of your app are in the new cloud while others are still on-premise. This "split-brain" state often introduces massive latency, making the application feel sluggish or broken.

  • The Solution: Establish a Dedicated Interconnect. Use high-speed, low-latency links (like AWS Direct Connect or Azure ExpressRoute) rather than standard VPNs over the public internet to bridge the gap during the transition period.

5. Security Token and Session Timeouts

Security protocols often fail during migration because session tokens or authentication handshakes "time out" due to the increased latency of moving data across networks. Users might find themselves constantly kicked out of the system.

  • The Solution: Temporarily Extend TTL (Time-to-Live) Settings. Increase the duration of session tokens and timeout thresholds during the migration window to account for the transitional overhead, then tighten them back up once the move is complete.

6. Logging and Visibility Gaps

If something goes wrong in the middle of a transfer, you need to know exactly where it stopped. Without centralized logging, you’ll be hunting through a dozen different text files to find the error.

  • The Solution: Deploy Centralized Observability. Use a dashboard (like ELK Stack, Datadog, or New Relic) to monitor the migration pipeline in real-time. If a transfer fails, you should receive an instant alert with a specific error code.


7. Syncing "Live" Data

If users are still adding data to the old system while you are migrating, the new system will be out of date the moment it goes live. This "data lag" is a nightmare for financial or inventory systems.

  • The Solution: Use CDC (Change Data Capture). These tools monitor the source database for any changes (Inserts, Updates, Deletes) and immediately replicate those specific changes to the new environment in real-time, keeping both systems in perfect sync.

8. Missing Metadata or Permissions

You might move the file correctly, but the "tags," "owner permissions," or "creation dates" often get stripped away during the move, leading to access denied errors for users.

  • The Solution: Use Migration-Aware Tools. Instead of a simple "copy-paste" or FTP, use tools designed to preserve metadata (like rsync with specific flags or vendor-specific migration services). Always run a "permissions audit" on the destination folder before opening it to users.

9. Communication Breakdowns

During the heat of a migration, the IT team might know a service is down, but the Help Desk doesn't. This leads to a flood of support tickets and a frustrated user base.

  • The Solution: Create a War Room and Status Page. Use a dedicated Slack/Teams channel for the technical move and a public-facing status page for the rest of the company. Clear, hourly updates—even if it's just "everything is on track"—prevent panic.

10. Human Error Under Pressure

Fatigue is a real factor. A tired engineer might run a "delete" command on the wrong terminal or misconfigure a firewall rule at 3:00 AM, causing a catastrophic outage.

  • The Solution: Follow a "Pilot/Co-Pilot" Model. No major command should be executed by a single person. Every script execution or configuration change should be peer-reviewed by a second engineer to catch simple, exhaustion-driven mistakes.


Execution Phase In Migrating Oracle Database to SQL Server on Azure VM WITH VLDBs

Execution Phase In Migrating Oracle Database to SQL Server on Azure VM 1. What “During Migration” Really Means This phase includes: Initial ...