

# Step-by-step Oracle databases to Amazon Aurora PostgreSQL with DMS schema conversion migration walkthrough


In the following sections, you can find step-by-step instructions for migrating your Oracle database to Amazon RDS for PostgreSQL using DMS Schema Conversion.

**Topics**
+ [

# Step 1: Create AWS Resources
](schema-conversion-oracle-postgresql-step-1.md)
+ [

# Step 2: Configure Your Source Database
](schema-conversion-oracle-postgresql-step-2.md)
+ [

# Step 3: Create Your Target Amazon RDS for PostgreSQL Database
](schema-conversion-oracle-postgresql-step-3.md)
+ [

# Step 4: Store Database Credentials in AWS Secrets Manager
](schema-conversion-oracle-postgresql-step-4.md)
+ [

# Step 5: Create an Instance Profile
](schema-conversion-oracle-postgresql-step-5.md)
+ [

# Step 6: Configure Data Providers
](schema-conversion-oracle-postgresql-step-6.md)
+ [

# Step 7: Create a Migration Project
](schema-conversion-oracle-postgresql-step-7.md)
+ [

# Step 8: Convert Database Objects
](schema-conversion-oracle-postgresql-step-8.md)
+ [

# Step 9: Edit and Apply Your Converted Code
](schema-conversion-oracle-postgresql-step-9.md)

# Step 1: Create AWS Resources


In this step, you create and configure the required AWS resources for DMS Schema Conversion.

First, you create a virtual private cloud (VPC). This VPC is based on the Amazon Virtual Private Cloud (Amazon VPC) service and contains your AWS resources. Make sure that you create this VPC in one of the AWS Regions that support DMS Schema Conversion. For more information, see the [list of supported Regions](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_SchemaConversion.html#schema-conversion-supported-regions).

 **To create a VPC for DMS Schema Conversion** 

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. Choose your AWS Region.

1. Choose **Create VPC**.

1. On the **Create VPC** page, enter the following settings:
   +  **Resources to create** — **VPC and more** 
   +  **Name tag auto-generation** — Choose **Auto-generate** and enter a globally unique name. For example, enter `sc-vpc`.
   +  **IPv4 CIDR block** — `10.0.1.0/24` 
   +  **NAT gateways** — **In 1 AZ** 
   +  **VPC endpoints** — **None** 

1. Keep the rest of the settings as they are, and then choose **Create VPC**.

1. Choose **Subnets**.
   + For **Filter by VPC**, choose **sc-vpc**.
   + Take a note of your two private subnet IDs. Private subnet IDs don’t include `Public` in the name.

1. Choose **NAT gateways**.
   + Choose your **NAT gateway**.
   + Take a note of your **Elastic IP** address.

Use this VPC when you create your instance profile in [Step 5](schema-conversion-oracle-postgresql-step-5.md) and your target Amazon RDS database in [Step 3](schema-conversion-oracle-postgresql-step-3.md).

Next, you create AWS Identity and Access Management (IAM) roles to use in your DMS Schema Conversion migration project. AWS DMS uses this IAM role to access your Amazon S3 bucket and database credentials stored in AWS Secrets Manager.

 **To create an IAM role that provides access to your Amazon S3 bucket** 

1. Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

1. In the navigation pane, choose **Roles**.

1. Choose **Create role**.

1. On the **Select trusted entity** page, choose ** AWS service**. Choose **DMS**.

1. Choose **Next**. The **Add permissions** page opens.

1. For **Filter policies**, enter `S3`. Choose **AmazonS3FullAccess**.

1. Choose **Next**. The **Name, review, and create** page opens.

1. For **Role name**, enter a descriptive name. For example, enter `sc-s3-role`. Choose **Create role**.

1. On the **Roles** page, enter `sc-s3-role` for **Role name**. Choose **sc-s3-role**.

1. On the `sc-s3-role` page, choose the **Trust relationships** tab. Choose **Edit trust policy**.

1. On the **Edit trust policy** page, edit the trust relationships for the role to use the `schema-conversion.dms.amazonaws.com` service principal as the trusted entity.

1. Choose **Update trust policy**.

Use this IAM role when you create your instance profile in [Step 5](schema-conversion-oracle-postgresql-step-5.md).

 **To create an IAM role that provides access to AWS Secrets Manager ** 

1. Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/).

