AWS Schema Conversion Tool. User Guide Version 1.0



Similar documents
AWS Schema Conversion Tool. User Guide Version 1.0

Getting Started using the SQuirreL SQL Client

Using the Eclipse Data Tools Platform with SQL Anywhere 10. A whitepaper from Sybase ianywhere

RDS Migration Tool Customer FAQ Updated 7/23/2015

Attix5 Pro Server Edition

Querying Databases Using the DB Query and JDBC Query Nodes

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Local Caching Servers (LCS): User Manual

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

JAMF Software Server Installation Guide for Linux. Version 8.6

Table of Contents SQL Server Option

Implementing a SAS 9.3 Enterprise BI Server Deployment TS-811. in Microsoft Windows Operating Environments

JAMF Software Server Installation Guide for Windows. Version 8.6

STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER

1. Product Information

Release Bulletin Sybase ETL Small Business Edition 4.2

Online Backup Client User Manual Linux

FileMaker 12. ODBC and JDBC Guide

Online Backup Client User Manual

XenClient Enterprise Synchronizer Installation Guide

Installing The SysAidTM Server Locally

Consolidated Monitoring, Analysis and Automated Remediation For Hybrid IT Infrastructures. Goliath Performance Monitor Installation Guide v11.

RecoveryVault Express Client User Manual

FileMaker 11. ODBC and JDBC Guide

Installation Instruction STATISTICA Enterprise Server

Online Backup Linux Client User Manual

Online Backup Client User Manual

WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide

DBMoto 6.5 Setup Guide for SQL Server Transactional Replications

Ajera 7 Installation Guide

Uni Sales Analysis CRM Extension for Sage Accpac ERP 5.5

National Fire Incident Reporting System (NFIRS 5.0) NFIRS Data Entry/Validation Tool Users Guide

STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS

Upgrade Guide BES12. Version 12.1

Setting up SQL Translation Framework OBE for Database 12cR1

Matisse Installation Guide for MS Windows. 10th Edition

Installation Instruction STATISTICA Enterprise Small Business

Installation and Upgrade Guide. PowerSchool Student Information System

You may have been given a download link on your trial software . Use this link to download the software.

Signiant Agent installation

Archive Attender Version 3.5

simplify monitoring Consolidated Monitoring, Analysis and Automated Remediation For Hybrid IT Infrastructures

How To Install And Set Up The Database For Quicdoc And Office Therapy (The Applications)

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

Setting Up ALERE with Client/Server Data

MATLAB on EC2 Instructions Guide

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

Deltek Costpoint New Installation Guide for Microsoft SQL Server

Installing RMFT on an MS Cluster

VMware Horizon FLEX User Guide

Getting Started with VMware Fusion

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

Operating System Installation Guide

Informatica Cloud & Redshift Getting Started User Guide

Enterprise Manager. Version 6.2. Installation Guide

GoAnywhere Director to GoAnywhere MFT Upgrade Guide. Version: Publication Date: 07/09/2015

Browser Client 2.0 Admin Guide

HR Onboarding Solution

PowerSchool Student Information System

Supplement I.B: Installing and Configuring JDK 1.6

Video Administration Backup and Restore Procedures

Verax Service Desk Installation Guide for UNIX and Windows

Advanced Event Viewer Manual

Installation Guide. Help Desk Manager. Version v12.1.0

FmPro Migrator - FileMaker to SQL Server

STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS

insync Installation Guide

Sage Accpac Extended Enterprise Edition 5.6A. Installation and System Administrator's Guide

National Fire Incident Reporting System (NFIRS 5.0) NFIRS Data Entry/Validation Tool Users Guide

Matisse Installation Guide for MS Windows

FileNet Business Activity Monitor (BAM) Release Notes

Quick Start Guide for VMware and Windows 7

FreeFlow Accxes Print Server V15.0 August P Xerox FreeFlow Accxes Print Server Drivers and Client Tools Software Installation Guide

Reporting for Contact Center Setup and Operations Guide. BCM Contact Center

Compiere ERP & CRM Installation Instructions Windows System - EnterpriseDB

Consolidated Monitoring, Analysis and Automated Remediation For Hybrid IT Infrastructures. Goliath Performance Monitor Installation Guide v11.

Data processing goes big

WhatsUp Gold v16.1 Installation and Configuration Guide

Compiere 3.2 Installation Instructions Windows System - Oracle Database

FileMaker 13. ODBC and JDBC Guide

This document details the following four steps in setting up a Web Server (aka Internet Information Services -IIS) on Windows XP:

SolarWinds Migrating SolarWinds NPM Technical Reference

Install BA Server with Your Own BA Repository

WINDOWS 7 & HOMEGROUP

Server Installation/Upgrade Guide

Millennium Drive. Installation Guide

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

IBM Endpoint Manager Version 9.1. Patch Management for Red Hat Enterprise Linux User's Guide

Microsoft Visual Studio Integration Guide

StreamServe Persuasion SP4

AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS

CTERA Agent for Linux

Quick Start Guide for Parallels Virtuozzo

Eclipse installation, configuration and operation

Sage 300 ERP Installation and Administration Guide

IceWarp to IceWarp Server Migration

PAINLESS MULTI-DBMS STRATEGY For Magic Developers

KeyAdvantage System DMS Integration. Software User Manual

Converting InfoPlus.21 Data to a Microsoft SQL Server 2000 Database

Transcription:

AWS Schema Conversion Tool User Guide

AWS Schema Conversion Tool: User Guide Copyright 2016 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

Table of Contents What Is the AWS Schema Conversion Tool?... 1 Converting Your Schema... 2 The AWS Schema Conversion Tool Project Window... 3 Related Topics... 4 Installing and Updating... 5 Installing the AWS Schema Conversion Tool on Windows... 5 Installing the AWS Schema Conversion Tool on Mac OS X... 6 Installing the AWS Schema Conversion Tool on Ubuntu Linux... 6 Installing the AWS Schema Conversion Tool on Fedora Linux... 6 Updating the AWS Schema Conversion Tool... 7 Required Database Drivers... 7 Installing JDBC Drivers on Linux... 7 Update Global Settings... 8 Related Topics... 9 Getting Started... 10 Before You Begin... 10 Create an AWS Schema Conversion Tool Project... 10 View the Schema from Your Source Database... 15 Create the Schema... 17 Clear the Schema... 19 Update Your Source Schema... 20 Overwrite the Schema... 21 Create the Database Migration Assessment Report... 22 Apply the Schema to the DB Instance... 26 Related Topics... 27 Converting Schema... 28 Create a Project... 29 The Assessment Report... 31 To Create the Database Migration Assessment Report... 32 Converting Your Schema... 35 Clearing a Schema... 39 Updating and Refreshing Your Schema... 40 Saving and Applying Your Schema... 41 Saving Your Schema to a File... 41 Applying Your Schema... 42 Related Topics... 43 Best Practices... 44 Memory Management and Performance... 44 Related Topics... 44 Reference... 45 Related Topics... 45 Oracle to MySQL Supported Schema Conversion... 45 Statements... 46 Procedures... 50 Flow Control... 51 Packages... 51 Functions... 51 Operators... 61 Data Types... 65 Data Definition Language (DDL)... 67 Cursors... 70 Hints... 71 Exceptions... 73 Related Topics... 74 SQL Server to MySQL Supported Schema Conversion... 74 iii

Statements... 75 Procedures... 78 Flow Control... 79 Functions... 79 Operators... 87 Transactions... 90 Data Types... 91 Data Definition Language (DDL)... 93 Cursors... 94 Related Topics... 95 Keyboard Shortcuts... 95 Related Topics... 95 Troubleshooting... 96 Cannot load objects from Oracle source database... 96 Related Topics... 96 Document History... 98 iv

What Is the AWS Schema Conversion Tool? The AWS Schema Conversion Tool helps you convert your database schema from an Oracle or Microsoft SQL Server database, to an Amazon Relational Database Service (Amazon RDS) MySQL DB instance, an Amazon Aurora DB cluster, or a PostgreSQL DB instance. The AWS Schema Conversion Tool can be run on a Microsoft Windows, Mac, or Linux desktop and provides a project-based user interface to automatically convert the database schema of your source database into a format compatible with your target Amazon RDS instance. In the case where schema from your source database cannot be automatically converted, the AWS Schema Conversion Tool provides guidance on how you can create equivalent schema in your target Amazon RDS database. 1

Converting Your Schema Converting Your Schema The process of converting your database schema to Amazon RDS follows these steps: 1. Create your target DB instance Create the Amazon RDS for MySQL DB instance, Amazon Aurora DB cluster, or PostgreSQL DB instance to host your converted schema and data. For a MySQL or PostgreSQL DB instance, be sure to allocate enough storage for your data once converted. 2. Create a new AWS Schema Conversion Tool project Create a project to convert your database schema. 3. Connect the AWS Schema Conversion Tool to your source and target Connect your AWS Schema Conversion Tool project to your source database and your Amazon RDS DB instance. 4. Create a database migration assessment report The AWS Schema Conversion Tool creates a database migration assessment report that details the schema elements that cannot be converted automatically. You can use this report to identify where you need to create schema in your Amazon RDS DB instance that is compatible with those of your source database. In some cases when the schema from your source database cannot be automatically converted, you can modify those schema in your source database into a format that can be automatically converted 2

The AWS Schema Conversion Tool Project Window to the database engine for your target DB instance. After you have modified the schema from your source database and verified that it is compatible with your application, refresh the metadata in your AWS Schema Conversion Tool project with the updated schema information, and then convert the schema again and create a new database migration assessment report. 5. Convert your schema The AWS Schema Conversion Tool creates a local version of the converted schema for you to review, but it doesn't apply that version to your target DB instance until you are ready. 6. Apply the converted schema to Amazon RDS When you are ready, have the AWS Schema Conversion Tool apply the converted schema in your local project to your Amazon RDS DB instance. 7. Create any schema elements that cannot be automatically converted If you have schema elements that couldn't be automatically converted to your target database engine, create equivalent schema elements in your target Amazon RDS DB instance. Caution Once you manually add schema elements for items that couldn't be automatically converted to your target DB instance, take care if you plan to rewrite the converted schema from the AWS Schema Conversion Tool to your target DB instance. Rewriting the converted schema overwrites the schema in your target DB instance, and any schema elements that you have manually added are lost. You might want to save your manual work before rewriting the converted schema, or you might want to avoid rewriting the converted schema and update the schema in your target DB instance using a different method. For details, see Converting a Database Schema to Amazon RDS Using the AWS Schema Conversion Tool (p. 28). The AWS Schema Conversion Tool Project Window The following is what you see in the AWS Schema Conversion Tool when you create a schema migration project. 3

