Adaptation for Migrating from Oracle to DM8
Driver Download and DEM Tool Usage Guide
DM Database Compatibility Settings
Before migrating data, set the compatibility parameters to be compatible with the Oracle database:
- Set COMPATIBLE_MODE=2 in the dm.ini configuration file specified by the instance.
- Use the statement ALTER SYSTEM SET 'COMPATIBLE_MODE'=2 SPFILE; for modification, and then restart the database service for the modification to take effect.
Integer Division Settings
To reserve decimal places for integer division, refer to the following measures before migrating data:
- Set CALC_AS_DECIMAL=1 in the dm.ini configuration file specified by the instance.
- Use the statement ALTER SYSTEM SET 'CALC_AS_DECIMAL'=1 SPFILE; for modification, and then restart the database service for the modification to take effect.
Settings of System Reserved Words
If "Syntax analysis error" is reported when creating an object such as a table in DM, the possible cause is that the object name is a system reserved word. Run the SQL statement SELECT * FROM V$RESERVED_WORDS WHERE RESERVED='Y' AND KEYWORD=Object_name; to check whether the object name is a reserved word. If it is, refer to the following measures:
- Use double quotation marks to enclose the object name and use quotation marks during query.
- (Recommended) Configure the dm_svc.conf file on the client. In the corresponding database service configuration section, add the KEYWORDS option to mask keywords: KEYWORDS=Object_name.
- Modify the SQL statements and object names related to system keywords.
Migration View Guide
If "Invalid table or view name" is reported during migrating views, the possible cause is that the dependency tables are not migrated before the view migration. Perform migration in the following order: sequences, tables, views, user-defined types, classes, functions, stored procedures, and packages.
Precision and Scale Settings
In Oracle, for the data type number(m,n), n>m is allowed. In DM, m≥n is required. In DM, m indicates the precision, and n indicates the scale. m is an unsigned integer that defines the total number of digits, and n defines the number of digits after the decimal point. In a data column, if the data type number is defined with m<n, check whether it can be changed to m≥n. If not, migrate the table separately and modify the data type in DM.
Data Overflow Error Handling
If "Data overflow" is reported when migrating from Oracle to DM, the possible cause is that the INT type of Oracle is automatically converted to NUMBER(38) whose storage precision exceeds 38 digits, or that the storage precision of the NUMBER type of Oracle exceeds 38 digits. Refer to the following measures:
- Theoretically, Oracle does not store such values of excessive length. Check whether the data is correct.
- Change the NUMBER type of DM that exceeds 38 digits to VARCHAR.
Index Missing Error Handling
If an error indicating that the reference index does not exist is reported during migration from Oracle to DM, the possible cause is that the data in the child table is migrated while the data in the parent table is not migrated. Refer to the following measures:
- Migrate the data in the parent table first, and then the data in the child table.
- Use the DEM tool to migrate data. During the first migration, select only table definitions when setting the table mapping. During the second migration, migrate data. During the third migration, migrate constraints and indexes.
