DMS EC2 Oracle Database To Oracle RDS Database
DMS EC2 Oracle Database To Oracle RDS Database
Migration Service
Migrating Oracle Database from On-Premises/EC2 to RDS
Table of Contents
Introduction 3
Environment Details 3
Approach 3
Conclusion 16
DMS-EC2 Oracle database to RDS Oracle database | Page 3
Introduction
Managing Oracle Databases in On-Premises/EC2 instances require more resources and cost. Hence moving it to RDS instance will ease our job,
optimizing the IT budget and also providing us with various features like Multi-AZ, Scalability, Automatic Backups…etc.
In our case we are migrating 120 GB Oracle Database from EC2 instance to RDS using the DMS service which migrates the data very faster and
effortlessly .The task can also be monitored and optimized through the DMS service. The same approach is applicable while migrating the Oracle
Database from On-Premises to RDS.
Environment Details
Below are the current EC2 and opted RDS environment details involved in this migration.
Approach
The below approach is followed to migrate the Database:
Prerequisites to
start DMS service
Starting DMS
service
Post migration activity
and checks
Procedures ,Functions,
Packages and other object
migration
Below screen shots confirms the prerequisites are met in our migration.
DMS-EC2 Oracle database to RDS Oracle database | Page 4
a. Source database
The source database instance “TEST” and the “LISTENER” are up and running fine.
b. Target database
The target RDS instance is up and ready to be used
Step 3:
Since this is an Oracle to Oracle database migration, downloading the schema conversion tool is optional. However it is applicable if the
migration is heterogeneous. Click on “Next” button.
Step 4:
Under the “Create replication Instance” window, provide a meaningful replication instance name, description of the migration, Instance
class and VPC where the RDS instance must reside. Select Multi-AZ to YES for high availability and redundant replication streaming.
Check the publicly accessible box to access the replication instance through internet.
DMS-EC2 Oracle database to RDS Oracle database | Page 8
Step 5:
Under advanced section enter allocated storage for DMS instance, Replication subnet group based on the VPC selected in the previous
step, VPC security group(s) to allow inbound/outbound traffic, KMS master key as default if there is no existing key for database volume
encryption. Click on “Next” button.
Step 6:
Under “connect source and target database endpoints” window, enter source and target database details to create endpoints. Provide a
meaningful endpoint identifier name, Source and Target engines (Database engines), Server name (Database server IP /end point), Port
(Database listening port), SSL mode (To encrypt the connection) which is none for oracle. Username in source identifier should have
data dictionary views access privileges and the Username in target identifier should be the schema name which needs to be migrated.
In our case the username in the source identifier is “SYSTEM” which by default has all the privileges and the target username is
“DOCUMENTS” which needs to be migrated.
DMS-EC2 Oracle database to RDS Oracle database | Page 9
Step 7:
Click “Run test” to check the connectivity between replication instance and source, target databases. You should receive a message
stating “Connection tested successfully” and click on “Next” button.
Step 8:
Under the “Create task” window provide a meaningful task name and task description. Select Migration type as “Migrate existing data”
and select the check box “Start task on create” to start the activity automatically post task creation.
Step 9:
Under Task settings select the “Target table preparation mode” as “Do nothing” since it is a fresh migration. Select Full LOB mode in “Include LOB
columns in replication” if the size of the LOB is unknown and to migrate complete LOBs regardless of size. The option “Limited LOB mode” can be
selected if the LOB chunk size is known. The option “Don’t include LOB columns” cab be selected to exclude LOB columns. Check “Enable logging”
box to capture the errors and warnings in the logs. Select advanced settings to configure “Control Tables” and “Tuning” settings to optimize the
data migration.
DMS-EC2 Oracle database to RDS Oracle database | Page 10
Under advanced settings
Step 10:
Under Table mappings select the “Mapping method” as default to migrate the table with the same name to target database. To remap with
a different table name click on “Custom” and edit the JSON script for relevant mapping. Select the migration schema name from “Schema
to migrate” drop down list. Click on “Create task” button.
Table mappings option
Step 11:
The Task has been created successfully and the status is changed from “Creating” to “Ready”.
Task is in creating status
Step 13:
Create a new endpoint, new task and repeat the same steps to migrate all schemas to the target database.
New “ProdtestProdmig” endpoint is created.
DMS-EC2 Oracle database to RDS Oracle database | Page 12
The same way backupmigration, owsmigration, howmigration tasks are created and successfully migrated all the schemas
from source to target database.
b. Table Statistics tab shows the table migration details as shown below.
DMS-EC2 Oracle database to RDS Oracle database | Page 14
c. Task monitoring tab shows the detailed cloud watch metrics.
d. Migration logs shows the details of the migration, error and warnings with time stamp under the logs tab.
Step 2:
Creating database link from source to target database.
Step 3:
Testing the connection from source to target Database.
DMS-EC2 Oracle database to RDS Oracle database | Page 15
Step 4:
Dump file is transferred from source to target database through DBMS_FILE_TRANSFER.
Step 5:
Importing the Dump file from the source to the target database.
The same way the objects can be compared for all the schemas.If there are any missing objects it can be created manually.
DMS-EC2 Oracle database to RDS Oracle database | Page 16
Note:
Below are the required source database user privileges to migrate the schemas through DMS. We have used SYSTEM user to migrate
all schema’s hence granting the below privileges are not required.
Conclusion:
Database migration has been successfully completed from EC2 oracle
database to RDS oracle database using DMS service.
About Author:
Prabhakaran Ponnusamy a Cloud Architect at 8k Miles, an Oracle
expertise along with multiple database technologies hands-on.
Passionate in learning, experimenting and exploring new technologies
and making business much more than usual.