Related Topics 1. In the left panel, the schema from your source database is presented in a tree view. Your database schema is "lazy loaded." That is, at the point when you select an item from the tree view, the AWS Schema Conversion Tool gets and displays the current schema from your source database. 2. In the top middle panel, action items appear for schema elements from the source database engine that couldn't be automatically converted to the target database engine. 3. In the right panel, the schema from your target DB instance is presented in a tree view.your database schema is "lazy loaded." That is, at the point when you select an item from the tree view, the AWS Schema Conversion Tool gets and displays the current schema from your target database. 4. In the lower left panel, when you choose a schema element, properties describing the source schema element and the SQL command to create that element in the source database are displayed. 5. In the lower right panel, when you choose a schema element, properties describing the target schema element and the SQL command to create that element in the target database are displayed here. Related Topics Installing and Updating the AWS Schema Conversion Tool (p. 5) Getting Started with the AWS Schema Conversion Tool (p. 10) 4

Installing the AWS Schema Conversion Tool on Windows Installing and Updating the AWS Schema Conversion Tool The AWS Schema Conversion Tool is available for the following operating systems: Microsoft Windows (download) Mac OS X (download) Ubuntu Linux (download) Fedora Linux (download) The AWS Schema Conversion Tool also installs the Java Runtime Environment (JRE) version 8u45. Topics Important After you install the AWS Schema Conversion Tool, you must also install the required JDBC drivers to connect to your source database and target Amazon Relational Database Service (Amazon RDS) DB instance. For details, see Required Database Drivers (p. 7). Installing the AWS Schema Conversion Tool on Windows (p. 5) Installing the AWS Schema Conversion Tool on Mac OS X (p. 6) Installing the AWS Schema Conversion Tool on Ubuntu Linux (p. 6) Installing the AWS Schema Conversion Tool on Fedora Linux (p. 6) Updating the AWS Schema Conversion Tool (p. 7) Required Database Drivers (p. 7) Related Topics (p. 9) Installing the AWS Schema Conversion Tool on Windows To install the AWS Schema Conversion Tool on Microsoft Windows 1. Download aws-schema-conversion-tool-1.0.latest.zip for Windows, and then extract AWS Schema Conversion Tool-1.0.msi. 5

Installing the AWS Schema Conversion Tool on Mac OS X 2. Run the AWS Schema Conversion Tool-1.0.msi installer. By default, the AWS Schema Conversion Tool is installed in the c:\program Files\AWS Schema Conversion Tool folder. 3. When the installation is complete, you can run the AWS Schema Conversion Tool application. Install the required JDBC drivers for your source database engine and target DB instance database engine, if needed, and set the paths to the JDBC drivers in the global settings of the AWS Schema Conversion Tool. For details, see Required Database Drivers (p. 7). Installing the AWS Schema Conversion Tool on Mac OS X To install the AWS Schema Conversion Tool on Mac OS X 1. Download aws-schema-conversion-tool-1.0.latest.zip for Mac OS X, and then extract AWS Schema Conversion Tool-1.0.dmg. 2. In Finder, open AWS Schema Conversion Tool-1.0.dmg. 3. Drag AWS Schema Conversion Tool-1.0.dmg to the Applications folder. 4. When the installation is complete, you can run the AWS Schema Conversion Tool application. Install the required JDBC drivers for your source database engine and target DB instance database engine, if needed, and set the paths to the JDBC drivers in the global settings of the AWS Schema Conversion Tool. For details, see Required Database Drivers (p. 7). Installing the AWS Schema Conversion Tool on Ubuntu Linux Important The AWS Schema conversion tool is supported on Ubuntu Linux version 15.04 (64-bit). To install the AWS Schema Conversion Tool on Ubuntu Linux 1. Download aws-schema-conversion-tool-1.0.latest.zip for Ubuntu, and then extract aws-schema-conversion-tool-1.0.deb. 2. Run the following command where file-path is the folder that you downloaded the file to: sudo dpkg -i file-path/aws-schema-conversion-tool-1.0.deb 3. When the installation is complete, you can run the AWS Schema Conversion Tool application. Install the required JDBC drivers for your source database engine and target DB instance database engine, if needed, and set the paths to the JDBC drivers in the global settings of the AWS Schema Conversion Tool. For details, see Required Database Drivers (p. 7). Installing the AWS Schema Conversion Tool on Fedora Linux Important The AWS Schema conversion tool is supported on Fedora Linux version 22 (64-bit). 6

Updating the AWS Schema Conversion Tool To install the AWS Schema Conversion Tool on Fedora Linux 1. Download aws-schema-conversion-tool-1.0.latest.zip for Fedora, and then extract aws-schema-conversion-tool-1.0-1.x86_64.rpm. 2. Run the following command, where file-path is the folder that you downloaded the file to: sudo yum install file-path/aws-schema-conversion-tool-1.0-1.x86_64.rpm 3. When the installation is complete, you can run the AWS Schema Conversion Tool application. Install the required JDBC drivers for your source database engine and target DB instance database engine, if needed, and set the paths to the JDBC drivers in the global settings of the AWS Schema Conversion Tool. For details, see Required Database Drivers (p. 7). Updating the AWS Schema Conversion Tool To check whether new version of the AWS Schema Conversion Tool is available, choose Help -> Check for Updates. If there is a newer version of the AWS Schema Conversion Tool than the version that you have installed, you will be prompted to download and install the updated version. Required Database Drivers You must have the required JDBC drivers installed for the AWS Schema Conversion Tool to connect to your source database or target RDS DB instance. You can download the latest database drivers from the following locations. Database Engine PostgreSQL Oracle Microsoft SQL Server Download https://www.mysql.com/products/connector/ https://jdbc.postgresql.org/download.html MySQL or Amazon Aurora http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12cdownload-1958347.html https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774 Installing JDBC Drivers on Linux You can use the following steps to install the JDBC drivers on your Linux system for use with the AWS Schema Conversion Tool. To install JDBC drivers on your Linux system 1. Create a directory to store the JDBC drivers in. PROMPT>sudo mkdir p /usr/local/jdbc-drivers 2. Install the JDBC driver for your database engine using the commands shown following. 7

Update Global Settings Database Engine MySQL or Amazon Aurora Installation Commands PROMPT> cd /usr/local/jdbc-drivers PROMPT> sudo tar xzvf /tmp/mysql-connector-java- X.X.X.tar.gz PostgreSQL PROMPT> cd /usr/local/jdbc-drivers PROMPT> sudo cp -a /tmp/postgresql-x.x.x.jre7.tar. Oracle PROMPT> cd /usr/local/jdbc-drivers PROMPT> sudo mkdir oracle-jdbc PROMPT> cd oracle-jdbc PROMPT> sudo cp -a /tmp/ojdbc7.jar. Microsoft SQL Server PROMPT> cd /usr/local/jdbc-drivers PROMPT> sudo tar xzvf /tmp/sqljdbc_x.x.x_enu.tar.gz Update Global Settings After you have downloaded and installed the required JDBC drivers, you must update the settings in the AWS Schema Conversion Tool with the driver file locations. To update the driver file locations 1. In the AWS Schema Conversion Tool, choose Settings, and then choose Global settings. 2. For Global settings, choose Drivers. Add the file path to the JDBC driver for your source database engine and your target RDS DB instance database engine. 8

Related Topics 3. Choose OK to exit the Global Settings window. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) 9

Before You Begin Getting Started with the AWS Schema Conversion Tool This topic walks you through how to create an AWS Schema Conversion Tool project and convert the schema from your source database to your target Amazon Relational Database Service (Amazon RDS) DB instance. Before You Begin Before you perform the tasks described in this topic, you must first have completed the following: Install the AWS Schema Conversion Tool. For more information, see Installing and Updating the AWS Schema Conversion Tool (p. 5). Identify the connection information for your source database. Create your target Amazon RDS DB instance (if needed) and identify the connection information for your target DB instance. For more information, see Connecting to a DB Instance Running the MySQL Database Engine, Connecting to an Amazon Aurora DB Cluster, or Connecting to a DB Instance Running the PostgreSQL Database Engine. Create an AWS Schema Conversion Tool Project The first time that open the AWS Schema Conversion Tool you automatically begin creating a database migration project using the Create New Database Migration Project wizard. You can create additional projects using the Create New Database Migration Project wizard by choosing the File menu, and then choosing the New Project Wizard option. Optionally, you can create a project without the Create New Database Migration Project wizard by choosing the File menu, and then choosing the New Project option. For more information, see Creating an AWS Schema Conversion Tool Project (p. 29). Follow these steps to create your first data migration project using the Create New Database Migration Project wizard. 10

Create an AWS Schema Conversion Tool Project Select your source database 1. Add your local project settings and the information to connect to your source database in the first step of the wizard: te You cannot connect to an Oracle database using Transparent Network Substrate (TNS) names. Project Name: A name for your project, which is stored locally on your computer. Location: The file location for your local project file. Source DB Engine: The database engine for your source database. This value can be Oracle for an Oracle database or SQL Server for a Microsoft SQL Server database. Server Name: The DNS name or IP address of your source database server. Server Port: The port used to connect to your source database server. Instance name/oracle SID: For Microsoft SQL Server, this value is the instance name. You can obtain the instance name by submitting the following query to your SQL Server database: SELECT @@servername; For Oracle databases, this value is the Oracle System ID (SID). You can obtain the Oracle SID by submitting the following query to your Oracle database: SELECT sys_context('userenv','instance_name') AS SID FROM dual; Username: The user name used to connect to your source database server. Password: The password for your user name. The AWS Schema Conversion Tool uses this password to connect to your source database only when you choose the Connect to source option. To guard against exposing the password for your source database, the AWS Schema Conversion Tool does not store that password. If you close your AWS Schema Conversion Tool project and reopen it, you are prompted for the password to connect to your source database as needed. You can choose the Test Connection button to verify that your database connection information successfully connects you to your source database. After you have finished adding the project and connection information, choose Next to continue. 11

Create an AWS Schema Conversion Tool Project 2. Select the schema from your source database Select the schema from your source database that you want to convert to your target RDS DB instance. After you have selected the schema that you want to convert, choose Next to continue. 12

Create an AWS Schema Conversion Tool Project 3. Run the database migration assessment report The database migration assessment report provides important information regarding the conversion of the schema from your source database to your target RDS DB instance. The report summarizes all of the schema conversion tasks and details the action items for schema that cannot be converted to the DB engine of your target DB instance. The report also includes estimates of the amount of effort that it will take to write the equivalent code in your target DB instance that could not be automatically converted. For more information on the database migration assessment report, see Creating and Using the Assessment Report (p. 31). You can save a local copy of the database migration assessment report as either a Portable Document Format (PDF) file, or a Comma-separated Values (CSV) file. This step is optional. You can view the database migration assessment report and save a local copy of it at any time after you have created your project. Choose Next to continue. 13

