AWS Schema Conversion Tool User Guide
Before You Begin
Converting Application SQL by Using the AWS Schema Conversion Tool
When you convert your database schema from one engine to another, you also need to update the SQL code in your applications to interact with the new database engine instead of the old one. You can use the AWS Schema Conversion Tool (AWS SCT) to convert the SQL code in your C++, C#, Java, or other application code. You can view, analyze, edit, and save the converted SQL code.
Before You Begin
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
Tool (p. 11) .
Because the SQL code in your application interacts with your database schema, you need to convert your database schema before you can convert your application SQL. To convert your database schema, use the procedures in one of the following topics:
•
Converting Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68)
•
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
Tool (p. 87)
Overview of Converting Application SQL
To convert the SQL code in your application, you take the following high-level steps:
Version 1.0
124
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
• Create an application conversion project – The application conversion project is a child of the database schema conversion project. Each database schema conversion project can have one or more child application conversion projects.
For more information, see
Creating Application Conversion Projects in the AWS Schema Conversion
Tool (p. 125) .
•
Analyze and convert your SQL code – AWS SCT analyzes your application, extracts the SQL code, and creates a local version of the converted SQL for you to review and edit. The tool doesn't change the code in your application until you are ready.
For more information, see
Analyzing and Converting Your SQL Code by Using the AWS Schema
Conversion Tool (p. 128)
.
• Create an application assessment report – The application assessment report provides important information about the conversion of the application SQL code from your source database schema to your target database schema.
For more information, see
Creating and Using the Assessment Report (p. 129)
.
• Edit, apply changes to, and save your converted SQL code – The assessment report includes a list of SQL code items that can't be converted automatically. For these items, you can edit the SQL code manually to perform the conversion.
For more information, see
Editing and Saving Your Converted SQL Code with the AWS Schema
Conversion Tool (p. 130)
.
Creating Application Conversion Projects in the
AWS Schema Conversion Tool
In the AWS Schema Conversion Tool (AWS SCT), the application conversion project is a child of the database schema conversion project. Each database schema conversion project can have one or more child application conversion projects. Use the following procedure to create an application conversion project.
To create an application conversion project
1. In the AWS Schema Conversion Tool, choose New Application from the Applications menu.
The New application conversion project dialog box appears.
Version 1.0
125
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
2. Add the following project information.
For This Parameter
Application Project Name
Location
Project language
SQL parameter style for target database
Do This
Type a name for your application conversion project. Each database schema conversion project can have one or more child application conversion projects, so choose a name that makes sense if you add more projects later.
Type the location of the source code for your application.
Choose one of the following:
•
JAVA
•
C++
•
C#
•
Any
Choose one of the following:
•
Same as in source
•
Positional (?)
Version 1.0
126
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
For This Parameter
Select source database schema
Do This
•
Indexed (:1)
•
Indexed ($1)
•
Named (@name)
•
Named (:name)
In the source tree, choose the schema used by your application code.
3. Choose OK to create your application conversion project.
The project window opens.
4. The first time you create an application conversion project, the project window opens automatically.
To open an existing application conversion project, select the project node in the source tree, open the context (right-click) menu, and then choose
Manage application.
Version 1.0
127
AWS Schema Conversion Tool User Guide
Analyzing and Converting Your SQL Code
5. You can add additional application conversion projects by choosing New Application from the
Applications menu, or by selecting the Applications node in the source tree, opening the context
(right-click) menu, and then choosing Add application.
Analyzing and Converting Your SQL Code by Using the AWS Schema Conversion Tool
Use the following procedure to analyze and convert your SQL code by using the AWS Schema Conversion
Tool (AWS SCT).
To analyze and convert your SQL code
1. In the application conversion project, choose Analyze.
AWS SCT analyzes your application code and extracts the SQL code. A list of all extracted SQL code appears in the Parsed SQL Scripts pane at the bottom of the window. The selected item in the list also appears in the Extracted SQL script pane.
2. You can analyze each SQL code item in the list, and when you are ready, choose Convert to convert the SQL to SQL for your target database.
Note
You can edit the converted SQL code in a later procedure.
Version 1.0
128
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
Creating and Using the Assessment Report
The application assessment report provides important information about converting the application
SQL code from your source database schema to your target database schema. The report details all of the SQL extracted from the application, all of the SQL converted, and action items for SQL that can't be converted. The report also includes estimates of the amount of effort that it will take to manually convert the SQL code that can't be converted automatically.
Creating an Application Assessment Report
Use the following procedure to create an application assessment report.
To create an application assessment report
1. In the application conversion project window, choose Create Report from the Actions menu.
The report is created and opens in the application conversion project window.
2. Review the Summary tab.
The Summary tab shown following, displays the summary information from the application assessment report. It shows the SQL code items that were converted automatically, and items that were not converted automatically.
3. Choose the SQL Conversion Actions tab and review the information.
Version 1.0
129
AWS Schema Conversion Tool User Guide
Editing and Saving Your Converted SQL Code
The SQL Conversion Actions tab contains a list of SQL code items that can't be converted automatically. There are also recommendations for how to manually convert the SQL code. You edit your converted SQL code in a later step. For more information, see
Editing and Saving Your
Converted SQL Code with the AWS Schema Conversion Tool (p. 130)
.
4. You can save a local copy of the application assessment report as either a PDF file or a commaseparated values (CSV) file. The PDF file contains both the summary and action item information.
The CSV file contains only action item information.
Editing and Saving Your Converted SQL Code with the AWS Schema Conversion Tool
The assessment report includes a list of SQL code items that can't be converted automatically. For each item that can't be converted, there is an action item on the
SQL Conversion Actions tab. For these items, you can edit the SQL code manually to perform the conversion.
Use the following procedure to edit your converted SQL code, apply the changes, and then save them.
To edit, apply changes to, and save your converted SQL code
1. Edit your converted SQL code directly in the Target SQL script pane. If there is no converted code shown, you can click in the pane and start typing.
2. After you are finished editing your converted SQL code, choose Apply. At this point, the changes are saved in memory, but not yet written to your file.
3. Choose Save to save your changes to your file.
Important
When you choose Save you overwrite your original file. Make a copy of your original file before saving so you have a record of your original application code.
Version 1.0
130