ITPub博客

首页 > 数据库 > Oracle > 创建外部表(external table)

创建外部表(external table)

原创 Oracle 作者:wwwwwwyl 时间:2019-05-19 22:08:53 0 删除 编辑

Upload “Email-Match Export.csv” to the SFTP Server


------------create directory

create directory xtern_data_dir_yilin as '/backup/yilin';


------------grant access

GRANT READ, WRITE ON DIRECTORY xtern_data_dir_yilin TO willldb;


Login to Database with WILLLDB


------------create table

SQL> CREATE TABLE survey_respdts_yilin

  2  (

  3      email_address  VARCHAR(200)

  4  )

  5  ORGANIZATION EXTERNAL

  6      (DEFAULT DIRECTORY xtern_data_dir_yilin

  7       ACCESS PARAMETERS (

  8           RECORDS DELIMITED BY NEWLINE

  9  FIELDS TERMINATED BY ".com" LDRTRIM

 10       )

 11       LOCATION ('Email-Match Export.csv'));

CREATE TABLE survey_respdts_yilin

*

ERROR at line 1:

ORA-25153: Temporary Tablespace is Empty

 

SQL> create temporary tablespace temp01 tempfile 'd:oracleoradatatestdbtemp01

  2  .dbf' size 100m;

 

Tablespace created.

 

SQL> alter database default temporary tablespace temp01;

 

Database altered.

 

SQL> CREATE TABLE survey_respdts_yilin

  2  (

  3      email_address  VARCHAR(200)

  4  )

  5  ORGANIZATION EXTERNAL

  6      (DEFAULT DIRECTORY xtern_data_dir_yilin

  7       ACCESS PARAMETERS (

  8           RECORDS DELIMITED BY NEWLINE

  9   FIELDS TERMINATED BY ".com" LDRTRIM  

 10       )

 11       LOCATION ('Email-Match Export.csv'));

 

Table created.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31549649/viewspace-2644880/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2018-08-10

  • 博文量
    7
  • 访问量
    7649