Create an AWS Schema Conversion Tool Project 4. Select your target RDS DB instance Add the information to connect to your target RDS DB instance: Target DB Engine: The database engine for your target DB instance. This value can be MySQL for a MySQL DB instance, Amazon Aurora for an Amazon Aurora DB cluster, or PostgreSQL for a PostgreSQL DB instance. Server Name: The DNS name of your target DB instance. Server Port: The port used to connect to your target DB instance. Username: The user name used to connect to your target DB instance. Password: The password for your user name. The AWS Schema Conversion Tool uses this password to connect to your target DB instance only when you choose the Connect to target option. To guard against exposing the password for your source database, the AWS Schema Conversion Tool does not store that password. If you close your AWS Schema Conversion Tool project and reopen it, you are prompted for the password to connect to your target DB instance as needed. You can choose the Test Connection button to verify that your database connection information successfully connects you to your target RDS DB instance. After you have finished adding your connection information, choose Finish to create your project. 14

View the Schema from Your Source Database View the Schema from Your Source Database Your AWS Schema Conversion Tool project displays the schema from your source database in the left panel. The schema is presented in a tree-view format and each node of the tree is "lazy loaded." That is, when you choose a node in the tree view, the AWS Schema Conversion Tool will request the schema information from your source database at that time. 15

View the Schema from Your Source Database 16

Create the Schema Create the Schema Use the following procedure to create the converted schema. To create the converted schema 1. To go to the main view of your project, choose View, and then Main View. 17

Create the Schema 2. In the left panel that displays the schema from your source database, choose a schema object to convert. Open the context (right-click) menu for the object, and choose Convert Schema. When the AWS Schema Conversion Tool finishes converting the schema, you can view the proposed schema in the panel on the right of your project. At this point, no schema is applied to your target RDS DB instance. The planned schema is only part of your project. If you select a converted schema item, you can see the planned schema command in the panel at lower-center for your target RDS DB instance. 18

Clear the Schema Clear the Schema Before the AWS Schema Conversion Tool applies the schema to your target RDS DB instance, you can clear the planned schema from your project by opening the context (right-click) menu for the tree-view node for your target DB instance, and then choosing Refresh from Database. Because no schema has been written to your target DB instance, refreshing from the database removes the planned schema elements in your schema conversion tool project to match what exists in your target DB instance. 19

Update Your Source Schema Update Your Source Schema You can update your AWS Schema Conversion Tool project with the most recent schema from your source database by opening the context (right-click) menu for the schema item from your source database that you want to update, and then choosing Refresh from Database. Doing this enables you to update your schema conversion tool project if changes have been made to the schema of your source database. 20

Overwrite the Schema Overwrite the Schema After you have refreshed the schema from your source database in your project, you can overwrite the converted schema in your project with updated schema. To overwrite a converted schema in your project with an updated schema 1. In the left panel that displays the schema from your source database, choose the schema object to update the converted schema for. 2. Open the context (right-click) menu for the object and choose Convert Schema, as shown following. 21

Create the Database Migration Assessment Report 3. A prompt asks you to confirm the action before overwriting the local converted schema, as shown following. Create the Database Migration Assessment Report The New Project Wizard includes a step to create the database migration assessment report, which summarizes all of the action items for schema that cannot be converted to the engine of your target RDS DB instance.the report also includes estimates of the amount of effort that it will take to write the equivalent code in your target DB instance that could not be automatically converted. 22

Create the Database Migration Assessment Report You can create an updated database migration assessment report at any time in your project by following these steps. To create the database migration assessment report 1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for. Open the context (right-click) menu for the object, and choose Create Report. The assessment report view then opens. To explore the report, choose the Action Items tab. The Action Items tab displays a list of items that describe schema that could not automatically be converted to the database engine of your target RDS DB instance. Select one of the action items from the list. tice that the AWS Schema Conversion Tool highlights the item from your schema that the action item applies to, as shown following. 23

Create the Database Migration Assessment Report 2. To view the assessment report summary Select the Summary tab. The Summary tab displays the summary information from the database migration assessment report. It shows the number of items that were automatically converted and the number of items that could not be automatically converted. The summary also includes an estimate of the time that it would take to create schema that is equivalent to your source database in your target DB instance. An example is shown following. 24

Create the Database Migration Assessment Report 3. To save the assessment report Step 3 of the Create New Database Migration Project wizard gives you the option to create a local copy of the database migration assessment report. You can choose to save a local copy of the database migration assessment report as either a Portable Document Format (PDF) file, or a Comma-separated Values (CSV) file after you have created your database migration project. Choose the Summary tab, and then choose Save to PDF to create the database migration assessment report as a PDF file and store it locally on your computer. The PDF file contains both the summary and action item information. The CSV file contains only action item information. 25

Apply the Schema to the DB Instance Apply the Schema to the DB Instance When you are ready, you can apply the converted database schema to your target RDS DB instance. Once the schema has been applied to your target DB instance, you can update it based on the action items identified in the database migration assessment report. To apply the converted database schema to your target RDS DB instance Caution If you have an existing schema in your DB instance that matches the schema being applied, then the AWS Schema Conversion Tool overwrites the existing schema. This functionality is useful to update the schema in your target DB instance. However, be careful not to overwrite schema unintentionally especially a schema that you have modified in your target DB instance based on a database migration assessment report. 26

Related Topics 1. To apply the schema to your target DB instance, choose the schema element in the right panel of your project that displays the planned schema for your target DB instance. 2. Open the context (right-click) menu for the schema element, and choose Apply to database. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Installing and Updating the AWS Schema Conversion Tool (p. 5) 27

Converting a Database Schema to Amazon RDS Using the AWS Schema Conversion Tool The AWS Schema Conversion Tool automates much of the process of converting your database schema from an Oracle or Microsoft SQL Server database to an Amazon Relational Database Service (Amazon RDS) MySQL DB instance, an Amazon Aurora DB cluster, or a PostgreSQL DB instance. Because the Oracle, SQL Server and MySQL database engines (Amazon Aurora is MySQL-compatible) contain many different features and capabilities, the AWS Schema Conversion Tool attempts to create an equivalent schema in your RDS DB instance wherever possible. In cases where there is no direct conversion possible, the AWS Schema Conversion Tool provides a list of action items for you and a database migration assessment report that includes information on the schema elements that couldn't be converted, along with guidance on how you can manually create equivalent schema from your source database in your target DB instance. Topics Creating an AWS Schema Conversion Tool Project (p. 29) Creating and Using the Assessment Report (p. 31) Converting Your Schema (p. 35) Updating and Refreshing Your Schema (p. 40) Saving and Applying Your Schema (p. 41) Related Topics (p. 43) The process of converting your database schema to RDS can be described with the following steps: 1. Create your target DB instance Create the Amazon RDS for MySQL DB instance, Amazon Aurora DB cluster, or PostgreSQL DB instance to host your converted schema and data. For a MySQL or PostgreSQL DB instance, be sure to allocate enough storage for your data once converted. 2. Create a new AWS Schema Conversion Tool project Create a project to convert your database schema. 3. Connect the AWS Schema Conversion Tool to your source and target Connect your AWS Schema Conversion Tool project to your source database and your RDS DB instance. 4. Create a database migration assessment report The AWS Schema Conversion Tool creates a database migration assessment report that details the schema elements that cannot be converted 28

Create a Project automatically. You can use this report to identify where you need to create a schema in your RDS DB instance that is compatible with your source database. In some cases when the schema from your source database cannot be automatically converted, you can modify those schema in your source database into a format that can be automatically converted to the database engine for your target DB instance. After you have modified the schema from your source database and verified that it is compatible with your application, refresh the metadata in your AWS Schema Conversion Tool project with the updated schema information, and then convert the schema again and create a new database migration assessment report. 5. Convert your schema The AWS Schema Conversion Tool creates a local version of the converted schema for you to review, but it doesn't apply it to your target DB instance until you are ready. 6. Apply the converted schema to Amazon RDS When you are ready, have the AWS Schema Conversion Tool apply the converted schema in your local project to your RDS DB instance. 7. Create any schema elements that cannot be automatically converted If you have schema elements that couldn't be automatically converted to your target database engine, create equivalent schema elements in your target RDS DB instance. Caution Once you manually add schema elements that could not be automatically converted to your target DB instance, take care if you plan to rewrite the converted schema from the AWS Schema Conversion Tool to your target DB instance. Rewriting the converted schema overwrites the schema in your target DB instance, and any schema elements that you have manually added are lost. You might want to save your manual work before rewriting the converted schema, or you might want to avoid rewriting the converted schema and update the schema in your target DB instance using a different method. Creating an AWS Schema Conversion Tool Project You can use a AWS Schema Conversion Tool project to do the following: Connect to the source database that you will be converting a schema from. Display the schema from your source database in tree-view format. Connect to the target RDS DB instance that you will be converting schema to. Display the schema from your target DB instance in tree-view format. Generate a database migration assessment report that lists the schema items from your source database that couldn't be automatically converted to the equivalent schema for your target DB instance. Convert the schema from your source database to a format compatible with the DB engine of your target DB instance. This converted schema is stored locally until you are ready to apply it to your target DB instance. After you have converted the scheme from your source database, you can view the schema that will be applied to your target DB instance. Apply the converted schema to your target DB instance. The following procedure shows you how to create a database migration project using the New Project option from the File menu.you can also create a new database migration project using the New Project Wizard option from the File menu, which starts the Create New Database Migration Project wizard. For an example, see Getting Started with the AWS Schema Conversion Tool (p. 10). 29

Create a Project To create your project and connect to your source and target databases 1. Start the AWS Schema Conversion Tool, and choose New Project on the File menu. Add the following information: Project Name: A name for your project, which is stored locally on your computer. Location: The file location for your local project file. Source: The database engine for your source database. This value can be Oracle for an Oracle database or SQL Server for a Microsoft SQL Server database. Target: The database engine for your target DB instance. This value can be MySQL for a MySQL DB instance, Amazon Aurora for an Amazon Aurora DB cluster, or PostgreSQL for a PostgreSQL DB instance. Choose OK to create your AWS Schema Conversion Tool project. 2. Choose the Connect to source button where source indicates the database engine for your source database. Add the following information: Important You cannot connect to an Oracle database using Transparent Network Substrate (TNS) names. Server Name: The DNS name of your source database server. Server Port: The port used to connect to your source database server. Instance name/oracle SID: For Microsoft SQL Server, this value is the instance name. You can obtain the instance name by submitting the following query to your SQL Server database: SELECT @@servername; For Oracle databases, this value is the Oracle System ID (SID). You can obtain the Oracle SID by submitting the following query to your Oracle database: SELECT sys_context('userenv','instance_name') AS SID FROM dual; Username: The user name used to connect to your source database server. Password: The password for your user name. The AWS Schema Conversion Tool uses this password to connect to your source database only when you choose the Connect to source option. To guard against exposing the password for your source database, the AWS Schema Conversion Tool does not store that password. If you close your AWS Schema Conversion Tool project and reopen it, you are prompted for the password to connect to your source database as needed. Choose OK to connect to your source database. 3. Choose Connect to target, where target indicates the database engine for your target DB instance. 30

