SQL*Loader Express使用

SQL*Loader Express

SQLLoader Express是Oracle 12C的新特性,可以使用sql loader express把数据导入数据库中。

注意事项

  • 命令行中的表名大小写一定要和操作系统上对应的文件名大小写一样,而且文件扩展名必须是.dat

  • 数据文件内的数据分割必须是以逗号(CSV格式)做分隔符。

  • 表列必须是标量数据类型(字符、数字或日期时间)

1. 创建目录

[oracle@oracle ~]$ mkdir -p /home/oracle/sqlldr

2. 创建数据文件


[oracle@oracle sqlldr]$ vi eemp.dat

1,a,100
2,b,200
3,c,300


3. 创建表格

以hr用户创建表格

SQL> conn hr/hr;
Connected.
SQL> create table eemp(id number,name varchar2(10),salary number);

Table created.


4. 数据导入


[oracle@oracle sqlldr]$ sqlldr hr/hr table=eemp;

SQL*Loader: Release 12.2.0.1.0 - Production on Sun Dec 11 14:38:09 2022

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Express Mode Load, Table: EEMP
Path used:      External Table, DEGREE_OF_PARALLELISM=AUTO
SQL*Loader-816: error creating temporary directory object SYS_SQLLDR_XT_TMPDIR_00000 for file eemp.dat
ORA-01031: insufficient privileges
SQL*Loader-579: switching to direct path for the load
SQL*Loader-583: ignoring trim setting with direct path, using value of LDRTRIM
SQL*Loader-584: ignoring DEGREE_OF_PARALLELISM setting with direct path, using value of NONE
Express Mode Load, Table: EEMP
Path used:      Direct

Load completed - logical record count 3.

Table EEMP:
  3 Rows successfully loaded.

Check the log file:
  eemp.log
for more information about the load.

posted @ 2022-12-12 21:58  何以卿卿  阅读(127)  评论(0编辑  收藏  举报