Constructing Data Before the Migration
Before the migration, you need to construct some data types in the source database for data verification after the migration.
Prerequisites
You have obtained the IP address, port, username, and password of the source instance.
Procedure
- Use the database connection tool to connect to the IP address of the source database.
- Construct data in the source database based on the supported data types.
- Log in to the source database.
- Open a schema to be migrated.
- Clear the previous table information in the db_test_info schema to ensure that data can be created successfully.
drop table if exists db_test_info_001;
db_test_info_001 is the name of the table created in this practice. Replace it as required.
- Create a data table.
create table db_test_info_001(
column19 TIMESTAMP ,
column18 VARCHAR(256) ,
column11 DATETIME ,
column10 ENUM('a','b','c') ,
column13 FLOAT(2,1) ,
column12 YEAR ,
column15 VARCHAR(64) not null,
column14 DOUBLE(2,1) ,
column17 INT ,
column16 LONGTEXT ,
column20 TIME ,
column21 BIT(8) ,
column22 LONGBLOB ,
column23 MEDIUMINT ,
column24 VARCHAR(20) ,
column9 DECIMAL(2,1) ,
column8 VARCHAR(1024) ,
column5 SMALLINT ,
column4 DATE ,
column7 VARCHAR(32) ,
column6 SET('hehe','xixi','haha') ,
column1 char(1) ,
column0 MEDIUMINT ,
column3 BIGINT ,
column2 TINYINT ,
primary key(column19,column11,column17)
);
- Insert records into the table.
insert into db_test_info_001(column19,column11,column10,column1,column24,column15,column23,column0,column8) values('2019-07-24 14:08:58',now(),'A',(RAND()*10000000),(RAND()*10000000),'db_test_info_001',(RAND()*10000000),(RAND()*1000000),'a');
insert into db_test_info_001(column19,column11,column17,column10,column1,column24,column15,column23,column0,column8) values(now(),now(),(RAND()*10000000),'A',(RAND()*10000000),(RAND()*10000000),'db_test_info_001',(RAND()*10000000),(RAND()*1000000),'a');
insert into db_test_info_001(column19,column11,column17,column10,column1,column24,column15,column23,column0,column8) values(now(),now(),(RAND()*10000000),'A',(RAND()*10000000),(RAND()*10000000),'db_test_info_001',(RAND()*10000000),(RAND()*1000000),'a');
insert into db_test_info_001(column19,column11,column17,column10,column1,column24,column15,column23,column0,column8) values(now(),now(),(RAND()*10000000),'A',(RAND()*10000000),(RAND()*10000000),'db_test_info_001',(RAND()*10000000),(RAND()*1000000),'a');
- Query the results.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot