

# Step-by-step Amazon Relational Database Service to Amazon Aurora MySQL-Compatible Edition migration walkthrough


In the following sections, you can find step-by-step instructions for migrating an Amazon Relational Database Service (Amazon RDS) for Oracle database to Amazon Aurora MySQL-Compatible Edition. These steps assume that you have already prepared your source database as described in preceding sections.

**Topics**
+ [

# Step 1: Launch the RDS Instances in a VPC by Using the Amazon CloudFormation Template
](chap-rdsoracle2aurora.steps.launchrdswcloudformation.md)
+ [

# Step 2: Install the SQL Tools and Amazon Schema Conversion Tool on Your Local Computer
](chap-rdsoracle2aurora.steps.installsct.md)
+ [

# Step 3: Test Connectivity to the Oracle DB Instance and Create the Sample Schema
](chap-rdsoracle2aurora.steps.connectoracle.md)
+ [

# Step 4: Test the Connectivity to the Aurora MySQL DB Instance
](chap-rdsoracle2aurora.steps.connectaurora.md)
+ [

# Step 5: Use the Amazon Schema Conversion Tool to Convert the Oracle Schema to Aurora MySQL
](chap-rdsoracle2aurora.steps.convertschema.md)
+ [

# Step 6: Validate the Schema Conversion
](chap-rdsoracle2aurora.steps.validateschemaconversion.md)
+ [

# Step 7: Create an Amazon DMS Replication Instance
](chap-rdsoracle2aurora.steps.createreplicationinstance.md)
+ [

# Step 8: Create Amazon DMS Source and Target Endpoints
](chap-rdsoracle2aurora.steps.createsourcetargetendpoints.md)
+ [

# Step 9: Create and Run Your Amazon DMS Migration Task
](chap-rdsoracle2aurora.steps.createmigrationtask.md)
+ [

# Step 10: Verify That Your Data Migration Completed Successfully
](chap-rdsoracle2aurora.steps.verifydatamigration.md)
+ [

# Step 11: Delete Walkthrough Resources
](chap-rdsoracle2aurora.steps.deleteresources.md)

# Step 1: Launch the RDS Instances in a VPC by Using the Amazon CloudFormation Template


Before you begin, you’ll need to download an Amazon CloudFormation template. Follow these instructions:

1. Download the following archive to your computer: [http://docs.aws.amazon.com/dms/latest/sbs/samples/dms-sbs-RDSOracle2Aurora.zip](http://docs.aws.amazon.com/dms/latest/sbs/samples/dms-sbs-RDSOracle2Aurora.zip).

1. Extract the Amazon CloudFormation template (`Oracle_Aurora_For_DMSDemo.template`) from the archive.

1. Copy and paste the `Oracle_Aurora_For_DMSDemo.template` file into your current directory.

Now you need to provision the necessary Amazon resources for this walkthrough. Do the following:

1. Sign in to the Amazon Web Services Management Console and open the Amazon CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.amazonaws.cn/cloudformation/).

1. Choose **Create stack** and then choose **With new resources (standard)**.

1. On the **Specify template** section of the **Create stack** page, choose **Upload a template file**.

1. Click **Choose file**, and then choose the `Oracle_Aurora_For_DMSDemo.template` file that you extracted from the `dms-sbs-RDSOracle2Aurora.zip` archive.

