Migrating from Oracle Database to Amazon RDS for Oracle with AWS Schema Conversion Tool
Some things to consider when migrating Oracle schema and code to Amazon RDS for Oracle:
-
AWS SCT can add directory objects to the object tree. Directory objects are logical structures that each represent a physical directory on the server's file system. You can use directory objects with packages such as DBMS_LOB, UTL_FILE, DBMS_FILE_TRANSFER, the DATAPUMP utility, and so on.
-
AWS SCT supports converting Oracle tablespaces to an Amazon RDS for Oracle DB instance. Oracle stores data logically in tablespaces and physically in data files associated with the corresponding tablespace. In Oracle, you can create a tablespace with data file names. Amazon RDS supports Oracle Managed Files (OMF) for data files, log files, and control files only. AWS SCT creates the needed data files during conversion.
-
AWS SCT can convert server-level roles and privileges. The Oracle database engine uses role-based security. A role is a collection of privileges that you can grant to or revoke from a user. A predefined role in Amazon RDS, called DBA, normally allows all administrative privileges on an Oracle database engine. The following privileges are not available for the DBA role on an Amazon RDS DB instance using the Oracle engine:
-
Alter database
-
Alter system
-
Create any directory
-
Grant any privilege
-
Grant any role
-
Create external job
You can grant all other privileges to an Amazon RDS for Oracle user role, including advanced filtering and column privileges.
-
-
AWS SCT supports converting Oracle jobs into jobs that can run on Amazon RDS for Oracle. There are a few limitations to the conversion, including the following:
-
Executable jobs are not supported.
-
Schedule jobs that use the ANYDATA data type as an argument are not supported.
-
-
Oracle Real Application Clusters (RAC) One Node is an option to the Oracle Database Enterprise Edition that was introduced with Oracle Database 11g Release 2. Amazon RDS for Oracle doesn’t support the RAC feature. For high availability, use Amazon RDS Multi-AZ.
In a Multi-AZ deployment, Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone. The primary DB instance is synchronously replicated across Availability Zones to a standby replica. This functionality provides data redundancy, eliminates I/O freezes, and minimizes latency spikes during system backups.
-
Oracle Spatial provides a SQL schema and functions that facilitate the storage, retrieval, update, and query of collections of spatial data in an Oracle database. Oracle Locator provides capabilities that are typically required to support internet and wireless service-based applications and partner-based GIS solutions. Oracle Locator is a limited subset of Oracle Spatial.
To use Oracle Spatial and Oracle Locator features, add the SPATIAL option or LOCATOR option (mutually exclusive) to the option group of your DB instance.
There are some prerequisites to using Oracle Spatial and Oracle Locator on an Amazon RDS for Oracle DB instance:
-
The instance should use Oracle Enterprise Edition version 12.1.0.2.v6 or higher, or 11.2.0.4.v10 or higher.
-
The instance should be inside a virtual private cloud (VPC).
-
The instance should the DB instance class that can support the Oracle feature. For example, Oracle Spatial is not supported for the db.m1.small, db.t1.micro, db.t2.micro, or db.t2.small DB instance classes. For more information, see DB instance class support for Oracle.
-
The instance must have the Auto Minor Version Upgrade option enabled. Amazon RDS updates your DB instance to the latest Oracle PSU if there are security vulnerabilities with a CVSS score of 9+ or other announced security vulnerabilities. For more information, see
-
If your DB instance is version 11.2.0.4.v10 or higher, you must install the XMLDB option. For more information, see
-
You should have an Oracle Spatial license from Oracle. For more information, see Oracle Spatial and Graph
in the Oracle documentation.
-
-
Data Guard is included with Oracle Database Enterprise Edition. For high availability, use Amazon RDS Multi-AZ feature.
In a Multi-AZ deployment, Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone. The primary DB instance is synchronously replicated across Availability Zones to a standby replica. This functionality provides data redundancy, eliminates I/O freezes, and minimizes latency spikes during system backups.
-
AWS SCT supports converting Oracle DBMS_SCHEDULER objects when migrating to Amazon RDS for Oracle. The AWS SCT assessment report indicates if a schedule object can be converted. For more information on using schedule objects with Amazon RDS, see the Amazon RDS documentation.
-
For Oracle to Amazon RDS for Oracle conversions, DB Links is supported. A database link is a schema object in one database that enables you to access objects on another database. The other database doesn’t need to be an Oracle database. However, to access non-Oracle databases you must use Oracle Heterogeneous Services.
Once you create a database link, you can use the link in SQL statements to refer to tables, views, and PL/SQL objects in the other database. To use a database link, append
@dblink
to the table, view, or PL/SQL object name. You can query a table or view in the other database with the SELECT statement. For more information about using Oracle database links, see the Oracle documentation. For more information about using database links with Amazon RDS, see the Amazon RDS documentation.
-
The AWS SCT assessment report provides server metrics for the conversion. These metrics about your Oracle instance include the following:
-
Computation and memory capacity of the target DB instance.
-
Unsupported Oracle features such as Real Application Clusters that Amazon RDS doesn't support.
-
Disk read-write load
-
Average total disk throughput
-
Server information such as server name, OS, host name, and character set.
-
Privileges for RDS for Oracle as a target
To migrate to Amazon RDS for Oracle, create a privileged database user. You can use the following code example.
CREATE USER
user_name
IDENTIFIED BYyour_password
; -- System privileges GRANT DROP ANY CUBE BUILD PROCESS TOuser_name
; GRANT ALTER ANY CUBE TOuser_name
; GRANT CREATE ANY CUBE DIMENSION TOuser_name
; GRANT CREATE ANY ASSEMBLY TOuser_name
; GRANT ALTER ANY RULE TOuser_name
; GRANT SELECT ANY DICTIONARY TOuser_name
; GRANT ALTER ANY DIMENSION TOuser_name
; GRANT CREATE ANY DIMENSION TOuser_name
; GRANT ALTER ANY TYPE TOuser_name
; GRANT DROP ANY TRIGGER TOuser_name
; GRANT CREATE ANY VIEW TOuser_name
; GRANT ALTER ANY CUBE BUILD PROCESS TOuser_name
; GRANT CREATE ANY CREDENTIAL TOuser_name
; GRANT DROP ANY CUBE DIMENSION TOuser_name
; GRANT DROP ANY ASSEMBLY TOuser_name
; GRANT DROP ANY PROCEDURE TOuser_name
; GRANT ALTER ANY PROCEDURE TOuser_name
; GRANT ALTER ANY SQL TRANSLATION PROFILE TOuser_name
; GRANT DROP ANY MEASURE FOLDER TOuser_name
; GRANT CREATE ANY MEASURE FOLDER TOuser_name
; GRANT DROP ANY CUBE TOuser_name
; GRANT DROP ANY MINING MODEL TOuser_name
; GRANT CREATE ANY MINING MODEL TOuser_name
; GRANT DROP ANY EDITION TOuser_name
; GRANT CREATE ANY EVALUATION CONTEXT TOuser_name
; GRANT DROP ANY DIMENSION TOuser_name
; GRANT ALTER ANY INDEXTYPE TOuser_name
; GRANT DROP ANY TYPE TOuser_name
; GRANT CREATE ANY PROCEDURE TOuser_name
; GRANT CREATE ANY SQL TRANSLATION PROFILE TOuser_name
; GRANT CREATE ANY CUBE TOuser_name
; GRANT COMMENT ANY MINING MODEL TOuser_name
; GRANT ALTER ANY MINING MODEL TOuser_name
; GRANT DROP ANY SQL PROFILE TOuser_name
; GRANT CREATE ANY JOB TOuser_name
; GRANT DROP ANY EVALUATION CONTEXT TOuser_name
; GRANT ALTER ANY EVALUATION CONTEXT TOuser_name
; GRANT CREATE ANY INDEXTYPE TOuser_name
; GRANT CREATE ANY OPERATOR TOuser_name
; GRANT CREATE ANY TRIGGER TOuser_name
; GRANT DROP ANY ROLE TOuser_name
; GRANT DROP ANY SEQUENCE TOuser_name
; GRANT DROP ANY CLUSTER TOuser_name
; GRANT DROP ANY SQL TRANSLATION PROFILE TOuser_name
; GRANT ALTER ANY ASSEMBLY TOuser_name
; GRANT CREATE ANY RULE SET TOuser_name
; GRANT ALTER ANY OUTLINE TOuser_name
; GRANT UNDER ANY TYPE TOuser_name
; GRANT CREATE ANY TYPE TOuser_name
; GRANT DROP ANY MATERIALIZED VIEW TOuser_name
; GRANT ALTER ANY ROLE TOuser_name
; GRANT DROP ANY VIEW TOuser_name
; GRANT ALTER ANY INDEX TOuser_name
; GRANT COMMENT ANY TABLE TOuser_name
; GRANT CREATE ANY TABLE TOuser_name
; GRANT CREATE USER TOuser_name
; GRANT DROP ANY RULE SET TOuser_name
; GRANT CREATE ANY CONTEXT TOuser_name
; GRANT DROP ANY INDEXTYPE TOuser_name
; GRANT ALTER ANY OPERATOR TOuser_name
; GRANT CREATE ANY MATERIALIZED VIEW TOuser_name
; GRANT ALTER ANY SEQUENCE TOuser_name
; GRANT DROP ANY SYNONYM TOuser_name
; GRANT CREATE ANY SYNONYM TOuser_name
; GRANT DROP USER TOuser_name
; GRANT ALTER ANY MEASURE FOLDER TOuser_name
; GRANT ALTER ANY EDITION TOuser_name
; GRANT DROP ANY RULE TOuser_name
; GRANT CREATE ANY RULE TOuser_name
; GRANT ALTER ANY RULE SET TOuser_name
; GRANT CREATE ANY OUTLINE TOuser_name
; GRANT UNDER ANY TABLE TOuser_name
; GRANT UNDER ANY VIEW TOuser_name
; GRANT DROP ANY DIRECTORY TOuser_name
; GRANT ALTER ANY CLUSTER TOuser_name
; GRANT CREATE ANY CLUSTER TOuser_name
; GRANT ALTER ANY TABLE TOuser_name
; GRANT CREATE ANY CUBE BUILD PROCESS TOuser_name
; GRANT ALTER ANY CUBE DIMENSION TOuser_name
; GRANT CREATE ANY EDITION TOuser_name
; GRANT CREATE ANY SQL PROFILE TOuser_name
; GRANT ALTER ANY SQL PROFILE TOuser_name
; GRANT DROP ANY OUTLINE TOuser_name
; GRANT DROP ANY CONTEXT TOuser_name
; GRANT DROP ANY OPERATOR TOuser_name
; GRANT DROP ANY LIBRARY TOuser_name
; GRANT ALTER ANY LIBRARY TOuser_name
; GRANT CREATE ANY LIBRARY TOuser_name
; GRANT ALTER ANY MATERIALIZED VIEW TOuser_name
; GRANT ALTER ANY TRIGGER TOuser_name
; GRANT CREATE ANY SEQUENCE TOuser_name
; GRANT DROP ANY INDEX TOuser_name
; GRANT CREATE ANY INDEX TOuser_name
; GRANT DROP ANY TABLE TOuser_name
; GRANT SELECT_CATALOG_ROLE TOuser_name
; GRANT SELECT ANY SEQUENCE TOuser_name
; -- Database Links GRANT CREATE DATABASE LINK TOuser_name
; GRANT CREATE PUBLIC DATABASE LINK TOuser_name
; GRANT DROP PUBLIC DATABASE LINK TOuser_name
; -- Server Level Objects (directory) GRANT CREATE ANY DIRECTORY TOuser_name
; GRANT DROP ANY DIRECTORY TOuser_name
; -- (for RDS only) GRANT EXECUTE ON RDSADMIN.RDSADMIN_UTIL TOuser_name
; -- Server Level Objects (tablespace) GRANT CREATE TABLESPACE TOuser_name
; GRANT DROP TABLESPACE TOuser_name
; -- Server Level Objects (user roles) /* (grant source privileges with admin option or convert roles/privs as DBA) */ -- Queues grant execute on DBMS_AQADM touser_name
; grant aq_administrator_role touser_name
; -- for Materialized View Logs creation GRANT SELECT ANY TABLE TOuser_name
; -- Roles GRANT RESOURCE TOuser_name
; GRANT CONNECT TOuser_name
;
In the preceding example, replace user_name
with the name of your user.
Then, replace your_password
with a secure password.
Limitations when converting Oracle to Amazon RDS for Oracle
Some limitations you should consider when migrating Oracle schema and code to Amazon RDS for Oracle:
A predefined role in Amazon RDS, called DBA, normally allows all administrative privileges on an Oracle database engine. The following privileges are not available for the DBA role on an Amazon RDS DB instance using the Oracle engine:
-
Alter database
-
Alter system
-
Create any directory
-
Grant any privilege
-
Grant any role
-
Create external job
You can grant all other privileges to an Oracle RDS user role.
-
-
Amazon RDS for Oracle supports traditional auditing, fine-grained auditing using the DBMS_FGA package, and Oracle Unified Auditing.
-
Amazon RDS for Oracle doesn’t support change data capture (CDC). To do CDC during and after a database migration, use AWS Database Migration Service.