读书人

select外部表报错ora-29913,ora-29400

发布时间: 2013-03-19 17:22:05 作者: rapoo

select外部表报错ora-29913,ora-29400 求助
各位好,创建外部表操作如下,请帮忙看看是哪里的问题。
1.创建目录时路径里面没有空格


[oracle@db1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Dec 13 14:40:01 2012

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL> drop DIRECTORY dir_bdump;

Directory dropped.

SQL> create or replace directory dir_bdump as '/home/oracle';
grant read,write on directory dir_bdump to ydqxn;
Directory created.

SQL>

Grant succeeded.

SQL>
SQL>
SQL>
SQL> conn ydqxn/ydqxn
Connected.
SQL> drop table org_ext_dz;

Table dropped.

SQL> create table org_ext_dz (
2 ID NUMBER,
3 USER_MOBILE VARCHAR2(20),
4 SERVICE_ID NUMBER,
5 USER_STATUS NUMBER,
6 USER_AREA VARCHAR2(20),
7 FORECAST_AREA VARCHAR2(20),
8 FORECAST_TIME DATE,
9 FORECAST_TYPE NUMBER,
10 SAVETIME DATE,
11 USER_ORIGIN NUMBER
12 )
13 organization external (
14 type oracle_loader
15 default directory dir_bdump
16 access parameters (
17 records delimited by newline
18 FIELDS TERMINATED BY ' '
19 --nobadfile
20 --nodiscardfile
21 --nologfile
22 )
23 location('t_user_mobile_dz.txt')
24 )
25 reject limit unlimited;

Table created.

SQL> select count(*) from org_ext_dz;
select count(*) from org_ext_dz
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "minussign": expecting one of: "column,
enclosed, exit, (, ltrim, lrtrim, ldrtrim, missing, notrim, optionally, rtrim,
reject"
KUP-01007: at line 3 column 3
ORA-06512: at "SYS.ORACLE_LOADER", line 19


SQL>

------解决方案--------------------



t_user_mobile_dz.txt 格式是什么样子,贴一部分出来。

顺便查看一下外部表的信息:
select * from user_external_tables where table_name='xxx'


[解决办法]
列与列之间是tab分隔,fields terminated by X'09'  

读书人网 >oracle

热点推荐