一、把以下文件导入为password.dat表
root :1 :1 :2 :adminstrators :root :/bin/sh
user1 :1 :1 :2 :users :home :/bin/sh
user2 :1 :1 :2 :users :home :/bin/sh
user3 :1 :1 :2 :users :home :/bin/sh
user4 :1 :1 :2 :users :home :/bin/sh
二、创建表
drop table hr.password
create table hr.password(
user_name varchar2(100),
user_passwd char(10),
user_id number(20),
group_id number(20),
user_comment varchar2(200),
user_home varchar2(100),
user_shell varchar2(100)
);
三、生成控制文件
maintenance---->数据移动---->从用户文件加载数据---->选择位置---->服务器端路径---->分隔符---->选择PASSWORD表,生成password.ctl
LOAD DATA
APPEND
INTO TABLE hr.password
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(
USER_NAME CHAR,
USER_PASSWD CHAR,
USER_ID INTEGER EXTERNAL,
GROUP_ID INTEGER EXTERNAL,
USER_COMMENT CHAR,
USER_HOME CHAR,
USER_SHELL CHAR
)
四、$sqlldr hr/hr control=password.ctl data=password.dat direcy=y
转载于:https://blog.51cto.com/anneoracle/1228250