1. Choose **Next**. On the **Specify Details** page, provide parameter values as shown following.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.launchrdswcloudformation.html)  
![\[Specify Details page\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora3.png)

1. Choose **Next**. On the **Configure stack options** page, shown following, choose **Next**.  
![\[Options page\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora4.png)

1. On the **Review** page, review the details, and if they are correct, scroll down and choose **Create stack**. You can get the estimated cost of running this Amazon CloudFormation template by choosing **Estimate cost** at the **Template** section on top of the page.  
![\[Replication instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora5.png)

1.  Amazon can take about 20 minutes or more to create the stack with Amazon RDS for Oracle and Amazon Aurora MySQL instances.  
![\[Create Stack page\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora6.png)

1. After the stack is created, choose **Stack**, select the DMSdemo stack, and then choose **Outputs**. Record the JDBC connection strings, **OracleJDBCConnectionString** and **AuroraJDBCConnectionString**, for use later in this walkthrough to connect to the Oracle and Aurora MySQL DB instances.  
![\[Replication instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora5.5.png)

**Note**  
Oracle 12c SE Two License version 12.1.0.2.v4 is available in all regions. However, Amazon Aurora MySQL is not available in all regions. Amazon Aurora MySQL is currently available in US East (N. Virginia), US West (Oregon), EU (Ireland), Asia Pacific (Tokyo), Asia Pacific (Mumbai), Asia Pacific (Sydney), and Asia Pacific (Seoul). If you try to create a stack in a region where Aurora MySQL is not available, creation fails with the error `Invalid DB Engine for AuroraCluster`.

# Step 2: Install the SQL Tools and Amazon Schema Conversion Tool on Your Local Computer


Next, you need to install a SQL client and the Amazon Schema Conversion Tool (Amazon SCT) on your local computer.

This walkthrough assumes you will use the SQL Workbench/J client to connect to the RDS instances for migration validation. A few other software tools you might want to consider are the following:
+  [JACK DB](http://www.jackdb.com), an online web interface to work with RDS databases (Oracle and Aurora MySQL) over JDBC
+  [DBVisualizer](https://www.dbvis.com/download/) 
+  [Oracle SQL Developer](https://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index-097090.html) 

To install the SQL client software, do the following:

1. Download SQL Workbench/J from [the SQL Workbench/J website](http://www.sql-workbench.net/downloads.html), and then install it on your local computer. This SQL client is free, open-source, and DBMS-independent.

1. Download the JDBC driver for your Oracle database release. For more information, go to https://www.oracle.com/jdbc.

1. Download the MySQL JDBC driver (`0jar` file). For more information, go to https://dev.mysql.com/downloads/connector/j/.

1. Using SQL Workbench/J, configure JDBC drivers for Oracle and Aurora MySQL to set up connectivity, as described following.

   1. In SQL Workbench/J, choose **File**, then choose **Manage Drivers**.

   1. From the list of drivers, choose **Oracle**.

   1. Choose the Open icon, then choose the `0jar` file for the Oracle JDBC driver that you downloaded in the previous step. Choose **OK**.  
![\[Driver management\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora7.png)

   1. From the list of drivers, choose MySQL.

   1. Choose the Open icon, then choose the MySQL JDBC driver that you downloaded in the previous step. Choose **OK**.  
![\[Driver management\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora8.png)

To install the Amazon Schema Conversion Tool and the required JDBC drivers, do the following:

1. Download the Amazon Schema Conversion Tool from [Installing, verifying, and updating the Schema Conversion Tool](https://docs.amazonaws.cn/SchemaConversionTool/latest/userguide/CHAP_Installing.html).

1. Launch the Amazon Schema Conversion Tool.

1. In the Amazon Schema Conversion Tool, choose **Global settings** from **Settings**.

1. In **Global settings**, choose **Driver**, and then choose **Browse** for **Oracle driver path**. Locate the JDBC Oracle driver and choose **OK**. Next, choose **Browse** for **MySQL driver path**. Locate the JDBC MySQL driver and choose **OK**. Choose **OK** to close the dialog box.  
![\[Connecting to the Oracle DB instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sct-drivers.png)

# Step 3: Test Connectivity to the Oracle DB Instance and Create the Sample Schema


After the Amazon CloudFormation stack has been created, test the connection to the Oracle DB instance by using SQL Workbench/J and then create the **HR** sample schema.

To test the connection to your Oracle DB instance and create the sample schema, do the following:

1. In SQL Workbench/J, choose **File**, then choose **Connect window**. Create a new connection profile using the following information as shown following    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.connectoracle.html)

1. To test the connection, choose **Test**. Choose **OK** to close the dialog box, then choose **OK** to create the connection profile.  
![\[Connecting to the Oracle DB instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora9.png)
**Note**  
If your connection is unsuccessful, ensure that the IP address you assigned when creating the Amazon CloudFormation template is the one you are attempting to connect from. This is the most common issue when trying to connect to an instance.

1. Create the HR schema you will use for migration using a custom SQL script (Oracle-HR-Schema-Build.sql). To obtain this script, do the following:

   1. Download the following archive to your computer: [http://docs.aws.amazon.com/dms/latest/sbs/samples/dms-sbs-RDSOracle2Aurora.zip](http://docs.aws.amazon.com/dms/latest/sbs/samples/dms-sbs-RDSOracle2Aurora.zip).

   1. Extract the SQL script(`Oracle-HR-Schema-Build.sql`) from the archive.

   1. Copy and paste the `Oracle-HR-Schema-Build.sql` file into your current directory.

1. Open the provided SQL script in a text editor. Copy the entire script.

1. In SQL Workbench/J, paste the SQL script in the Default.wksp window showing **Statement 1**.

1. Choose **SQL**, then choose **Execute All**.

   When you run the script, you will get an error message indicating that user **HR** does not exist. You can ignore this error and run the script. The script drops the user before creating it, which generates the error.

1. Verify the object types and count in **HR** Schema were created successfully by running the following SQL query.

   ```
   Select OBJECT_TYPE, COUNT(*) from dba_OBJECTS where owner='HR'
   GROUP BY OBJECT_TYPE;
   ```

   The results of this query should be similar to the following:

   ```
   OBJECT_TYPE    COUNT(*)
   INDEX          8
   PROCEDURE      2
   SEQUENCE       3
   TABLE          7
   VIEW           1
   ```

1. Verify the number of constraints in the **HR** schema by running the following SQL query:

   ```
   Select CONSTRAINT_TYPE,COUNT(*) from dba_constraints  where owner='HR'
   	AND (CONSTRAINT_TYPE IN ('P','R')OR SEARCH_CONDITION_VC NOT LIKE '%NOT NULL%')
   	GROUP BY CONSTRAINT_TYPE;
   ```

   The results of this query should be similar to the following:

   ```
   CONSTRAINT_TYPE	COUNT(*)
   	R	         10
   	P	          7
   	C	          1
   ```

1. Analyze the **HR** schema by running the following:

   ```
   BEGIN
       dbms_stats.gather_schema_stats('HR');
   END;
   /
   ```

1. Verify the total number of tables and number of rows for each table by running the following SQL query:

   ```
   SELECT table_name, num_rows from dba_tables where owner='HR'  order by 1;
   ```

   The results of this query should be similar to the following:

   ```
   TABLE_NAME      NUM_ROWS
   COUNTRIES        25
   DEPARTMENTS      27
   EMPLOYEES       107
   JOBS             19
   JOB_HISTORY      10
   LOCATIONS        23
   REGIONS           4
   ```

1. Verify the relationships of the tables. Check the departments with employees greater than 10 by running the following SQL query:

   ```
   Select b.department_name,count(*) from HR.Employees a,HR.departments b where a.department_id=b.department_id
   group by b.department_name having count(*) > 10
   order by 1;
   ```

   The results of this query should be similar to the following:

   ```
   DEPARTMENT_NAME      COUNT(*)
   Sales                34
   Shipping             45
   ```

# Step 4: Test the Connectivity to the Aurora MySQL DB Instance


Next, test your connection to your Aurora MySQL DB instance.

1. In SQL Workbench/J, choose **File**, then choose **Connect window**. Choose the Create a new connection profile icon. using the following information: Connect to the Aurora MySQL DB instance in SQL Workbench/J by using the information as shown following:    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.connectaurora.html)

1. Test the connection by choosing **Test**. Choose **OK** to close the dialog box, then choose OK to create the connection profile.  
![\[Connecting to the Aurora MySQL DB instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora10.png)
**Note**  
If your connection is unsuccessful, ensure that the IP address you assigned when creating the Amazon CloudFormation template is the one you are attempting to connect from. This is the most common issue when trying to connect to an instance.

1. Log on to the Aurora MySQL instance by using the master admin credentials.

1. Verify your connectivity to the Aurora MySQL DB instance by running a sample SQL command, such as `SHOW DATABASES;`.  
![\[Connecting to the Aurora MySQL DB instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora10.5.png)

# Step 5: Use the Amazon Schema Conversion Tool to Convert the Oracle Schema to Aurora MySQL


Before you migrate data to Aurora MySQL, you convert the Oracle schema to an Aurora MySQL schema. [This video covers all the steps of this process](https://youtu.be/ClAJUNa1Ucc).

To convert an Oracle schema to an Aurora MySQL schema using Amazon Schema Conversion Tool (Amazon SCT), do the following:

1. Launch Amazon SCT. In Amazon SCT, choose **File**, then choose **New Project**. Create a new project named `DMSDemoProject`, specify the **Location** of the project folder, and then choose **OK**.

1. Choose **Add source** to add a source Oracle database to your project, then choose **Oracle**, and choose **Next**.

1. Enter the following information, and then choose **Test Connection**.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.convertschema.html)  
![\[Connecting to an Amazon RDS for Oracle DB instance\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora11.png)

1. Choose **OK** to close the alert box, then choose **Connect** to close the dialog box and to connect to the Oracle DB instance.

1. Choose **Add target** to add a target Amazon Aurora MySQL database to your project, then choose **Amazon Aurora (MySQL compatible)**, and choose **Next**.

1. Enter the following information and then choose **Test Connection**.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.convertschema.html)

1. Choose **OK** to close the alert box, then choose **Connect** to connect to the Amazon Aurora MySQL DB instance.

1. In the tree in the left panel, select only the **HR** schema. In the tree in the right panel, select your target Aurora MySQL database. Choose **Create mapping**.  
![\[Creating a mapping rule\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora12.7.png)

1. Choose **Main view**. In the tree in the left panel, right-click the **HR** schema and choose **Create report**.

1. Check the report and the action items it suggests. The report discusses the type of objects that can be converted by using Amazon SCT, along with potential migration issues and actions to resolve these issues. For this walkthrough, you should see something like the following:  
![\[Database migration report\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora13.png)

   You can optionally save the report as .csv or .pdf format for later analysis.

1. Choose **Action Items**, and review any recommendations that you see.

1. In the tree in the left panel, right-click the **HR** schema and then choose **Convert schema**.

1. Choose **Yes** for the confirmation message. Amazon SCT then converts your schema to the target database format.

1. In the tree in the right panel, choose the converted **hr** schema, and then choose **Apply to database** to apply the schema scripts to the target Aurora MySQL instance.

1. Choose the **hr** schema, and then choose **Refresh from Database** to refresh from the target database.

The database schema has now been converted and imported from source to target.

# Step 6: Validate the Schema Conversion


To validate the schema conversion, you compare the objects found in the Oracle and Aurora MySQL databases using SQL Workbench/J.

1. In SQL Workbench/J, choose **File**, then choose **Connect window**. Choose the RDSAuroraConnection you created in an earlier step. Click **OK**.

1. Run the following script to verify the number of object types and count in the **HR** schema in the target Aurora MySQL database. These values should match the number of objects in the source Oracle database:

   ```
   SELECT a.OBJECT_TYPE, COUNT(*)
   FROM
   (
   SELECT OBJECT_TYPE
   ,OBJECT_SCHEMA
   ,OBJECT_NAME
   FROM (
   SELECT 'TABLE' AS OBJECT_TYPE
   ,TABLE_NAME AS OBJECT_NAME
   ,TABLE_SCHEMA AS OBJECT_SCHEMA
   FROM information_schema.TABLES
   where  TABLE_TYPE='BASE TABLE'
   UNION
   SELECT 'VIEW' AS OBJECT_TYPE
   ,TABLE_NAME AS OBJECT_NAME
   ,TABLE_SCHEMA AS OBJECT_SCHEMA
   FROM information_schema.VIEWS
   UNION
   
   SELECT 'INDEX' AS OBJECT_TYPE
   ,CONCAT (
   CONSTRAINT_TYPE
   ,' : '
   ,CONSTRAINT_NAME
   ,' : '
   ,TABLE_NAME
   ) AS OBJECT_NAME
   ,TABLE_SCHEMA AS OBJECT_SCHEMA
   FROM information_schema.TABLE_CONSTRAINTS
   where constraint_type='PRIMARY KEY'
   UNION
   SELECT ROUTINE_TYPE AS OBJECT_TYPE
   ,ROUTINE_NAME AS OBJECT_NAME
   ,ROUTINE_SCHEMA AS OBJECT_SCHEMA
   FROM information_schema.ROUTINES
   UNION
   SELECT 'TRIGGER' AS OBJECT_TYPE
   ,CONCAT (
   TRIGGER_NAME
   ,' : '
   ,EVENT_OBJECT_SCHEMA
   ,' : '
   ,EVENT_OBJECT_TABLE
   ) AS OBJECT_NAME
   ,TRIGGER_SCHEMA AS OBJECT_SCHEMA
   FROM information_schema.triggers
   ) R
   WHERE R.OBJECT_SCHEMA ='HR'
   order by 1) a
   GROUP BY a.OBJECT_TYPE;
   ```

   The output from this query should be similar to the following:

   ```
   OBJECT_TYPE    COUNT(*)
   INDEX           7
   PROCEDURE       2
   TABLE           7
   TRIGGER        10
   VIEW            1
   ```

   Next, run the following query to get table constraints information:

   ```
   SELECT CONSTRAINT_TYPE,COUNT(*)
   FROM information_schema.TABLE_CONSTRAINTS where constraint_schema='HR'
   GROUP BY CONSTRAINT_TYPE;
   ```

   The output from this query should be similar to the following:

   ```
   CONSTRAINT_TYPE    COUNT(*)
   FOREIGN KEY        10
   PRIMARY KEY         7
   UNIQUE              7
   ```

# Step 7: Create an Amazon DMS Replication Instance


After we validate the schema structure between source and target databases, as described preceding, we proceed to the core part of this walkthrough, which is the data migration. The following illustration shows a high-level view of the migration process.

![\[Migration process\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/datarep-conceptual2.png)


A DMS replication instance performs the actual data migration between source and target. The replication instance also caches the transaction logs during the migration. How much CPU and memory capacity a replication instance has influences the overall time required for the migration.

To create an Amazon DMS replication instance, do the following:

1. Sign in to the Amazon Web Services Management Console, select [Amazon Database Migration Service](https://console.amazonaws.cn/dms/v2) (Amazon DMS) and choose **Create replication instance**. If you are signed in as an Amazon Identity and Access Management (IAM) user, you must have the appropriate permissions to access Amazon DMS. For more information about the permissions required, see [IAM Permissions](https://docs.amazonaws.cn/dms/latest/userguide/CHAP_Security.html#CHAP_Security.IAMPermissions).

1. On the **Create replication instance** page, specify your replication instance information as shown following.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.createreplicationinstance.html)

1. For the **Advanced**, **Maintenance**, and **Tags** sections, leave the default settings as they are, and choose **Create**.

# Step 8: Create Amazon DMS Source and Target Endpoints


While your replication instance is being created, you can specify the source and target database endpoints using the [Amazon Web Services Management Console](https://console.amazonaws.cn/). However, you can only test connectivity after the replication instance has been created, because the replication instance is used in the connection.

1. Specify your connection information for the source Oracle database and the target Amazon Aurora MySQL database. The following table describes the source settings.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.createsourcetargetendpoints.html)

   The following table describes the target settings.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.createsourcetargetendpoints.html)

   The completed page should look like the following:  
![\[Advanced section\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora19.5.png)

1. In order to disable foreign key checks during the initial data load, you must add the following commands to the target Aurora MySQL DB instance. In the **Advanced** section, shown following, type the following commands for **Extra connection attributes**: `initstmt=SET FOREIGN_KEY_CHECKS=0;autocommit=1` 

   The first command disables foreign key checks during a load, and the second command commits the transactions that DMS executes.  
![\[Advanced section\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora20.png)

1. Choose **Next**.

# Step 9: Create and Run Your Amazon DMS Migration Task


Using a Amazon DMS task, you can specify what schema to migrate and the type of migration. You can migrate existing data, migrate existing data and replicate ongoing changes, or replicate data changes only. This walkthrough migrates existing data only.

1. On the **Create Task** page, specify the task options. The following table describes the settings.    
[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/chap-rdsoracle2aurora.steps.createmigrationtask.html)

   The page should look like the following:  
![\[Create task page\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora23.png)

1. Under **Task Settings**, choose **Do nothing** for **Target table preparation mode**, because you have already created the tables through Schema Migration Tool. Because this migration doesn’t contain any LOBs, you can leave the LOB settings at their defaults.

   Optionally, you can select **Enable logging**. If you enable logging, you will incur additional Amazon CloudWatch charges for the creation of CloudWatch logs. For this walkthrough, logs are not necessary.  
![\[Task Settings section\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora24.png)

1. Leave the Advanced settings at their default values.

1. Choose **Table mappings**, choose **Default** for **Mapping method**, and then choose `HR` for **Schema to migrate**.

   The completed section should look like the following.  
![\[Completed Table mappings section\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora25.png)

1. Choose **Create task**. The task will begin immediately.

The Tasks section shows you the status of the migration task.

![\[Table statistics tab\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora25.5.png)


You can monitor your task if you choose **Enable logging** when you set up your task. You can then view the CloudWatch metrics by doing the following:

1. On the navigation pane, choose **Tasks**.

1. Choose your migration task (`migratehrschema`).

1. Choose the **Task monitoring** tab, and monitor the task in progress on that tab.

# Step 10: Verify That Your Data Migration Completed Successfully


When the migration task completes, you can compare your task results with the expected results.

1. On the navigation pane, choose **Tasks**.

1. Choose your migration task (`migratehrschema`).

1. Choose the **Table statistics** tab, shown following.  
![\[Table statistics tab\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora26.png)

1. Connect to the Amazon Aurora MySQL instance by using SQL Workbench/J, and then check if the database tables were successfully migrated from Oracle to Aurora MySQL by running the SQL script shown following.

   ```
   SELECT TABLE_NAME,TABLE_ROWS
       FROM INFORMATION_SCHEMA.TABLES
       WHERE TABLE_SCHEMA = 'HR' and TABLE_TYPE='BASE TABLE' order by 1;
   ```  
![\[Table statistics tab\]](http://docs.amazonaws.cn/en_us/dms/latest/sbs/images/sbs-rdsor2aurora27.png)

1. Run the following query to check the relationship in tables; this query checks the departments with employees greater than 10.

   ```
   SELECT B.DEPARTMENT_NAME,COUNT(*)
     FROM HR.EMPLOYEES A,HR.DEPARTMENTS B
     WHERE A.DEPARTMENT_ID=B.DEPARTMENT_ID
     GROUP BY B.DEPARTMENT_NAME HAVING COUNT(*) > 10
     ORDER BY 1;
   ```

   The output from this query should be similar to the following.

   ```
   department_name	count(*)
   Sales                34
   Shipping             45
   ```

Now you have successfully completed a database migration from an Amazon RDS for Oracle database instance to Amazon Aurora MySQL.

# Step 11: Delete Walkthrough Resources


After you have completed this walkthrough, perform the following steps to avoid being charged further for Amazon resources used in the walkthrough. It’s necessary that you do the steps in order, because some resources cannot be deleted if they have a dependency upon another resource.

1. On the navigation pane, choose **Tasks**, choose your migration task (`migratehrschema`), and then choose **Delete**.

1. On the navigation pane, choose **Endpoints**, choose the Oracle source endpoint (`orasource`), and then choose **Delete**.

1. Choose the Amazon Aurora MySQL target endpoint (`aurtarget`), and then choose **Delete**.

1. On the navigation pane, choose **Replication instances**, choose the replication instance (`DMSdemo-repserver`), and then choose **Delete**.

Next, you must delete your Amazon CloudFormation stack, `DMSdemo`.

1. Sign in to the Amazon Web Services Management Console and open the [Amazon CloudFormation console](https://console.amazonaws.cn/cloudformation).

   Note that if you are signed in as an Amazon Identity and Access Management (IAM) user, you must have the appropriate permissions to access Amazon CloudFormation.

1. Choose your Amazon CloudFormation stack, `DMSdemo`.

1. For **Actions**, choose **Delete stack**.

The status of the stack changes to DELETE\$1IN\$1PROGRESS while Amazon CloudFormation Amazon CloudFormation cleans up the resources associated with the `DMSdemo` stack. When Amazon CloudFormation is finished cleaning up resources, it removes the stack from the list.