The Assessment Report Add the following information: Server Name: The DNS name of your target DB instance. Server Port: The port used to connect to your target DB instance. Username: The user name used to connect to your target DB instance. Password: The password for your user name. The AWS Schema Conversion Tool uses this password to connect to your target DB instance only when you choose the Connect to target option. To guard against exposing the password for your source database, the AWS Schema Conversion Tool does not store that password. If you close your AWS Schema Conversion Tool project and reopen it, you are prompted for the password to connect to your target DB instance as needed. Choose OK to connect to your target DB instance. Creating and Using the Assessment Report The database migration assessment report provides important information regarding the conversion of the schema from your source database to your target RDS DB instance. The report summarizes all of the schema conversion tasks and details the action items for schema that cannot be converted to the DB engine of your target DB instance. The report also includes estimates of the amount of effort that it will take to write the equivalent code in your target DB instance that could not be automatically converted. You can respond to the action items in the assessment report in different ways: Add equivalent schema manually You can write all of the schema that can be automatically converted to your target DB instance by choosing Apply to database in the right panel of your project. The schema that are written to your target DB instance won't contain the items that couldn't be automatically converted. Those items are listed in your database migration assessment report. After applying the schema to your target DB instance, you can then manually create schema in your target DB instance that are equivalent to the source database. In some cases, you cannot create equivalent schema in your target DB instance.you might need to rearchitect a portion of your application and database to use the functionality that is available from the DB engine for your target DB instance. In other cases, you can simply ignore the schema that can't be automatically converted. Caution If you manually create schema in your target DB instance, do not choose the Apply to database option until after you have saved a copy of any manual work that you have done that is, any commands to create schema in your target RDS DB instance that were not automatically created by the AWS Schema Conversion Tool. Applying the schema from your project to your target DB instance overwrites schema of the same name in the target DB instance, and you lose any updates that you added manually. Modify your source database schema and refresh the schema in your project For some items, you might be best served to modify the database schema in your source database to schema that are both compatible with your application architecture, and can also be automatically converted to the DB engine of your target DB instance. After updating the schema in your source database and verifying 31

To Create the Database Migration Assessment Report that the updates are compatible with your application, choose Refresh from Database in the left panel of your project to update the schema from your source database. You can then convert your updated schema and generate the database migration assessment report again, and the action item for your updated schema will no longer appear. The advantage to this process is that your updated schema will always be available when you refresh from your source database. To Create the Database Migration Assessment Report 1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for. Open the context (right-click) menu for the object, and choose Create Report. After you create the assessment report, the assessment report view opens, showing the Summary tab. The Summary tab displays the summary information from the database migration assessment report. It shows items that were automatically converted and items that could not be automatically converted. For schema items that could not be automatically convered to the target database engine, the summary includes an estimate of the effort that it would take to create schema that is equivalent to your source database in your target DB instance. The report categorizes the estimated time to convert these schema items as follows: Simple actions that can be completed in less than 1 hour. Medium actions that are more complex and can be completed in 1 to 4 hours. 32

To Create the Database Migration Assessment Report Significant actions that are very complex and will take more than 4 hours to complete. You can save a local copy of the database migration assessment report as either a Portable Document Format (PDF) file, or a Comma-separated Values (CSV) file. The CSV file contains only action item information. The PDF file contains both the summary and action item information, as shown in the following example. 33

To Create the Database Migration Assessment Report The assessment report view also includes an Action Items tab. The AWS Schema Conversion Tool displays a list of items that describe schema that could not automatically be converted to the database engine of your target RDS DB instance. If you select an action item from the list, the AWS Schema Conversion Tool will highlight the item from your schema that the action item applies to. 34

Converting Your Schema Converting Your Schema After you have connected your project to both your source database and your target RDS DB instance, your AWS Schema Conversion Tool project displays the schema from your source database in the left panel. The schema is presented in a tree-view format, as shown following, and each node of the tree is "lazy loaded." That is, when you choose a node in the tree view, the AWS Schema Conversion Tool requests the schema information from your source database at that time. 35

Converting Your Schema 36

Converting Your Schema You can choose schema items from your source database and then convert the schema to equivalent schema for the DB engine of your target DB instance.you can choose any schema item from your source database to convert. If the schema item that you chose is dependent on a "parent" item, then the AWS Schema Conversion Tool also generates the schema for the parent item. For example, if you choose a column from a table to convert, then the AWS Schema Conversion Tool generates the schema for the column, the table that the column is in, and the database that the table is in. When the AWS Schema Conversion Tool generates a converted schema, it does not immediately apply it to the target DB instance. Instead, the converted schema is stored locally until you are ready to apply it to the target DB instance. For more information, see Applying Your Schema (p. 42). To convert schema from your source database, choose a schema object to convert from the left panel of your project. Open the context (right-click) menu for the object, and choose Convert schema, as shown following. 37

Converting Your Schema You can create a database migration assessment report that contains a summary of all of the action items displayed in the Action Items tab and save it as a PDF. The assessment report is useful for identifying and resolving schema items that could not be automatically converted. For more information, see Creating and Using the Assessment Report (p. 31). After you have converted the schema from your source database, you can choose schema items from the left panel of your project and view the converted schema in the center panels of your project. The lower-center panel displays the properties of and the SQL command to create the converted schema, as shown following. 38

Clearing a Schema After you have converted your schema for the first time or created a database migration assessment report, you can save your project and the schema information from your source database will be saved with your project. This means that you can work offline without being connected to your source database. The AWS Schema Conversion Tool will still connect to your source database to update the schema in your project if you choose the Refresh from Database git checoption for your source database. For more information, see Updating and Refreshing Your Schema (p. 40). Clearing a Schema Until you apply the schema to your target DB instance, the AWS Schema Conversion Tool only stores the converted schema locally in your project. You can clear the planned schema from your project by choosing the tree-view node for your target DB instance, and then choosing the Refresh from Database button. Because no schema has been written to your target DB instance, refreshing from the database will remove the planned schema elements in your schema conversion tool project to match what exists in your target DB instance. 39

Updating and Refreshing Your Schema Updating and Refreshing Your Schema You can update the schema in your AWS Schema Conversion Tool project by choosing Refresh from Database, as shown following. 40

Saving and Applying Your Schema If you choose the Refresh from Database option for your source database, then the AWS Schema Conversion Tool replaces the schema in your project with the latest schema from your source database. This functionality enables you to update your project if changes have been made to the schema of your source database. If you choose the Refresh from Database option for your target RDS DB instance, then the AWS Schema Conversion Tool replaces the schema in your project with the latest schema from your target DB instance. If you have not applied any schema to your target DB instance, then the AWS Schema Conversion Tool clears the converted schema from your project. You can then convert the schema from your source database for a "clean" target DB instance. Saving and Applying Your Schema When the AWS Schema Conversion Tool generates converted schema (as shown in Converting Your Schema (p. 35)), it does not immediately apply converted schema to the target DB instance. Instead, converted schema are stored locally in your project until you are ready to apply them to the target DB instance. This functionality enables you to address schema items that cannot be automatically converted to your target DB engine. For more information on items that cannot be automatically converted, see Creating and Using the Assessment Report (p. 31). You can optionally have the tool save your converted schema to a file as a SQL script prior to applying the schema to your target DB instance. You can also have the tool apply the converted schema directly to your target DB instance. Saving Your Schema to a File You can save your converted schema as SQL scripts in a text file. By using this approach, you can modify the generated SQL scripts from the AWS Schema Conversion Tool to address items that the tool cannot 41

Applying Your Schema automatically convert. You can then run your updated scripts on your target DB instance to apply your converted schema to your target database. To save your converted schema as SQL scripts, open the context (right-click) menu for the schema element, and choose Save as SQL, as shown following. Applying Your Schema When you are ready to apply your converted schema to your target RDS DB instance, choose the schema element from the right panel of your project. Open the context (right-click) menu for the schema element, and choose Apply to database, as shown following. 42

Related Topics Important The first time that you apply your converted schema to your target DB instance, the AWS Schema Conversion Tool adds a schema to your target DB instance. This schema implements system functions of the source database that are required when writing your converted schema to your target DB instance. The schema is named AWS_ORACLE_EXT if your source database is Oracle and AWS_SQLSERVER_EXT if your source database is Microsoft SQL Server. Do not modify this schema, or you might encounter unexpected results in the converted schema that is written to your target DB instance. When your schema is fully migrated to your target DB instance, and you no longer need the AWS Schema Conversion Tool, you can delete the AWS_ORACLE_EXT or AWS_SQLSERVER_EXT schema. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) 43

Memory Management and Performance BestPractices with the AWS Schema Conversion Tool This topic includes information on best practices and options for using the AWS Schema Conversion Tool. Topics Memory Management and Performance (p. 44) Related Topics (p. 44) Memory Management and Performance You can configure the AWS Schema Conversion Tool with different memory performance settings. Increasing memory will speed up the performance of your conversion, but will use more memory resources on your desktop. To set your memory management option, go to Settings -> Global Settings and choose the Performance and Memory tab. Choose one of the following options: Fast conversion, but large memory consumption This option optimizes for speed of the conversion, but might require more memory for the object reference cache. Low memory consumption, but slower conversion This option minimizes the amount of memory used, but will result in a slower conversion. Use this option if your desktop has a limited amount of memory. Balance speed with memory consumption This option optimizes provides a balance between memory use and conversion speed. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) 44

Related Topics AWS Schema Conversion Tool Reference The following sections provide reference material for the AWS Schema Conversion Tool: Oracle to MySQL Supported Schema Conversion (p. 45) SQL Server to MySQL Supported Schema Conversion (p. 74) Keyboard Shortcuts (p. 95) Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) Oracle to MySQL Supported Schema Conversion The following sections list the schema elements from an Oracle database and whether they are supported for automatic conversion to MySQL using the AWS Schema Conversion Tool. Topics Statements (p. 46) Procedures (p. 50) Flow Control (p. 51) Packages (p. 51) Functions (p. 51) Operators (p. 61) Data Types (p. 65) Data Definition Language (DDL) (p. 67) Cursors (p. 70) Hints (p. 71) 45