1. In the navigation pane, choose **Roles**.

1. Choose **Create role**.

1. On the **Select trusted entity** page, choose ** AWS service**. Choose **DMS**.

1. Choose **Next**. The **Add permissions** page opens.

1. For **Filter policies**, enter `Secret`. Choose **SecretsManagerReadWrite**.

1. Choose **Next**. The **Name, review, and create** page opens.

1. For **Role name**, enter a descriptive name. For example, enter `sc-secrets-manager-role`. Choose **Create role**.

1. On the **Roles** page, enter `sc-secrets-manager-role` for **Role name**. Choose **sc-secrets-manager-role**.

1. On the **sc-secrets-manager-role** page, choose the **Trust relationships** tab. Choose **Edit trust policy**.

1. On the **Edit trust policy** page, edit the trust relationships for the role to use `schema-conversion.dms.amazonaws.com` and your AWS DMS regional service principal as the trusted entities. This principal has the following format.

   ```
   dms.region-name.amazonaws.com
   ```

   Replace *region-name* with the name of your Region, such as `us-east-1`.

   The following code example shows the principal for the `us-east-1` Region.

   ```
   dms.us-east-1.amazonaws.com
   ```

1. Choose **Update trust policy**.

Use this IAM role when you create your migration project in [Step 7](schema-conversion-oracle-postgresql-step-7.md).

Next, you create an Amazon S3 bucket to use in your DMS Schema Conversion migration project. DMS Schema Conversion uses this Amazon S3 bucket to save assessment reports, SQL scripts with the converted code, and database metadata.

 **To create an Amazon S3 bucket for DMS Schema Conversion** 

1. Sign in to the AWS Management Console and open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. Choose **Create bucket**.

1. On the **Create bucket** page, select a globally unique name for your S3 bucket. For example, enter `sc-s3-bucket`.

1. For ** AWS Region**, choose your Region.

1. For **Bucket Versioning**, choose **Enable**.

1. Keep the rest of the settings as they are, and then choose **Create bucket**.

Use this Amazon S3 bucket when you create your instance profile in [Step 5](schema-conversion-oracle-postgresql-step-5.md).

# Step 2: Configure Your Source Database


In this step, you configure a new database user on your source Oracle database. Also, you configure the network to set up interaction for your source database with DMS Schema Conversion.

Use the credentials of this new user in DMS Schema Conversion. We encourage not using the admin user in the DMS Schema Conversion migration project.

Make sure that you grant the following privileges to this new user to complete the migration:
+  `CONNECT` — includes only the `CREATE SESSION` privilege.
+  `SELECT_CATALOG_ROLE` — provides `SELECT` privileges on all data dictionary views for Oracle 10g users.
+  `SELECT ANY DICTIONARY` — provides query access to any object in the `SYS` schema.

You can use the following code example to create a database user and grant the privileges.

```
CREATE USER user_name  IDENTIFIED BY your_password;
GRANT CONNECT TO user_name;
GRANT SELECT_CATALOG_ROLE TO user_name;
GRANT SELECT ANY DICTIONARY TO user_name;
```

In the preceding example, replace `user_name` with the name of your user. Then, replace `your_password` with a secure password.

