1.首先创建一个表:
create table EDU_PHONE_20201222
(
id NUMBER(16) not null,
phone_num NUMBER(7),
mobile_type VARCHAR2(50),
province_name VARCHAR2(50),
city VARCHAR2(50),
province VARCHAR2(30),
city_name VARCHAR2(50),
type NUMBER(1) default 0 not null
)
2.编写ctl文件
options(COLUMNARRAYROWS=20971520, ROWS=10000, READSIZE=20971520, ERRORS=999999999)
load data
CHARACTERSET ZHS16GBK
infile 'E:/phone/phone.csv'
append into table EDU_PHONE_20201222
fields terminated by ','
Optionally enclosed by '"'
(ID,PHONE_NUM,MOBILE_TYPE,PROVINCE_NAME,CITY,PROVINCE,CITY_NAME,TYPE)
#导入命令
linux:
sqlldr userid=hcloud/密码 control=/home/oracle/phone.ctl log=/home/oracle/phone.log
windows:
sqlldr control='E:\phone\impPhone.ctl' data='E:\phone\all_phone.csv'
用户名:hcloud
密码:密码@//10.215.65.8:1521/orcl
网友评论