Statements Exceptions (p. 73) Related Topics (p. 74) Statements Topics SELECT (p. 46) INSERT (p. 47) UPDATE (p. 48) DELETE (p. 49) MERGE (p. 50) TRUNCATE (p. 50) LOCK TABLE (p. 50) SELECT WITH AS SELECT DISTINCT UNIQUE ALL select_list BULK COLLECT INTO INTO record_name FROM @dblink materialized view TABLE (collection_expression) MODEL START WITH CONNECT BY PIVOT Use a stored procedure to prepare data, or rewrite your query to avoid the WITH clause. You can try to include all of the fields from your table in an INTO clause. MySQL doesn't support the MODEL statement. MySQL doesn't support hierarchical queries. Use a stored procedure to prepare data. MySQL doesn't support hierarchical queries. Use a stored procedure to prepare data. 46

Statements XML UNPIVOT WHERE GROUP BY CUBE GROUPING SETS HAVING ORDER BY SIBLINGS NULLS FIRST NULLS LAST FOR UPDATE OF NOWAIT WAIT SKIP LOCKED UNION INTERSECT MINUS] Use a stored procedure to prepare data. Use a stored procedure to prepare data. MySQL doesn't support NULLS FIRST and NULLS LAST. In MySQL NULL sorting, NULL values go first for an ascending order and last for a descending order. Try rewriting the ORDER BY clause with CASE. Try using FOR UPDATE instead of FOR UPDATE OF. MySQL doesn't support WAIT and NOWAIT clauses. Try using FOR UPDATE without NOWAIT. Try using FOR UPDATE without SKIP LOCKED. INSERT INTO table PARTITION PARTITION FOR SUBPARTITION VIEW MATERIALIZED VIEW Either insert data into the overlying partition, or perform a manual conversion using the INSERT statement. Target a table with the INSERT statement instead of a VIEW. If the target view has an INSTEAD OF trigger, parse and execute the INSTEAD OF trigger code. Perform a manual conversion. 47

Statements subquery WITH table_collection_expression column VALUES subquery RETURNING INTO LOG ERRORS Perform this operation on the underlying tables instead. To perform this operation, divide the INSERT statement with the RETURNING clause into an INSERT statement with following SELECT statements and use the same key conditions in each SELECT.You can also use the last value that was generated by AUTO_INCREMENT column in the key condition. You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished. UPDATE UPDATE [hint] table PARTITION PARTITION FOR SUBPARTITION VIEW MATERIALIZED VIEW subquery WITH table_collection_expression SET VALUE WHERE condition Either insert data into the overlying partition, or perform a manual transformation using the UPDATE statement. Perform an update on the underlying tables instead. Perform this operation on the underlying tables instead. 48

Statements RETURNING... INTO LOG ERRORS To perform this operation, divide the UPDATE statement with the RETURNING clause into an UPDATE statement with following INSERT statements that have the specified key conditions in the SELECT part. You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished. te MySQL doesn't support FILESTREAM DATA. Perform a manual conversion to update the data in the file system file. DELETE DELETE FROM PARTITION PARTITION FOR SUBPARTITION VIEW MATERIALIZED VIEW subquery WITH table_collection_expression WHERE condition RETURNING INTO LOG ERRORS Either insert data into the overlying partition, or perform a manual transformation using the DELETE statement. Perform a manual conversion. Perform a manual conversion. Perform this operation on the underlying tables instead. To perform this operation, divide the DELETE statement with the RETURNING clause into a DELETE statement with following INSERT statements and use the same key conditions in each SELECT. You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished. 49

Procedures MERGE Statement MERGE To achieve the effect of a MERGE statement, use separate INSERT, DELETE, and UPDATE statements. TRUNCATE TRUNCATE TABLE PRESERVE MATERIAL- IZED VIEW LOG PURGE MATERIALIZED VIEW LOG DROP STORAGE REUSE STORAGE LOCK TABLE PARTITION SUBPARTITION NOWAIT Procedures Item LOCK TABLE dbms_output.put_line dbms_output.put MySQL doesn't support the LOCK TABLE statement inside a stored procedure. Try using INSERT in the log table. To do this, you must add code into AWS_ORACLE_EXT.PUT_LINE. Try using INSERT in the log table. To do this, you must add code into AWS_ORACLE_EXT.PUT. 50

Flow Control Flow Control GOTO FORALL EXECUTE IMMEDIATE BULK COLLECT RETURNING BULK COL- LECT INTO LABEL Try using a WHILE DO statement. Try rewriting variables without using labels. Packages Item Initialization block, BEGIN END User type Global cursor Global user exception MySQL doesn't support EXCEPTION BLOCK in initialization blocks in packages. Try using CONTINUE HANDLER. Functions Topics Aggregate Functions (p. 52) Date and Time Functions (p. 53) Mathematical Functions (p. 55) Character (String) Functions (p. 56) Conversion Functions (p. 57) General Comparison Functions (p. 58) Encoding and Decoding Functions (p. 59) Email (p. 59) HTTP (p. 59) SMS (p. 59) NULL Functions (p. 59) User-defined Functions (p. 59) Large object Functions (p. 61) Hierarchical Functions (p. 61) 51

Functions Analytic Functions (p. 61) This sections lists the Microsoft SQL Server built-in functions and indicates whether AWS Schema Conversion Tool performs an automatic conversion. Where MySQL doesn't support a function, consider creating a user-defined function. Aggregate Functions Function AVG COLLECT CORR CORR_* COUNT COVAR_POP COVAR_SAMP CUME_DIST DENSE_RANK FIRST GROUP_ID GROUPING GROUPING_ID LAST MAX MEDIAN MIN PERCENTILE_CONT PERCENTILE_DISC PERCENT_RANK RANK REGR_ (Linear Regression) Functions STATS_BINOMIAL_TEST STATS_CROSSTAB STATS_F_TEST 52

Functions Function STATS_KS_TEST STATS_MODE STATS_MW_TEST STATS_ONE_WAY_AN- OVA STATS_T_TEST_* STATS_WSR_TEST STDDEV STDDEV_POP STDDEV_SAMP SUM TRUNC VAR_POP VAR_SAMP VARIANCE Converts to: TRUNCATE() Date and Time Functions Function ADD_MONTHS(date, num) CURRENT_DATE CURRENT_TIMESTAMP DBTIMEZONE EXTRACT(YEAR FROM date) EXTRACT(MONTH FROM date) EXTRACT(DAY FROM date) EXTRACT(HOUR FROM time) EXTRACT(MINUTE FROM time) Converts to: TIMESTAMPADD(MONTH, num, date) Converts to: NOW() Converts to: NOW() Converts to: YEAR(date) Converts to: MONTH(date) Converts to: DAY(date) Converts to: HOUR(time) Converts to: MINUTE(time) 53

Functions Function EXTRACT(SECOND FROM time) FROM_TZ LAST_DAY(date) LOCALTIMESTAMP LOCALTIMESTAMP(prec) MONTHS_BETWEEN(date1, date2) NEW_TIME NEXT_DAY NUMTODSINTERVAL NUMTOYMINTERVAL ROUND (date) SESSIONTIMEZONE SYS_EXTRACT_UTC SYSDATE SYSTIMESTAMP TO_CHAR (datetime, format) TO_TIMESTAMP(exp) TO_TIMESTAMP_TZ TO_DSINTERVAL TO_YMINTERVAL TRUNC (datetime) TZ_OFFSET Converts to: SECOND(time) The maximum precision for the MySQL LOCALTIMESTAMP function is 6. If you need greater precision, create a userdefined function. Converts to: SYSDATE() Converts to: CURRENT_TIMESTAMP Converts to: DATE_FORMAT() te that the TO_CHAR and DATE_FORMAT format strings are different. Converts to: DATE(datetime) 54

Functions Mathematical Functions Function ABS(num) ACOS(num) ASIN(num) ATAN(num) ATAN2(x,y) BITAND(exp1, exp2) CEIL(num) COS(num) COSH(num) EXP(n) FLOOR(num) LN(num) LOG(num1, num2) MOD(dividend, divisor) NANVL(n2, n1) POWER(value, n) REMAINDER(n1, n2) ROUND (num, integer) SIGN(exp) SIN(num) SINH(num) SQRT(num) TAN(num) TANH(num) TRUNC (number) TRUNC(num, num2) VALUE(variable) WIDTH_BUCKET Converts to: (exp1 & exp2) Converts to: (EXP(num) + EXP(-num)) / 2 Converts to: (n1 - n2*round(n1/n2)) Converts to: TRUNCATE(num, 0) 55

Functions Character (String) Functions Function ASCII(str) CHR(num) CONCAT(char1, char2) INITCAP(string) INSTR(str, substr) INSTR(str, substr, pos) INSTR(str, substr, pos, num) LENGTH(string) LOWER(string) LPAD(string, len) LPAD(string, len, pad) LTRIM(string) LTRIM(string, set) NLS_INITCAP NLS_LOWER NLS_UPPER NLSSORT REGEXP_INSTR REGEXP_REPLACE REGEXP_SUBSTR REPLACE(str, search) REPLACE(str, search, replace) RPAD(string, len) RPAD(string, len, pad) RTRIM(string) RTRIM(string, set) Converts to: CHAR(num USING ASCII) Converts to: LOCATE (substr, str, pos) This is the same as the two-argument form of INSTR(), except that the order of the arguments is reversed. Converts to: LENGTH (string) Converts to: LPAD(string, len, ' ') Converts to: TRIM(LEADING set FROM string) Converts to: REPLACE(str, search, '') Converts to: RPAD(string, len, ' ') Converts to: TRIM(TRAILING set FROM string) 56

Functions Function SOUNDEX(string) SUBSTR(string, pos, len) TRANSLATE(string, from, to) TREAT TRIM([type trim FROM] string) UPPER(string) Conversion Functions Function ASCIISTR(string) BIN_TO_NUM(bit1, bit2, ) CAST CHARTOROWID COMPOSE CONVERT(string, charset) DECOMPOSE HEXTORAW NUMTODSINTERVAL NUMTOYMINTERVAL RAWTOHEX RAWTONHEX ROWIDTOCHAR ROWIDTONCHAR SCN_TO_TIMESTAMP TIMESTAMP_TO_SCN TO_BINARY_DOUBLE TO_BINARY_FLOAT TO_CHAR (character) Converts to: CONVERT(string USING charset) 57