After you configure your database user, make sure that DMS Schema Conversion can access your source Oracle database. To set up a network for DMS Schema Conversion, you can use different network configurations. These configurations depend on the settings of your source database and your network. For more information about available options, see [Setting up a network for DMS Schema Conversion](https://docs.aws.amazon.com/dms/latest/userguide/instance-profiles-network.html).

In this walkthrough, you configure a Site-to-Site VPN connection using a virtual private gateway.

 **To configure a Site-to-Site VPN connection** 

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. Choose your AWS Region.

1. Create a customer gateway.
   + In the navigation pane, choose **Customer gateways**, and then **Create customer gateway**.
   + For **Name tag**, enter a name for your customer gateway.
   + For **BGP ASN**, enter a Border Gateway Protocol (BGP) Autonomous System Number (ASN) for your customer gateway.
   + For **IP address**, enter the static, internet-routable IP address for your customer gateway device.
   + For **Certificate ARN**, choose the Amazon Resource Name of the private certificate.
   + For **Device**, enter a name for the device that hosts this customer gateway.

1. Create a virtual private gateway.
   + In the navigation pane, choose **Virtual private gateways**, and then **Create virtual private gateway**.
   + For **Name tag**, enter a name for your virtual private gateway.
   + For **Autonomous System Number (ASN)**, choose **Amazon default ASN**.
   + Choose **Create virtual private gateway**.
   + Select the virtual private gateway you created, choose **Actions**, and then **Attach to VPC**.
   + Under **Available VPCs**, select your VPC from the list and choose **Attach to VPC**.

1. Configure route propagation in your route table.
   + In the navigation pane, choose **Route tables**, and then select the route table that is associated with your subnet. By default, this is the main route table for the VPC.
   + On the **Route propagation** tab in the details pane, choose **Edit route propagation**.
   + Select the virtual private gateway that you created before, and then choose **Save**.

1. Add rules to your security group.
   + In the navigation pane, choose **Security groups**, and then select the default security group for your VPC.
   + On the **Inbound** tab in the details pane, add rules that allow inbound SSH, RDP, and ICMP access from your network.
   + Choose **Save**.

1. Create a Site-to-Site VPN connection.
   + In the navigation pane, choose **Site-to-Site VPN connections**, and then **Create VPN connection**.
   + For **Name tag**, enter a name for your Site-to-Site VPN connection.
   + For **Target gateway type**, choose either **Virtual private gateway**.
   + For **Customer gateway**, select **Existing**.
   + For **Customer gateway ID**, choose the customer gateway that you created before.
   + Select the routing option. If your customer gateway device supports BGP, then choose **Dynamic (requires BGP)**. Alternatively, choose **Static** and specify IP prefixes for the private network of your Site-to-Site VPN connection.
   + For **Outside IP address type**, keep the default option.
   + Choose **Create VPN connection**.

1. Download the configuration file.
   + In the navigation pane, choose **Site-to-Site VPN connections**, and then **Download configuration**.
   + Select the `vendor`, `platform`, `software`, and `IKE version` that correspond to your customer gateway device. If your device isn’t listed, choose `Generic`.
   + Choose **Download**.

1. Use the sample configuration file to configure your customer gateway device.

# Step 3: Create Your Target Amazon RDS for PostgreSQL Database


In this step, you create a new Amazon RDS for PostgreSQL database to use as a migration target for DMS Schema Conversion. Also, you configure a new database user on your target Amazon RDS for PostgreSQL database.

If you already created the target database, skip this step and proceed with the configuration of your database user.

 **To create an Amazon RDS for PostgreSQL database for DMS Schema Conversion** 

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. Choose your AWS Region.

1. Choose **Create database**.

1. For **Engine type**, choose **PostgreSQL**.

1. For **Templates**, choose **Free tier**.

1. For **DB instance identifier**, enter a unique name for your PostgreSQL database.

1. For **Master password** and **Confirm master password**, enter a secure password that includes at least 8 printable characters.

1. For **Virtual private cloud (VPC)** under **Connectivity**, choose `sc-vpc`. You created this VPC in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. For **Public access**, choose **Yes**.

1. Keep the rest of the settings as they are, and then choose **Create database**.

After you create your Amazon RDS for PostgreSQL database, configure a new database user. Then, use the credentials of this user in DMS Schema Conversion. We encourage not using the admin user in the DMS Schema Conversion migration project.

To configure your target database user, create a new user and grant `CREATE ON DATABASE` and the `rds_superuser` role.

You can use the following code example to create a database user and grant the privileges.

```
CREATE ROLE user_name LOGIN PASSWORD 'your_password';
GRANT CREATE ON DATABASE db_name TO user_name;
GRANT rds_superuser TO user_name;
ALTER DATABASE db_name OWNER TO user_name;
```

In the preceding example, replace *user\$1name* with the name of your user. Then, replace *your\$1password* with a secure password. Finally, replace *db\$1name* with the name of your target Amazon RDS for PostgreSQL database.

# Step 4: Store Database Credentials in AWS Secrets Manager


To connect to your source and target databases with DMS Schema Conversion, store your database credentials in AWS Secrets Manager. Make sure that you replicate these secrets to your AWS Region.

 **To store your source database credentials in AWS Secrets Manager ** 

1. Sign in to the AWS Management Console and open the AWS Secrets Manager console at [https://console.aws.amazon.com/secretsmanager/](https://console.aws.amazon.com/secretsmanager/).

1. Choose your AWS Region.

1. Choose **Store a new secret**. The **Choose secret type** page opens.

1. For **Secret type**, choose **Credentials for other database**.

1. For **User name** and **Password**, enter the credentials of the database user that you created for your source database in [Step 2](schema-conversion-oracle-postgresql-step-2.md).

1. For **Database**, choose **Oracle**.

1. For **Server name**, **Database name**, and **Port**, enter your Oracle database connection information.

1. Choose **Next**. The **Configure secret** page opens.

1. For **Secret name**, enter `sc-oracle-secret`.

1. Choose **Next**. The **Configure rotation** page opens.

1. Choose **Next**. The **Review** page opens.

1. Choose **Store**.

 **To store your target database credentials in AWS Secrets Manager ** 

1. Sign in to the AWS Management Console and open the AWS Secrets Manager console at [https://console.aws.amazon.com/secretsmanager/](https://console.aws.amazon.com/secretsmanager/).

1. Choose your AWS Region.

1. Choose **Store a new secret**. The **Choose secret type** page opens.

1. For **Secret type**, choose **Credentials for Amazon RDS database**.

1. For **User name** and **Password**, enter the credentials of the database user that you created for your target database in [Step 3](schema-conversion-oracle-postgresql-step-3.md).

1. For **Database**, choose your Amazon RDS for PostgreSQL DB instance.

1. Choose **Next**. The **Configure secret** page opens.

1. For **Secret name**, enter `sc-postgresql-secret`.

1. Choose **Next**. The **Configure rotation** page opens.

1. Choose **Next**. The **Review** page opens.

1. Choose **Store**.

Use these secrets when you create your migration project in [Step 7](schema-conversion-oracle-postgresql-step-7.md).

# Step 5: Create an Instance Profile


Before you create an instance profile, configure a subnet group for your instance profile.

 **To create a subnet group** 

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. In the navigation pane, choose **Subnet groups**, and then choose **Create subnet group**.

1. For **Name**, enter `PrivateSubnetGroup`.

1. For **Description**, enter `A group of private subnets`.

1. For **VPC**, choose `sc-vpc`. You created this VPC in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. For **Add subnets**, choose two private subnet IDs. You noted these private subnet IDs in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. Choose **Create subnet group**.

Before you create your migration project in DMS Schema Conversion, you set up an instance profile. An instance profile specifies network and security settings for DMS Schema Conversion.

 **To create an instance profile** 

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. In the navigation pane, choose **Instance profiles**, and then choose **Create instance profile**.

1. For **Name**, enter a unique name for your instance profile. For example, enter `sc-instance`.

1. For **Virtual private cloud (VPC)**, choose `sc-vpc`. You created this VPC in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. For **Subnet group**, choose the `PrivateSubnetGroup` subnet group that you created before.

1. For **S3 bucket** under **Schema conversion settings - optional**, choose an Amazon S3 bucket that you created in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. For ** IAM role**, choose the AWS Identity and Access Management (IAM) role that grants access to Amazon S3. You created this role in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. Choose **Create instance profile**.

Use this instance profile when you create your migration project in [Step 7](schema-conversion-oracle-postgresql-step-7.md).

# Step 6: Configure Data Providers


In this step, you create data providers that describe your source and target databases. A data provider stores a data store type and the location information about your database. Data providers don’t include database credentials. You store database credentials in AWS Secrets Manager. Make sure that you include data providers and database secrets in your DMS Schema Conversion migration project.

You can create only one data provider for a single database. If you try to create a second data provider for the same database, DMS Schema Conversion displays an error message. However, you can use one data provider in multiple migration projects.

 **To create a data provider for your Oracle database** 

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. In the navigation pane, choose **Data providers**, and then choose **Create data provider**.

1. For **Configuration**, choose **Enter manually**.

1. For **Name**, enter a unique name for your source data provider. For example, enter `sc-oracle`.

1. For **Engine type**, choose **Oracle**.

1. For **Server name**, enter the Domain Name Service (DNS) name or IP address of your database server.

1. For **Port**, enter the port used to connect to your database server.

1. For **Service ID (SID) or service name**, enter the Oracle System ID (SID). To find the Oracle SID, submit the following query to your Oracle database:

   ```
   SELECT sys_context('userenv','instance_name') AS SID FROM dual;
   ```

1. For **Secure Socket Layer (SSL) mode**, choose **none**. Optionally, choose the type of your SSL enforcement, and provide the certificate information.

1. Choose **Create data provider**.

 **To create a data provider for your Amazon RDS for PostgreSQL database** 

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. In the navigation pane, choose **Data providers**, and then choose **Create data provider**.

1. For **Configuration**, choose **RDS database instance**.

1. For **Database from RDS**, choose your Amazon RDS for PostgreSQL database.

1. For **Name**, enter a unique name for your target data provider. For example, enter `sc-postgresql`.

1. Choose **Create data provider**.

Use these data providers when you create your migration project in [Step 7](schema-conversion-oracle-postgresql-step-7.md).

# Step 7: Create a Migration Project


Now you can create a migration project which is the foundation of your work with DMS Schema Conversion. A migration project describes your source and target data providers, your instance profile, and migration rules.

To create a migration project

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. Choose **Migration projects**, and then choose **Create migration project**.

1. For **Name**, enter a unique name for your migration project. For example, enter `sc-project`.

1. For **Instance profile**, choose `sc-instance`. You created this instance profile in [Step 5](schema-conversion-oracle-postgresql-step-5.md).

1. For **Source**, choose **Browse**, and then choose `sc-oracle`. You created this data provider in [Step 6](schema-conversion-oracle-postgresql-step-6.md).

1. For **Secret ID**, choose `sc-oracle-secret`. You created this secret in [Step 4](schema-conversion-oracle-postgresql-step-4.md).

1. For **IAM role**, choose `sc-secrets-manager-role`. You created this role in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. For **Target**, choose **Browse**, and then choose `sc-postgresql`. You created this data provider in [Step 6](schema-conversion-oracle-postgresql-step-6.md).

1. For **Secret ID**, choose `sc-postgresql-secret`. You created this secret in [Step 4](schema-conversion-oracle-postgresql-step-4.md).

1. For **IAM role**, choose `sc-secrets-manager-role`. You created this role in [Step 1](schema-conversion-oracle-postgresql-step-1.md).

1. Choose **Create migration project**.

Use this migration project to convert your Oracle database schemas to PostgreSQL.

# Step 8: Convert Database Objects


After you create the migration project, you can convert your Oracle database schemas to PostgreSQL. To start working with your migration project, you launch DMS Schema Conversion.

The first launch of DMS Schema Conversion requires some setup. AWS Database Migration Service (AWS DMS) starts a schema conversion instance, which can take 10-15 minutes. This process also reads the metadata from the source and target databases. After a successful first launch, you can access DMS Schema Conversion instantly.

 **To convert your source Oracle database schema with DMS Schema Conversion** 

1. Sign in to the AWS Management Console and open the AWS DMS console at [https://console.aws.amazon.com/dms/v2/](https://console.aws.amazon.com/dms/v2/).

1. Choose your AWS Region.

1. Choose **Migration projects**. The **Migration projects** page opens.

1. Choose `sc-project`, and then choose **Schema conversion**.

1. Choose **Launch schema conversion**. If you launch schema conversion for the first time, then the notification appears. Choose **Launch**. The **Schema conversion** page opens. DMS Schema Conversion displays your source database schema in the left pane in a tree-view format.

1. In the source database pane, select the check box for the schema name.

1. Choose this schema in the left pane of the migration project. DMS Schema Conversion highlights the schema name in blue and activates the **Actions** menu.

1. For **Actions**, choose **Convert schema**. The conversion dialog box appears.

1. Choose **Convert** in the dialog box to confirm your choice.

After DMS Schema Conversion completes the conversion, you can review the converted code. After you choose a database object in the left pane of your project, DMS Schema Conversion automatically displays the source converted code for this object.

DMS Schema Conversion stores the converted code in your migration project and doesn’t apply these code changes to your target database. You can apply the converted code in DMS Schema Conversion. Alternatively, you can save the converted code as a SQL script, edit it, and then apply to your target database. For more information, see [Step 9](schema-conversion-oracle-postgresql-step-9.md).

In the settings of your migration project, you can customize your schema conversion view. Also, you can change conversion settings to improve the performance of converted code.

 **To edit the settings of your DMS Schema Conversion migration project** 

1. In the AWS DMS console, choose **Migration projects**. The **Migration projects** page opens.

1. Choose your migration project. Choose **Schema conversion**, then **Launch schema conversion**.

1. Choose **Settings**. The **Settings** page opens.

1. Change the settings to customize the schema conversion view. For more information, see [Specifying migration project settings](https://docs.aws.amazon.com/dms/latest/userguide/migration-projects-settings.html).

1. Change the settings to improve the performance of converted code. For more information, see [Specifying Oracle to PostgreSQL conversion settings](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-oracle-postgresql.html).

1. Choose **Apply**, and then choose **Schema conversion**.

After you change the settings, convert your source code again.

# Step 9: Edit and Apply Your Converted Code


After you convert your source Oracle database objects, you can review the conversion statistics. DMS Schema Conversion converts most of the database objects, but some of the objects require manual conversion.

DMS Schema Conversion displays the objects that require manual conversion in the **Action items** tab. To convert these objects, you can save the converted code as a SQL script. Then you can edit it using your code editor and apply these scripts to your target database. Alternatively, you can apply the converted code as is to your target database and make the edits later.

 **To save the converted code as a SQL script** 

1. In the target database pane, choose the converted database schema.

1. Select the check box for the name of this schema. DMS Schema Conversion highlights the schema name in blue and activates the **Actions** menu.

1. For **Actions**, choose **Save as SQL**. The **Save** dialog box appears.

1. Choose **Save as SQL** to confirm your choice.

1. Choose **S3 bucket**. The **Amazon S3** console opens.

1. Choose **Download** to save your SQL scripts.

 **To apply the converted code to your target database** 

1. In the target database pane, choose the converted database schema.

1. Select the check box for the name of this schema. DMS Schema Conversion highlights the schema name in blue and activates the **Actions** menu.

1. For **Actions**, choose **Apply changes**. The **Apply changes** dialog box appears.

1. Choose **Apply** to confirm your choice.

Now you have successfully converted your source Oracle database schemas to PostgreSQL. To complete the database migration, move your data and connect your applications to the new database.