Before you plan to migrate your Oracle database to PolarDB for PostgreSQL (Compatible with Oracle), the first task is to comprehensively assess the feasibility, workload, and potential risks of the migration. PolarDB integrates ADAM (Advanced Database & Application Migration) to help you complete the pre-migration assessment. Through this process, you can obtain a detailed analysis report that reduces the risk, technical difficulty, and implementation period of database and application migration, helping enterprises migrate source databases to the cloud.
Features
ADAM (Advanced Database & Application Migration) is a solution that integrates the entire process of assessment, modification, and migration to simplify the migration of heterogeneous databases to the cloud. In the assessment stage, ADAM works as a professional health check and planning tool. It performs in-depth analysis of your source Oracle database, generates a panoramic profile covering compatibility, performance, and complexity, and finally produces an assessment report for the target database. This report clearly reveals the modification cost and potential risks of the migration, helping you prepare adequately before the migration starts.
How to select a collection method
ADAM provides online and offline methods to collect information about your source Oracle database. Choose a method based on the network environment of your source database.
Collection method | Description | Use cases |
Online collection | The ADAM service connects to and collects your source database directly over the network. | The source database has a public IP address and can be accessed over the Internet. |
Offline collection | Download and run the collector script in your local environment, package the collection results, and upload them to ADAM manually. | The source database is deployed in a strictly isolated intranet and cannot be accessed externally. For security reasons, cloud services are not allowed to directly connect to production databases. |
Prerequisites
Before you start, make sure that the following conditions are met:
Source database version: Oracle 10g, 11g, 12c, 18c, and 19c.
Account permissions: You must grant the
AliyunAdamAccessingDatabaseRolerole to obtain the ADAM access permissions.NoteQuick authorization address: Quick authorization.
Collection method
Online collection:
The source database has a public IP address.
Add the IP address of the ADAM server to the security group whitelist of the source database.
NoteThe public IP addresses of ADAM are
39.100.131.0/24,47.241.17.0/24,149.129.255.0/24,47.254.192.180,47.89.251.0/24,47.245.13.0/24,47.75.108.0/24.
Offline collection: Prepare a device that can connect to the source database to run the collector.
Collection account: You must create a database account in the source Oracle database for information collection and grant the required permissions. For detailed authorization instructions, see Step 1: Collect source database information.
Benefits
Pre-migration assessment: Quantify the feasibility of cloud migration, modification cost, and target database selection before a migration project starts, avoiding potential risks.
In-depth compatibility analysis: Analyzes not only syntax compatibility but also the specific scenarios and advanced features used by the source database, and provides solution suggestions for the target database.
Sensitive data protection: The offline collector supports masking sensitive information during data collection to ensure data security.
Billing
The database assessment feature is free of charge.
Precautions
We recommend that you collect data during off-peak hours to minimize the potential impact on source database performance.
When you use the offline collector, the device that runs the collector must meet the minimum configuration requirements: at least 6 GB of memory and 500 GB of disk space, and it must be able to connect to the source database smoothly.
The collector consumes little CPU and memory of the source database, but the load may briefly increase when it obtains object DDLs. The actual impact depends on the source database specification and current load.
Exercise caution when you authorize a profile to another Alibaba Cloud UID. The authorization is valid for one month, and the authorizing party bears the risk of information leakage.
Procedure
The assessment process consists of three steps: collect data, create a profile, and analyze the assessment.
Step 1: Collect source database information
You can choose an online or offline method based on the collection method selection guide.
Online collection
Go to the PolarDB console and choose Oracle Online Migration in the left-side navigation pane.
In the Collection & Evaluation step, click the Start Collection button under Online Collection.
On the Collection & Evaluation page, click Create Collection Task to start creating a collection task.
Log on to the source database and configure a collection account with the required permissions. Use an account created by an account with the
SYSDBApermission and configure the following permissions.NoteIf you already have an account with the following permissions, skip this step and use it directly.
Oracle 10g/11g/12c/18c/19c (non-CDB mode, create a
LOCAL USERuser)-- 1. Create the collection user eoa_user and set the password. CREATE USER eoa_user IDENTIFIED BY "eoaPASSWORD" DEFAULT TABLESPACE USERS; -- 2. Grant the connect and query permissions. GRANT CONNECT, SELECT_CATALOG_ROLE TO eoa_user;Oracle 12c/18c/19c (CDB mode, connect to the CDB and create a
COMMON USERuser)-- 1. Create a common user. The prefix of a common user name must be C## or c##. CREATE USER c##eoa_user IDENTIFIED BY "eoaPASSWORD" DEFAULT TABLESPACE USERS; -- 2. Grant cross-container permissions to connect and query the data dictionary. GRANT CONNECT, SELECT_CATALOG_ROLE TO c##eoa_user CONTAINER=ALL; -- 3. Allow the user to query the data dictionary of all PDBs when connected to the root container. ALTER USER c##eoa_user SET CONTAINER_DATA=ALL FOR c##eoa_user CONTAINER=CURRENT;
After configuring the source database account, click Next to go to the Create Collection Task panel and configure the following information.
Configuration item
Description
Collection task name
Custom collection task name.
Source database type
Only ORACLE
Source database profile
Create a database profile based on the source database type and select the target database profile.
Include schema list
Include table list. Separate multiple table names with the
,character.Exclude schema list
Exclude table list. Separate multiple table names with the
,character.Collect SQL
Specify whether to collect SQL.
After the configuration is complete, click Test Connection. After the Test Connection Successful message appears, click Start Collection.
After the collection task is complete, select the task and click Next: Create Profile to go to the database profile creation process.
Offline collection
Go to the PolarDB console and choose Oracle Online Migration in the left-side navigation pane.
In the Collection & Evaluation step, click the Start Collection button under Offline Collection.
On the Collection & Evaluation page, click Download Collector and select the ADAM client version that matches the operating system of the target device to download it locally and decompress it.
NoteDo not run the collector on the database device to be collected.
The device on which the ADAM client is to be installed must meet the following minimum configuration requirements:
Memory: at least 6 GB.
Disk: at least 500 GB.
When collecting source database structures, parameters in the collected result data are automatically masked.
When collecting source database structures, the load on the target database is automatically monitored. When the load exceeds the threshold set by the system, collection is automatically paused and resumes after the load recovers.
Log on to the source database and configure a collection account with the required permissions.
Use an account created by an account with the
SYSDBApermission and configure the following permissions.NoteIf you already have an account with the following permissions, skip this step and use it directly.
Oracle 10g/11g/12c/18c/19c (non-CDB mode, create a
LOCAL USERuser)-- 1. Create the collection user eoa_user and set the password. CREATE USER eoa_user IDENTIFIED BY "eoaPASSW0RD" DEFAULT TABLESPACE USERS; -- 2. Grant the connect and query permissions. GRANT CONNECT, SELECT_CATALOG_ROLE TO eoa_user;Oracle 12c/18c/19c (CDB mode, connect to the CDB and create a
COMMON USERuser)-- 1. Create a common user. The prefix of a common user name must be C## or c##. CREATE USER c##eoa_user IDENTIFIED BY "eoaPASSW0RD" DEFAULT TABLESPACE USERS; -- 2. Grant cross-container permissions to connect and query the data dictionary. GRANT CONNECT, SELECT_CATALOG_ROLE TO c##eoa_user CONTAINER=ALL; -- 3. Allow the user to query the data dictionary of all PDBs when connected to the root container. ALTER USER c##eoa_user SET CONTAINER_DATA=ALL FOR c##eoa_user CONTAINER=CURRENT;
Collect structural data of the database to generate the feasibility report and compatibility report.
Run the collection command.
Oracle 10g
collect_10g[.sh|.bat] –h <host> -u <username> -p <password> -P <port> -d <service_name>Oracle 11g
Oracle 11g R1
collect_11gR1[.sh|.bat] –h <host> -u <username> -p <password> -P <port> -d <service_name>Oracle 11g R2
collect_11gR2[.sh|.bat] –h <host> -u <username> -p <password> -P <port> -d <service_name>
Oracle 12c/18c/19c
For an Oracle database that uses the multitenant architecture, the target you need to collect is usually a specific PDB (Pluggable Database) that contains business data. Use the
collect_12cscript to perform collection.collect_12c[.sh|.bat] –h <host> -u <username> -p <password> -P <port> -d <pdb_service_name> -s <pdb_sid>Note.batis the command for Windows, and.shis the command for Linux.-h: IP address of the database to be collected.
-u: Collection username. In this example, the user is eoa_user.
-p: Password of the collection user eoa_user, which is eoaPASSW0RD.
-P: Port of the database to be collected, for example, 1521.
-d: Service name of the database to be collected. For Oracle 12c/18c/19c, specify the service name of a specific PDB.
-s: (Optional) Instance name (SID) of the specified PDB to be collected. This parameter is required in some connection scenarios.
Export the collection result.
After the collection is complete, the system prompts you that the data package is generated and displays the package path. The log file is as follows:
[***] ****************************************************************** [***] * Collect Successfully! [***] * [***] * Complete the file packaging, the package result path is: [***] * ~rainmeter/out/data.zip [***] ******************************************************************
(Optional) After the collection is complete, we recommend that you run the following SQL statements to clean up the temporary account:
Non-CDB mode:
DROP USER eoa_user CASCADE;CDB mode:
DROP USER c##eoa_user CASCADE;
NoteWe recommend that you collect database data during off-peak hours. Collection during off-peak hours usually takes only a short time.
The collector does not have high CPU requirements. If GETDDL operations on database objects are involved, the CPU load increases to some extent at the beginning of the collection. The increase depends on the source database specifications and current load.
The collector consumes very little memory of the source database, which can be ignored.
Step 2: Create and manage a source database profile
After you collect source database information, create a database profile. A database profile is the basis of assessment and analysis. It helps you better understand your source database and quickly look up source database information during database migration and modification.
Create a profile
Online collection
In the Create Profile panel, configure the profile information and click Create.
Profile name: A custom name that is easy to identify.
Type: Select Oracle.
Report language: Select Chinese or English based on your needs.
Data file: The file obtained in Step 1: Collect source database information is automatically obtained.
Offline collection
On the assessment page, click the Source Database Profile tab. On the Source Database Profile tab, click Create Profile in the upper-left corner of the area.
In the Create Profile panel, configure the profile information and click Create.
Profile name: A custom name that is easy to identify.
Type: Select Oracle.
Report language: Select Chinese or English based on your needs.
Data file: Click Upload and upload the Step 1: Collect source database information file
data.zipthat you obtained.
Creating a source database profile takes about 1 to 30 minutes, depending on the content collected from the source database.
When the profile status changes to Finish, the profile is created.
View profile analysis details
After the profile is created, you can explore the source database in depth. In the Source Database Profile list, find the target profile and click Details in the Actions column. The profile details page consists of two major parts:
Profile overview: quick health check
This page uses a series of scores to help you quickly build an initial understanding of the overall status of the database.
Five core metrics: Scores for sessions, complexity, hotspots, scale, and load visually present the database from dimensions such as the number of connections, structural complexity, performance risks, access concentration, resource volume, and operating pressure. A higher score indicates a more prominent feature in that dimension.
Main object distribution: The proportions of various database objects (tables, indexes, views, and more) are displayed in charts.
Profile details: in-depth technical exploration
This page provides an in-depth analysis of the source database and is the key basis for technical personnel to design migration solutions and estimate the modification workload.
Performance: View core performance metrics such as QPS, TPS, and CPU utilization of the database during the collection period.
Capacity: Analyze the storage usage of the database, including the capacity ranking of each schema and the proportions of tables, indexes, and LOB fields.
Oracle features: Identify and list all Oracle-specific syntax and features used in the source database. You can click a specific feature to find out which database objects use it, providing precise targets for subsequent modification.
External dependencies: Display DBLink information in the database. This is critical for estimating the modification workload of cross-database queries.
Other dimensions: Intelligently identify special objects and statements such as tables without primary keys, rapidly growing tables, and SQL statements that contain aggregate functions. These are usually the parts that need special attention and optimization after migration.
Object details and panoramic search: Provide a powerful database object browser and search engine. You can view the DDL, dependencies, associated objects, and other details of any object without logging on to the source database to run queries, which greatly improves analysis efficiency.
Manage source database profiles
In the Source Database Profile list, you can also perform the following management operations on created profiles:
Append to profile: update data If the source database changes after the first collection (for example, a new version of the application is released), you can use this feature to upload a new collection file based on the original profile. The system generates a new version of the profile that contains all the data, enabling continuous tracking of the database status.
Authorize profile: collaborate You can share the read-only permission of a profile with other team members by using their Alibaba Cloud UIDs. Authorized users can view the profile, create assessment projects, and download reports, which facilitates team collaboration on migration assessment.
NoteThis feature involves data sharing. Exercise caution and authorize only trusted accounts. The authorizing party is responsible for any data leakage caused by the authorization operation.
Delete profile: clean up resources When a profile and its associated assessment projects are no longer needed, you can delete the profile to release management space. Note that deleting a profile also deletes all assessment projects created based on the profile. This operation is irreversible.
Step 3: Create a target database compatibility assessment project
This step performs a compatibility analysis for the target PolarDB for PostgreSQL (Compatible with Oracle) based on the created source database profile.
On the assessment page, click the Target Database Compatibility Assessment tab. On the Target Database Compatibility Assessment tab, click Create Project in the upper-left corner of the area.
In the Create Project panel, configure the project information.
Parameter
Description
Project name
Enter the name of the target database assessment project for subsequent database modification and migration.
Source database profile
Select the source database profile to be assessed.
Project type
Select the target database type.
Target database version
Select the target database version.
Assess invalid objects
Specify whether to assess invalid objects in the source database profile:
Yes: Assess invalid objects.
No: Ignore invalid objects during assessment.
NoteInvalid objects are objects such as packages, procedures, functions, and views whose status changes to INVALID during routine maintenance or data migration of the source database.
Report language
Select the language of the assessment report:
Chinese
English
Schema filter
Add the schema types to be assessed:
In the Unselected list on the left, select the schema types to be assessed.
Click the
icon to move the selected schema types to the Selected list on the right.
Click Create. After the new project is created, the target database assessment analysis is automatically performed and an analysis report is generated.
Step 4: Interpret the project assessment report
After the assessment project status changes to Completed, click Details to view the detailed assessment report. The report mainly contains the following core parts:
Assessment summary provides a high-level view of the overall migration, including the compatibility of objects and SQL, the number of modification points that require manual intervention, and risk warnings that may occur during migration.
Assessment details
Object compatibility: Lists the compatibility of each database object type (tables, views, stored procedures, and more) in detail. You can view the specific reason why an object is incompatible, the modification solution suggested by ADAM, and even the automatically converted DDL code.
SQL compatibility: Analyzes the compatibility of business SQL collected from the source database in the target database. You can view the original text, error information, and modification suggestions of incompatible SQL.
Object modification points: Summarizes all modification tasks for incompatible objects and grades them by difficulty to help you plan the modification work.
Migration risks: Lists the high-load, high-consumption SQL statements in the source database that require special attention, and warns about performance risks that may occur after migration to the target database. These are the key points to focus on during test verification.
After the assessment is complete, you can download reports in multiple formats (simplified, complete, and HTML) and, based on the modification points in the report, start the next step of database modification and data migration.