Functions Function TO_CHAR (datetime, format) TO_CHAR (number, format) TO_CLOB TO_DATE TO_DSINTERVAL TO_LOB TO_MULTI_BYTE TO_NCHAR (character) TO_NCHAR (datetime) TO_NCHAR (number) TO_NCLOB TO_NUMBER TO_DSINTERVAL TO_SINGLE_BYTE TO_TIMESTAMP TO_TIMESTAMP_TZ TO_YMINTERVAL TRANSLATE... USING UNISTR Converts to: DATE_FORMAT(datetime, format) te that the TO_CHAR and DATE_FORMAT format strings are different. Converts to: FORMAT(number, decimal_digits) In MySQL, you can use FORMAT function as well as other string functions and expressions. Converts to: STR_TO_DATE(string, format) te that the TO_DATE and STR_TO_DATE format strings are different. Converts to: CHAR(string USING UCS2) General Comparison Functions Function GREATEST(exp, exp2, ) LEAST(exp, exp2, ) 58

Functions Encoding and Decoding Functions Function DECODE(exp, when, then,...) DUMP ORA_HASH VSIZE Converts to: CASE expression Email MySQL doesn t support sending e-mail. To send email, use Amazon Simple Email Service (Amazon SES). HTTP MySQL doesn't support sending messages to HTTP endpoints. To send messages to HTTP and HTTPS endpoints, you can use the Amazon Simple tification Service (Amazon SNS). SMS MySQL doesn't support sending notifications by using SMS. To send and receive SMS notifications, you can use the Amazon Simple tification Service (Amazon SNS). NULL Functions Function COALESCE(exp1, exp2, ) LNNVL NULLIF(exp1, exp2) NVL(exp, replacement) NVL2(exp1, exp2, exp3) Converts to: NULLIF(exp1, exp2) Converts to: IFNULL(exp, replacement) Converts to: CASE expression User-defined Functions Return In MySQL, you can use statements that return a result set within a stored procedure but not within a stored function. 59

Functions Statement RETURN resultset RETURN record-type TYPE.. IS TABLE OF.. INDEX BY TYPE.. IS TABLE OF TYPE.. IS VARRAY(..) OF RETURN.. PIPELINED TYPE... IS REF CURSOR object-type Try changing the function to a stored procedure and use a table to store the results. Try changing the function to a stored procedure and change record-type items to separate parameters. Try changing the function to a stored procedure and use a table to store the results. Try changing the function to a stored procedure and use a table to store the results. Try changing the function to a stored procedure and use a table to store the results. Try changing the function to a stored procedure and use a table to store the results. Try changing the function to a stored procedure and use a table to store the results. Collections Item TYPE.. IS TABLE OF := collection_type(...) MySQL doesn't support table type variables. Try using a table. MySQL doesn't support table type collection methods. Try using a table. MySQL doesn't support the constructor for the collection type. Try using a table. Arguments Item UDT record-type UDT collection-type UDT object-type collection_name.first, collection_name.last, collection_name.count, collection_name.next 60

Operators Large object Functions Function BFILENAME EMPTY_BLOB EMPTY_CLOB Converts to an empty string. Converts to an empty string. Hierarchical Functions Function SYS_CON- NECT_BY_PATH Try creating a user-defined function. Analytic Functions MySQL doesn't support analytic functions. Try creating a user-defined function. Operators Topics Arithmetic Operators (p. 61) Assignment Operator (p. 62) Comparison Operators (p. 62) Logical Operators (p. 62) String Concatenation Operator (p. 63) Date and time format specifiers (p. 63) Arithmetic Operators + - + - * / MySQL handles date and time arithmetic differently. Verify that the converted schema is accurate. 61

Operators Assignment Operator = Comparison Operators > < >= <= <>!=!<!> Logical Operators IN NOT IN ANY SOME ALL BETWEEN x EXISTS LIKE IS NULL NOT AND 62

Operators OR String Concatenation Operator Date and time format specifiers YEAR YYYY YYY YY Y IYY IY I IYYY RRRR Q MM MON MONTH RM WW W IW D Default Conversion %Y %y %y %Y %m %b %M %V %V %w 63

Operators Day of the week (1=Sunday, 7=Saturday) DAY DD DDD DY J HH HH12 HH24 MI SS SSSSS FF AM, PM A.M., P.M. AD or A.D BC or B.C. TZD TZH TZM TZR Default Conversion Day of the week (0=Sunday, 6=Saturday) %W %e %j %a %h %h %H %i %S %p 64

Data Types Data Types Data type Default Conversion BFILE VARCHAR(255) Contains the file path to the BFILE. MySQL does not support the BFILE. Because BFILE data is made up of the path to a file, you can either store a filename and create a routine that gets the file from the file system, or store the file contents as a LONGBLOB. BINARY_FLOAT FLOAT BINARY_DOUBLE DOUBLE BLOB LONGBLOB CHAR TEXT CHAR(n), CHARACTER(n) CHAR(n), CHARACTER(n) CHAR(n), CHARACTER(n) VARCHAR(n) CLOB LONGTEXT DATE DATETIME DECIMAL, DEC DOUBLE DECIMAL(p,s), DEC(p,s) DECIMAL(p,s), DEC(p,s) DOUBLE PRECISION DOUBLE PRECISION FLOAT DOUBLE FLOAT(p) DOUBLE INTEGER, INT DECIMAL(38) INTERVAL YEAR TO MONTH DOUBLE INTERVAL YEAR(p) TO MONTH VARCHAR(30) INTERVAL DAY TO SECOND VARCHAR(30) INTERVAL DAY(p) TO SECOND(s) VARCHAR(30) LONG LONGTEXT LONG RAW LONGBLOB NCHAR TEXT 65

Data Types Data type Default Conversion NCHAR(n) NCHAR(n) NCHAR(n) NVARCHAR(n) NCHAR VARYING TEXT NCHAR VARYING(n) NCHAR VARYING(n) NCLOB LONGTEXT NUMBER(p,0), NUM- BER(p) DECIMAL(p,0), DECIM- AL(p) NUMBER(p,s) DECIMAL(p,s) NUMBER, NUMBER(*),NU- MERIC DOUBLE NUMERIC(p,s) NUMERIC(p,s) NVARCHAR2 TEXT NVARCHAR2(n) NVARCHAR(n) RAW VARBINARY(2000) RAW(n) BINARY(n) RAW(n) VARBINARY(n) REAL DOUBLE ROWID CHAR(10) SMALLINT DECIMAL(38) TIMESTAMP DATETIME TIMESTAMP(p) DATETIME(p) TIMESTAMP(p) MySQL expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision. TIMESTAMP(p) WITH TIME ZONE DATETIME There is no a data type in MySQL that can store time zone information. DATE- TIME data type stores timestamps in the MySQL server time zone. UROWID TEXT UROWID(n) VARCHAR(n) VARCHAR TEXT 66

Data Definition Language (DDL) Data type Default Conversion VARCHAR(n) VARCHAR(n) VARCHAR2 TEXT VARCHAR2(n) VARCHAR(n) XMLTYPE LONGTEXT Data Definition Language (DDL) Topics CREATE TABLE (p. 67) CREATE INDEX (p. 68) CREATE TRIGGER (p. 68) CREATE VIEW (p. 69) CREATE CONSTRAINT (p. 70) CREATE SEQUENCE (p. 70) CREATE TABLE CREATE TABLE statements are converted automatically except for the following: OBJECT TABLE CLUSTERED TABLE EXTERNAL TABLE GLOBAL TEMPORARY TABLE Partitioned tables Virtual columns Functions as default values NESTED TABLE columns converted MySQL doesn't support OBJECT TABLE. Revise your code to avoid OBJECT TABLE. MySQL doesn't support CLUSTERED TABLE. Try using a table with triggers. MySQL doesn't support EXTERNAL TABLE. Try using a table. MySQL doesn't support GLOBAL TEMPORARY TABLE. Try using a temporary table. MySQL doesn't support all partition types. Perform a manual conversion for the partition types that aren't supported. MySQL doesn't support virtual columns. Represent virtual columns using a view. MySQL doesn't support functions as default values. Try using a trigger. MySQL doesn't support tables with NESTED TABLE columns. Revise any tables with NESTED TABLE columns to avoid these columns. 67

Data Definition Language (DDL) COLUMN(TABLE) converted MySQL doesn't support the objects column. Create a userdefined function. CREATE INDEX CREATE INDEX statements are converted automatically except that MySQL does not support bitmap, function-based, or domain indexes. CREATE TRIGGER CREATE TRIGGER statements are converted automatically except for the following: COMPOUND INSTEAD OF INSERTING UPDATING DELETING without FOR EACH ROW FOLLOWS PRECEDES UPDATE OF REFERENCING NEW AS OLD AS WHEN(condition) ON NESTED TABLE trigger-status=disabled create-date modify-date status converted MySQL doesn't support compound triggers. Create a single trigger for each part of the compound trigger. MySQL doesn't support INSTEAD OF. Try using a BEFORE trigger. MySQL doesn t support conditional predicates. MySQL doesn't support statement triggers. Try including FOR EACH ROW. MySQL doesn't support the FOLLOWS PRECEDES clause. Try using a FOR EACH ROW trigger. MySQL doesn't support the UPDATE OF clause. Try using a FOR EACH ROW trigger. MySQL doesn't support the REFERENCING clauses. Modify references to pseudorows to use OLD and NEW instead. MySQL doesn't support WHEN(condition) triggers. Apply the condition for WHEN in the trigger body. MySQL doesn't support the DISABLED clause. Drop the trigger instead. MySQL doesn't support create-date for triggers. Try using a FOR EACH ROW trigger. MySQL doesn't support modify-date for triggers. Try using a FOR EACH ROW trigger. MySQL doesn't support trigger status values. Try using a FOR EACH ROW trigger. 68

Data Definition Language (DDL) description converted MySQL doesn't support descriptions for triggers. In MySQL, you can get a trigger description using INFORM- ATION_SCHEMA.TRIGGERS. MySQL doesn't support the REFERENCING clause. The following are the corresponding values between Oracle(USER_TRIGGERS) and MySQL(INFORMATION_SCHEMA.TRIGGERS): TABLE_OWNER -> TRIGGER_SCHEMA TRIGGER_NAME -> TRIGGER_NAME TRIGGER_TYPE -> ACTION_TIMING TRIGGERING_EVENT -> EVENT_MANIPULATION TABLE_NAME -> EVENT_OBJECT_TABLE REFERENCING_NAMES -> ACTION_REFER- ENCE_NEW_ROW(always is NEW), ACTION_REFER- ENCE_OLD_ROW(always is OLD) triggering-event=ddl_events base-object-type=view base-object-type=schema triggering-event=database_events base-object-type=data- BASE action-type=call or PL/SQL crossedition=for- WARD/REVERSE fire-once=yes apply-server-only=yes referencing-names=par- ENT CREATE VIEW CREATE VIEW statements are converted automatically except for the following: FORCE converted 69

