Updated on 2023-02-28 GMT+08:00

Preparing for the Source Oracle Database

Before the synchronization, prepare some data types in the source database for verification after the synchronization is complete.

The following table lists data types supported by DRS.

Table 1 Data type mapping

Data Type (Oracle)

Condition

Data Type (DDM)

Whether to Support Mapping

CHAR(n)

n ≤ 255

CHAR(n)

Yes

CHAR(n)

n > 255

VARCHAR(n)

Yes

VARCHAR(Size)

Length (row size) ≤ 65535

VARCHAR(n)

Yes

VARCHAR(Size)

Length (row size) > 65535

TEXT

Yes

VARCHAR2(n)

-

VARCHAR(n)

Yes

NCHAR(n)

n ≤ 255

NCHAR(n)

Yes

NCHAR(n)

n > 255

NVARCHAR(n)

Yes

NVARCHAR2(n)

-

NVARCHAR(n)

Yes

NUMBER(p,s)

s > 0

NUMBER(p,s)

Yes

NUMBER(p,s)

s ≤ 0

NUMBER(p-s,0)

Yes

BINARY_FLOAT

-

FLOAT

Yes

BINARY_DOUBLE

-

DOUBLE

Yes

FLOAT(b)

b ≤ 99

DECIMAL(b*0.30103*2,b*0.30103)

Yes

FLOAT(b)

b > 99

DOUBLE

Yes

DATE

-

DATETIME

Yes

TIMESTAMP

-

TIMESTAMP

Yes

TIMESTAMP WITH LOCAL TIME ZONE

-

TIMESTAMP

Yes

TIMESTAMP WITH TIME ZONE

-

TIMESTAMP

Yes

INTERVAL

Incremental

VARCHAR(30)

No

INTERVAL

Full; 6 digit precision

VARCHAR(30)

Yes

BLOB

-

LONGBLOB

Yes

CLOB

-

LONGTEXT

Yes

NCLOB

-

LONGTEXT

Yes

LONG

-

LONGTEXT

Yes

LONG_RAW

-

LONGBLOB

Yes

RAW

-

VARBINARY

Yes

ROWID

-

VARCHAR(18)

Yes

Perform the following steps to generate data in the source database:

  1. Use a database connection tool to connect to the source Oracle database based on its IP address.
  2. Construct data in the source database based on its supported data types.

    1. Create a test user.
      create user test_info identified by xxx;

      test_info indicates the user created for the test, and xxx indicates the password of the user.

    2. Assign permissions to the user.
      grant dba to test_info;
    3. Create a data table under the user.
      CREATE TABLE test_info.table3(
      ID INT,
      COL01 CHAR(100),
      COL02 NCHAR(100),
      PRIMARY KEY(ID)
      );
    4. Insert two rows of data.

      insert into test_info.table3 values(4,'huawei','xian');

      insert into test_info.table3 values(2,'DRS-test','test1');

      insert into test_info.table3 values(1,'huawei','xian');

    5. Make the above statements take effect.

      commit;