导入50G文件到mysql,然后再倒入sqlserver

--导入大文件50G文件到mysql
1、修改配置
innodb_flush_log_at_trx_commit=0

2、导入时的注意事项
set autocommit=1;
show variables like 'autocommit';
set names utf8;
source f://file.sql;

3、过程中查看导入的数量
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT count(id) FROM TABLE_NAME ;
COMMIT ;

select table_schema,table_name,table_type,table_rows
from information_schema.tables where table_name='tm_work_material'

4、sqlserver 导入mysql
https://docs.microsoft.com/zh-cn/sql/integration-services/import-export-data/connect-to-a-mysql-data-source-sql-server-import-and-export-wizard?view=sql-server-2017

 

5、关键步骤

 


6、超大文件处理EmEditor工具超级牛逼,可以免费试用1个月

7、导入过程中,检查数据的编码和导入的数量
use cdmp;

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
SELECT * FROM tm_work_material limit 10;
SELECT * FROM tm_workorder limit 10;
SELECT * FROM tm_workorder_hour limit 10;
COMMIT ;

select table_schema,table_name,table_type,table_rows
from information_schema.tables where table_name in('tm_work_material','tm_workorder','tm_workorder_hour');


8、导入过程
--------------------------------------21
set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_workorder_1.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_work_material_1.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_workorder_hour_1.sql;


--------------------------------------22
set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_workorder_2.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_work_material_2.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source f://tm_workorder_hour_2.sql;


--------------------------------------25
set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source e://tm_workorder_3.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source e://tm_work_material_3.sql;

set autocommit=1;
show variables like 'autocommit';
set names utf8;
use cdmp;
source e://tm_workorder_hour_3.sql;

posted @ 2019-06-22 08:58  kuailewangzi1212  阅读(478)  评论(0编辑  收藏  举报