Cursors NOFORCE WITH READ ONLY create-date modify-date status oid-text view-type-owner view-type superview-name editioning-view encrypted-view CAST NOFORCE is the default behavior for MySQL. You don't need to specify this option. MySQL doesn t support views with nested table columns. CREATE CONSTRAINT CREATE CONSTRAINT statements are converted automatically except for the following: DISABLE, status=dis- ABLED Foreign keys of different types constraint-type converted converted My SQL doesn't support constraints with the status DIS- ABLE. Drop the constraint. MySQL doesn't support foreign keys with different types of columns and referenced columns. Modify the column types using an equivalent of the column data types in the original database. MySQL doesn't support the constraint check option on a view. Try using a trigger. CREATE SEQUENCE MySQL doesn't support sequences. Try developing a system for sequences in your application. Cursors Cursors are converted automatically except for the following: 70

Hints SQLAttribute REF CURSOR SYS_REFCURSOR CURSOR REF_CURSOR variable MySQL doesn't support the cursor attribute SQL%ISOPEN MySQL doesn't support the cursor attribute SQL%BULK_ROWCOUNT. To calculate processed rows, use a variable. MySQL doesn't support the REF CURSOR object. Perform a manual conversion. MySQL doesn't support a variable of SYS_REFCURSOR type. Perform a manual conversion. The AWS Schema Conversion Tool cannot automatically transform the SELECT statement for an implicit cursor. Try rewriting the SELECT statement. The SELECT statement for the REF_CURSOR variable cannot be transformed.try rewriting the SELECT statement. Hints MySQL doesn't support hints. Try using MySQL performance tuning methods or perform a manual conversion. /*+ ALL_ROWS */ /*+ AND_EQUAL(table index...) */ /*+ APPEND */ /*+ CACHE(table) */ /*+ CHOOSE */ /*+ CLUSTER(table) */ /*+ CURSOR_SHAR- ING_EXACT */ /*+ DRIVING_SITE(table) */ /*+ DYNAMIC_SAMPLING */ /*+ EX- PAND_GSET_TO_UNION */ /*+ FACT(table) */ converted converted 71

Hints /*+ FIRST_ROWS(n) */ /*+ FULL(table) */ /*+ HASH */ /*+ HASH_SJ */ /*+ INDEX(table index) */ /*+ INDEX_ASC(table index) */ /*+ INDEX_COMBINE(table index) */ /*+ INDEX_DESC(table index) */ /*+ INDEX_FFS(table index) */ /*+ LEADING(table) */ /*+ MERGE(table) */ /*+ MERGE_SJ */ /*+ NL_SJ */ /*+ NO_EXPAND */ /*+ NO_INDEX(table index) */ /*+ NO_MERGE(table) */ /*+ NO_PARALLEL(table) */ /*+ NO_PARALLEL_IN- DEX(table index) */ /*+ NO_PUSH_PRED(subquery) */ /*+ NO_PUSH_SUBQ(subquery) */ /*+ NO_REWRITE */ /*+ NO_UNNEST */ /*+ NOAPPEND */ /*+ NOCACHE(table) */ /*+ NOFACT(table) */ converted 72

Exceptions /*+ ORDERED */ /*+ ORDERED_PREDIC- ATES */ /*+ PARALLEL(table server_num) */ /*+ PARALLEL_IN- DEX(table index server_num) */ /*+ PQ_DISTRIBUTE(table out_distr in_distr) */ /*+ PUSH_PRED(subquery) */ /*+ PUSH_SUBQ(subquery) */ /*+ REWRITE */ /*+ ROWID(table) */ /*+ RULE */ /*+ STAR */ /*+ STAR_TRANSFORMA- TION */ /*+ UNNEST */ /*+ USE_CONCAT */ /*+ USE_HASH(table1 table2) */ /*+ USE_MERGE(table1 table2) */ converted Exceptions Item RAISE %s converted MySQL doesn't support the RAISE command. Review the exception, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement. MySQL doesn't support the %s exception. Review the exception, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement. 73

Related Topics Item EXCEPTION PRAGMA EXCEP- TION_INIT PROC_RAISE_APPLICA- TION_ERROR converted MySQL doesn't support the EXCEPTION declaration. Use the DECLARE... CONDITION statement. MySQL doesn't support the PRAGMA EXCEPTION_INIT declaration. Use the DECLARE... CONDITION statement. MySQL doesn't support the PROC_RAISE_APPLICA- TION_ERROR statement. Use the DECLARE... CONDI- TION statement. Try using the SIGNAL or RESIGNAL statement. Built-in exceptions Exception INVALID_NUMBER converted TIMEOUT_ON_RE- SOURCE TRANSAC- TION_BACKED_OUT INVALID_CURSOR NOT_LOGGED_ON LOGIN_DENIED STORAGE_ERROR PROGRAM_ERROR Try creating a user exception. Try creating a user exception. Try creating a user exception. You can use one of several handlers for invalid cursors. Choose the correct handler based on the issue. Try creating a user exception. Try creating a user exception. You can use one of several handlers for invalid cursors. Choose the correct handler based on the issue. Try using the handler "1815 - Internal Error." Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) SQL Server to MySQL Supported Schema Conversion The following sections list the schema elements from Microsoft SQL Server and whether they are supported for automatic conversion to MySQL using the AWS Schema Conversion Tool. 74

Statements Topics Statements (p. 75) Procedures (p. 78) Flow Control (p. 79) Functions (p. 79) Operators (p. 87) Transactions (p. 90) Data Types (p. 91) Data Definition Language (DDL) (p. 93) Cursors (p. 94) Related Topics (p. 95) Statements Topics SELECT (p. 75) INSERT (p. 76) UPDATE (p. 77) DELETE (p. 77) SELECT WITH UNION EXCEPT INTERSECT ALL DISTINCT TOP <select_list> INTO FROM WHERE GROUP BY HAVING Try converting the WITH(query) expression to a subquery and use it in a SELECT query. MySQL doesn't support TOP with the PERCENT or WITH TIES options. Try using the LIMIT option or perform a manual conversion. MySQL doesn't support the CONTAINS and FREETEXT predicates in the FROM clause search condition. MySQL doesn't support ORDER BY with the ROLLUP, CUBE, and GROUPING SETS options.try creating a stored procedure to replace the query. 75

Statements ORDER BY FOR OPTION MySQL doesn't support ORDER BY with the OFFSET or FETCH options. Try creating a stored procedure to replace the query. MySQL doesn't support ORDER BY with the COLLATE option. You must use the collation settings that were assigned when the database was created. INSERT WITH INSERT TOP INTO table_name WITH (<Table_Hint_Limited>) OUTPUT VALUES derived_table execute_statement <dml_table_source> DEFAULT VALUES Try to convert the WITH query to a subquery, and then use the subquery in the INSERT query. Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows / 100 Use MySQL methods of performance tuning. Create a trigger for INSERT statements for the table, and then save the inserted rows in a temporary table. After the INSERT operation, you can make use of the rows saved in the temporary table. This logic can be placed in a stored procedure. Create a temporary table, fill it with the data to insert, and use the temporary table in the query. 76

Statements UPDATE WITH TOP SET OUTPUT FROM WHERE CURRENT OF GLOBAL OPTION Try to convert the WITH query to a subquery, and then use the subquery in the UPDATE query. MySQL doesn't support UPDATE with the PERCENT option. Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows / 100 Use MySQL methods of performance tuning. Create a trigger for UPDATE statements for the table, and then save the changed rows in a temporary table. After the UPDATE operation, you can make use of the rows saved in the temporary table. This logic can be placed in a stored procedure. MySQL doesn't support a FROM clause. AWS Schema Conversion Tool moves <table-source> to the UPDATE clause. Replace the CURRENT OF clause with an expression that consists of conditions that use unique key fields of the table. te MySQL doesn't support FILESTREAM DATA. Perform a manual conversion to update the data in the file system file. DELETE WITH TOP FROM WITH (<Table_Hint_Limited>) Try to convert the WITH query to a subquery, and then use the subquery in the DELETE query. MySQL doesn't support the PERCENT option. A manual conversion is required. Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows / 100 77

Procedures table_or_view_name rowset_function_limited WITH OUTPUT WHERE CURRENT OF GLOBAL OPTION MySQL doesn't support hints in DELETE statements, so the AWS Schema Conversion Tool skips options in the format WITH(Table_Hint_Limited). Use MySQL methods of performance tuning. Create a trigger for DELETE statements for the table, and then save the deleted rows in a temporary table. After the DELETE operation, you can make use of the rows saved in the temporary table. This logic can be placed in a stored procedure. Replace the CURRENT OF clause with an expression that consists of conditions that use unique key fields of the table. Procedures Topics CREATE PROCEDURE (p. 78) CREATE PROCEDURE @parameter VARYING OUT OUTPUT READONLY WITH FOR REPLICATION AS BEGIN END MySQL doesn't support procedure arguments of the CURSOR data type. Change the business logic to eliminate the need to send cursors through arguments to a stored procedure. 78

Flow Control ENCRYPTION RECOMPILE EXECUTE AS Flow Control TRY CATCH THROW WAITFOR DECLARE GOTO BREAK CONTINUE IF ELSE RETURN WHILE CASE COALESCE NULLIF Try using the DECLARE HANDLER for the CATCH emulation block and the SIGNAL SQLSTATE operator to emulate the THROW operator. Perform a manual conversion. Perform a manual conversion. Revise your code to eliminate GOTO operators, using BE- GIN...END blocks in combination with LEAVE, REPEAT, UNTIL, and WHILE operators. MySQL does not support returning a value from a procedure using the RETURN statement. To return a value, use the OUT parameter or a result set. Functions Topics Aggregate Functions (p. 80) Date and Time Functions (p. 80) Mathematical Functions (p. 81) String Functions (p. 82) Configuration Functions (p. 83) Conversion Functions (p. 84) 79

Functions Security Functions (p. 84) System Functions (p. 85) Logical Functions (p. 86) CREATE FUNCTION (p. 86) EXECUTE (p. 87) This sections lists the Microsoft SQL Server built-in functions and indicates whether AWS Schema Conversion Tool performs an automatic conversion. Where MySQL doesn't support a function, consider creating a user-defined function. Aggregate Functions Function AVG COUNT COUNT_BIG MIN MAX SUM CHECKSUM_AGG STDEV STDEVP GROUPING GROUPING_ID VAR VARP MySQL doesn't support the STDEV function with the DIS- TINCT clause. MySQL doesn't support the STDEVP function with the DISTINCT clause. MySQL doesn't support the VAR function with the DISTINCT clause. MySQL doesn't support the VARP function with the DIS- TINCT clause. Date and Time Functions Function DATEADD DATEDIFF MySQL doesn't support the DATEADD function with the nanosecond datepart. MySQL doesn't support the DATEDIFF function with the week, millisecond, or nanosecond datepart. 80

Functions Function DATENAME DATEPART DAY GETDATE GETDATE + 1 GETUTCDATE MONTH YEAR DATETIMEOFFSET- FROMPARTS ISDATE SWITCHOFFSET SYSDATETIMEOFFSET TODATETIMEOFFSET MySQL doesn't support the DATENAME function with the millisecond, nanosecond, or TZoffset datepart. MySQL doesn't support the DATEPART function with the millisecond, nanosecond, or TZoffset datepart. Mathematical Functions Function ABS ACOS ASIN ATN2 ATAN CEILING COS COT DEGREES EXP FLOOR 81

Functions Function LOG10 LOG PI POWER RADIANS RAND ROUND SIGN SIN SQRT SQUARE TAN MySQL doesn't support the ROUND function with the function argument. String Functions Function ASCII CHAR CHARINDEX CONCAT DIFFERENCE FORMAT LEFT LEN LOWER LTRIM NCHAR PATINDEX QUOTENAME 82

Functions Function REPLACE REPLICATE REVERSE RIGHT RTRIM SOUNDEX SPACE STR STUFF SUBSTRING UNICODE UPPER Configuration Functions Function @@DATEFIRST @@DBTS @@LANGID @@LANGUAGE @@LOCK_TIMEOUT @@MAX_CONNECTIONS @@MAX_PRECISION @@NESTLEVEL @@OPTIONS @@REMSERVER @@SERVERNAME @@SERVICENAME @@SPID @@TEXTSIZE 83

Functions Function @@VERSION Conversion Functions Function CAST and CONVERT PARSE TRY_CAST TRY_CONVERT TRY_PARSE Security Functions Function CERTENCODED CERTPRIVATEKEY CURRENT_USER DATABASE_PRINCIP- AL_ID HAS_PERMS_BY_NAME IS_MEMBER IS_ROLEMEMBER IS_SRVROLEMEMBER ORIGINAL_LOGIN PERMISSIONS PWDCOMPARE PWDENCRYPT SCHEMA_ID SCHEMA_NAME SESSION_USER 84

Functions Function SUSER_ID SUSER_NAME SUSER_SID SUSER_SNAME sys.fn_builtin_permissions sys.fn_get_audit_file sys.fn_my_permissions SYSTEM_USER USER_ID USER_NAME System Functions Function $PARTITION @@ERROR @@IDENTITY @@PACK_RECEIVED @@ROWCOUNT @@TRANCOUNT BINARY_CHECKSUM CHECKSUM CONNECTIONPROPERTY CONTEXT_INFO CURRENT_REQUEST_ID ERROR_LINE ERROR_MESSAGE ERROR_NUMBER ERROR_PROCEDURE ERROR_SEVERITY 85

Functions Function ERROR_STATE FORMATMESSAGE GET_FILESTREAM_TRANS- ACTION_CONTEXT GETANSINULL HOST_ID HOST_NAME ISNULL MIN_ACTIVE_ROWVER- SION NEWID NEWSEQUENTIALID PARSENAME ROWCOUNT_BIG XACT_STATE Logical Functions Function CHOOSE IIF CREATE FUNCTION @parameter_name type_schema_name parameter_data_type = default READONLY 86

Operators RETURNS return_data_type WITH function_option BEGIN END MySQL supports only functions that return a scalar value. EXECUTE @parameter_name type_schema_name parameter_data_type = default READONLY RETURNS return_data_type WITH function_option BEGIN END RETURN scalar_expression RETURN scalar_expression MySQL supports only functions that return a scalar value. Operators Topics Arithmetic Operators (p. 88) Assignment Operator (p. 88) Bitwise Operators (p. 88) Comparison Operators (p. 88) Logical Operators (p. 89) Set Operators (p. 89) String Concatenation Operator (p. 90) Unary Operators (p. 90) 87

Operators Arithmetic Operators + += - -= * *= / /= % Assignment Operator = Bitwise Operators & ^ ~ Comparison Operators = > 88

Operators < >= <= <>!=!<!> Logical Operators ALL AND ANY BETWEEN EXISTS IN LIKE NOT OR SOME The AWS Schema Conversion Tool converts SOME to ANY. Set Operators UNION UNION ALL EXCEPT INTERSECT Perform a manual conversion. Perform a manual conversion. 89

Transactions String Concatenation Operator + Unary Operators + - Transactions Topics BEGIN TRANSACTION (p. 90) BEGIN TRANSACTION DISTRIBUTED transaction_name WITH MARK SAVE ROLLBACK transaction_name savepoint_name COMMIT DELAYED_DURABILITY MySQL doesn't support distributed transactions. Revise your architecture so that it doesn't use distributed transactions. MySQL doesn't support named transactions. Revise your code to eliminate marked transactions. MySQL doesn't support the WITH MARK option. Revise your code to eliminate marked transactions. MySQL doesn't support named transactions. Revise your code to eliminate named transactions. 90

Data Types Data Types Topics Numerics (p. 91) Date and Time (p. 91) Character Strings (p. 92) Binary Strings (p. 92) Special Types (p. 93) Numerics Data type Default Conversion bigint bigint int int smallint smallint tinyint tinyint unsigned bit bit(1) money numeric(19,4) smallmoney numeric(10,4) numeric numeric decimal decimal float double real float Date and Time Data type Default Conversion date date 0001-01-01 through 9999-12-31 datetime2(7) datetime 0001-01-01 through 9999-12-31 00:00:00 through 23:59:59.9999999 datetime datetime 1753-01-01, through 9999-12-31 00:00:00 through 23:59:59.997 datetimeoffset(7) 91

Data Types Data type Default Conversion smalldatetime datetime time(7) time Character Strings Data type Default Conversion char(len) char len= 1-255 (2^8-1) symbols (loss range) varchar(len) varchar varchar(max) longtext text longtext nchar(len) len = 1-4000 char len= 1-255 (2^8-1) symbols (loss range) nvarchar(len) varchar nvarchar(max) longtext ntext longtext Binary Strings Data type Default Conversion binary(len) blob varbinary(len) blob varbinary(max) longblob hierarchyid sql_variant table uniqueidentifier xml geography geometry 92

Data Definition Language (DDL) Special Types Data type Default Conversion UNIQUEIDENTIFIER CHAR(38) OR BINARY(16) DOUBLE PRECISION FLOAT(53) IDENTITY AUTO_INCREMENT SYSNAME NVARCHAR(128) NOT NULL Data Definition Language (DDL) Topics CREATE TABLE (p. 93) CREATE INDEX (p. 93) CREATE TRIGGER (p. 93) CREATE VIEW (p. 94) CREATE TABLE CREATE TABLE statements are converted automatically except for the following clause: SET DEFAULT MySQL doesn't support the SET DEFAULT option for FOREIGN KEY. CREATE INDEX The AWS Schema Conversion Tool does not support automatic migration of data definition language (DDL) code to create an index. CREATE TRIGGER CREATE TRIGGER statements are converted automatically except for the following clause: FOR MySQL doesn't support a FOR clause in a CREATE TRIGGER statement. 93

Cursors CREATE VIEW CREATE VIEW statements are converted automatically except for the following clauses: SCHEMABINDING ENCRYPTION VIEW_METADATA AWS Schema Conversion Tool ignores this clause. AWS Schema Conversion Tool ignores this clause. AWS Schema Conversion Tool ignores this clause. Cursors Topics DECLARE CURSOR (p. 94) DECLARE CURSOR LOCAL GLOBAL FORWARD_ONLY SCROLL STATIC KEYSET DYNAMIC FAST_FORWARD READ_ONLY Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors. Setting this option corresponds to the typical behavior of cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion. Revise your code to eliminate cursors with the SCROLL option. The membership and order of rows never changes for cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion. Verify that the converted schema behavior is acceptable. Revise your code to eliminate dynamic cursors. Setting this option corresponds to the typical behavior of cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion. All MySQL cursors are read-only, so the AWS Schema Conversion Tool skips this option during conversion. MySQL doesn't support the option SCROLL_LOCKS, so the AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable. 94

Related Topics SCROLL_LOCKS OPTIMISTIC TYPE_WARNING MySQL doesn't support the option OPTIMISTIC, so the AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable. MySQL doesn't support the option TYPE_WARNING, so the AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable. Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) Keyboard Shortcuts The following table lists the keyboard shortcuts for the AWS Schema Conversion Tool. Keyboard Shortcut Ctrl+N Ctrl+L Ctrl+R Description Create a new project Connect to the source database. Connect to the target Amazon RDS DB instance. Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) Installing and Updating the AWS Schema Conversion Tool (p. 5) 95

Cannot load objects from Oracle source database Troubleshooting Issues with the AWS Schema Conversion Tool Cannot load objects from Oracle source database When you attempt to load schema from an Oracle database, you may encounter one of the following errors: Cannot load objects tree. ORA-00942: table or view does not exist This error occurs because the user id that you used to connect to the Oracle database does not have sufficient permissions to read the schema required by the AWS Schema Conversion Tool. You can resolve the issue by granting the user id select_catalog_role permission as well as permission to any dictionary in the database. These permissions provide read-only access to the views and system tables required by the AWS Schema Conversion Tool. The following example creates a user id named min_privs and grants that user id the minimum permissions required to convert schema from an Oracle source database. create user min_privs identified by min_privs; grant connect to min_privs; grant select_catalog_role to min_privs; grant select any dictionary to min_privs; Related Topics What Is the AWS Schema Conversion Tool? (p. 1) Getting Started with the AWS Schema Conversion Tool (p. 10) 96

Related Topics Installing and Updating the AWS Schema Conversion Tool (p. 5) 97

Document History The following table describes the important changes to the documentation since the last release of the AWS Schema Conversion Tool User Guide. Version: 1.0.200 Latest documentation update: January 14, 2015 Change Maintenance release Maintenance release Maintenance release Preview release Description Add support for PostgreSQL as a target database engine. Add the ability to generate converted schema as scripts and save the scripts to files prior to applying the schema to the target DB instance. Add offline project capability, check for new versions, and memory and performance management. Add the Create New Database Migration Project wizard. Add the ability to save the database migration assessment report as a PDF file. Released the user guide for the AWS Schema Conversion Tool preview release. Date Changed January 14, 2016 December 2, 2015 October 19, 2015 October 7, 2015 98