Directory selection in external table

How do we select the directory path for external table files?.whether we can select any directory in any drive or we have to select particular drive and particular directory path?.how do we check for this?.
example
create or replace directory ext_dir as 'c:/temp';
or
create or replace directory ext_dir as 'd:/temp';
any procedure for that for selecting drive and directory?.any read or wrte permission is needed?

Hi,
any procedure for that for selecting drive and directory?Not really clear to me what you mean by that?
any read or wrte permission is needed?For external tables, READ privileges are required on directory objects that contain data sources, while WRITE privileges are required for directory objects containing bad, log, or discard files.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2462
Just check the docs, I bet your questions will be answered while you read:
http://www.oracle.com/pls/db102/homepage
or
http://www.oracle.com/pls/db111/homepage

Similar Messages

  • Data Mismatch while selecting from External Table

    Hi I am not able create an external table,I am trying to create and test table and able to create but when i selecting the data it showing data mismatch.I tried for an test data but it returned error.I want to load from an excel file saved as test.csv
    CREATE TABLE Per_ext
    CITY VARCHAR2(30),
    STATE VARCHAR2(20),
    ZIP VARCHAR2(10),
    COUNTRY VARCHAR2(30)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY dataload
    ACCESS PARAMETERS
    MISSING FIELD VALUES ARE NULL
    LOCATION ('test.csv')
    REJECT LIMIT UNLIMITED;
    test.csv file contents
    city ----------     state---------Zip------------country
    Bombay-----     MH------------34324-------india
    london-------London------1321---------UK
    Pune---------MH------------3224---------india
    Banglore----     Karnataka---11313-------india
    rgds
    soumya

    Hi Justin
    I am getting following error when i trying from toad
    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 "comma": expecting one of: "badfile, byteordermark, characterset, column, data, delimited, discardfile, exit, fields, fixed, load, logfile, language, nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string, skip, territory, variable"
    KUP-01007: at line 1 column 29
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    rgds
    soumya

  • Selecting from external table

    Hi,
    I have an external table with 3 data files. How can I define by the select statement from which data file I'd like to select, is it possible at all?
    ( like at partitioned table I can define the partition name in the select statement)
    Is there a limit how many data files can belong to an external table?
    Thanks
    Orsi

    Hi,
    I wasn'rt clear, so I write an example:
    CREATE TABLE ADMIN_EXT_EMPLOYEES
    EMPLOYEE_ID NUMBER(4),
    FIRST_NAME VARCHAR2(20 BYTE),
    LAST_NAME VARCHAR2(25 BYTE),
    JOB_ID VARCHAR2(10 BYTE),
    MANAGER_ID NUMBER(4),
    HIRE_DATE DATE,
    SALARY NUMBER(8,2),
    COMMISSION_PCT NUMBER(2,2),
    DEPARTMENT_ID NUMBER(4),
    EMAIL VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ADMIN_DAT_DIR
    ACCESS PARAMETERS
    LOCATION ('empxt1.dat', 'empxt2.dat', 'empxt3.dat'')
    I'd like select only from one of the dat files, and my question is if is it posible to do that.
    Thanks

  • KUP-04063: unable to open log file.. (while selecting from External table)

    Hi
    I am trying to craete an external table and then select the data from the table. However I am getting error while trying to select the data from external table.
    SQL>CREATE OR REPLACE DIRECTORY my_dir as 'C:\arun';
    Directory created.
    SQL>GRANT ALL ON DIRECTORY my_dir TO PUBLIC;
    Grant succeeded.
    SQL>DROP TABLE proj_checklists_external;
    Table dropped.
    SQL>CREATE TABLE proj_checklists_external
    2 ( checklist_submission_id NUMBER
    3 ,Lead_reviewer_name VARCHAR2(30)
    4 ,Lead_reviewer_corp_id VARCHAR2(10)
    5 ,creation_date VARCHAR2(10)
    6 ,submitted_dater VARCHAR2(10)
    7 ,approved_date VARCHAR2(10)
    8 ,status VARCHAR2(50)
    9 )
    10 ORGANIZATION EXTERNAL
    11 (
    12 TYPE ORACLE_LOADER
    13 DEFAULT DIRECTORY my_dir
    14 ACCESS PARAMETERS
    15 (
    16 RECORDS DELIMITED BY NEWLINE
    17 FIELDS TERMINATED BY ','
    18 )
    19 LOCATION ('Book1.txt')
    20 )
    21 PARALLEL 5
    22 REJECT LIMIT 200;
    Table created.
    SQL>SELECT * FROM proj_checklists_external;
    SELECT * FROM proj_checklists_external
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file PROJ_CHECKLISTS_EXTERNAL_28484.log
    OS error No such file or directory
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    I craeted an file PROJ_CHECKLISTS_EXTERNAL_28484.log also in C:\arun and then tried to select but still got same error.
    Any idea how to overcome this error.
    Regards
    Arun

    here you go:
    SQL> CREATE OR REPLACE DIRECTORY GRATIS_LOAD as 'D:\AdvSourceData\Membership\';
    Directory created
    SQL> GRANT ALL ON DIRECTORY GRATIS_LOAD to ADVROLE;
    Grant succeeded
    SQL>
    SQL> DROP TABLE MEMB_BATCH_LOAD_ID;
    Table dropped
    SQL> CREATE TABLE MEMB_BATCH_LOAD_ID (
    2 ID_NUMBER VARCHAR2(10),
    3 STATUS CHAR(1)
    4 )
    5 ORGANIZATION EXTERNAL
    6 ( TYPE ORACLE_LOADER
    7 DEFAULT DIRECTORY GRATIS_LOAD
    8 ACCESS PARAMETERS
    9 ( records delimited by NEWLINE
    10 fields (
    11 ID_NUMBER POSITION (1:10) CHAR,
    12 STATUS POSITION (11:1) CHAR
    13 )
    14 )
    15 LOCATION
    16 ( 'GRATISID.TXT'
    17 )
    18 );
    Table created
    SQL> select * from memb_batch_load_id;
    select * from memb_batch_load_id
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file MEMB_BATCH_LOAD_ID_1388_5552.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

  • Facing Many Problems About Creating Directory and an External Table

    Question:
    The weird thing is if you look at question 10-b in page 3-41, it says:
    (page 3-41 "Oracle Database 10g SQL Fund. II Vol.1")
    Merge the data in the EMP_DATA table created in the last lab into the data in the emp_hist table. Assume
    that the data in external EMP_DATA table matches the EMP_HIST table, update the email column
    of the EMP_HIST table to match the EMP_DATA table row. If a row in the EMP_DATA table does not
    match, insert into the EMP_HIST tables. Rows are considered matching when the employee's first and
    last name are identical.
    To me, this question is constructed wrongly. First of all in the last lab we have not been asked to create EMP_DATA. Secondly, EMP_DATA is empty.
    Thirdly, this question asks us to merge into EMP_HIST table while EMP_DATA is empty.
    EMP_HIST table currently has copied data from employees table. EMP_HIST structure:
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(45)
    Anway, i did the merge as following:
    merge into emp_hist e
    using emp_data d
    on (e.first_name = d.first_name)
    when matched then
    update set
    e.last_name = d.last_name,
    e.email = d.email
    when not matched then
    insert values (d.first_name, d.last_name, d.email);
    I get this error:
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file emp.dat in EMP_DIR not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    On the other hand, i said let me try this:
    merge into emp_data d
    using emp_hist e
    on (d.first_name = e.first_name)
    when matched then
    update set
    d.last_name = e.last_name,
    d.email = e.email
    when not matched then
    insert values (e.first_name, e.last_name, e.email);
    I get this error because external table is final once its created as far as i know:
    Error report:
    SQL Error: ORA-30657: operation not supported on external organized table
    30657.0000 - "operation not supported on external organized table"
    *Cause:    User attempted on operation on an external table which is
    not supported.
    *Action:   Don't do that!
    I do not know what to do. I did my best, please help.
    Edited by: user11164565 on Jul 27, 2009 2:43 AM

    user11164565 wrote:
    NOTE: I did my best, i did all what i can do, but the problem persists. Please help
    I will mention all the steps i did clearly....
    I gave scott the following grants:
    grant create any directory to scott;
    grant read on directory emp_dir to scott;
    1. Created a directory and its been created successfully:
    create or replace directory emp_dir
    as 'F:\emp_dir';
    Then i did the following just to make sure my directory is recognized:
    SELECT *
    FROM dba_directories;
    I found the drive amongst the results...
    OWNER DIRECTORY_NAME
    DIRECTORY_PATH
    SYS EMP_DIR
    F:\emp_dir
    SYS SUBDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\/2002/Sep
    SYS XMLDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\
    2. I created an external table emp_data (the script is given by the text book): done successfully
    drop table emp_data;
    CREATE TABLE emp_data
    (first_name VARCHAR2(20)
    ,last_name VARCHAR2(20)
    , email VARCHAR2(30)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY emp_dir
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    NOBADFILE
    NOLOGFILE
    FIELDS
    ( first_name POSITION ( 1:20) CHAR
    , last_name POSITION (22:41) CHAR
    , email POSITION (43:72) CHAR )
    LOCATION ('emp.dat') ) ;
    3. I went to F:\ drive to see if emp_dir folder exist or not! I did not see it. I checked hidden files, nothing there. Anyway, i ignored it and did step 4.
    <snip>
    "Anyway, I ignored it . . . "
    and hence the rest of your problems. I did not see in the steps you recounted that you acually created a directory ("folder") named "\emp_dir" on your f: drive. Nothing you create within the database will actually create that directory on the OS. Createing a directory in Oracle, createing an external table in Oracle, will only create pointers to objects that Oracle will simply assume actually exists.

  • Error: while Selecting External table

    Hi everybody,
    When i Select an external table i am getting this error. The file is like this:
    229|1|506460|SIGROUP |4890|100|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|12|CLIENT|INE547A01012|10:31:00|
    229|1|506460|SIGROUP |4900|900|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|13|CLIENT|INE547A01012|10:31:00|
    229|1|500407|SWARAJENG |21400|300|0|0|10:33:28|2007/12/17|OWN|20191397001|L|B|154|OWN|INE277A01016|10:33:28|
    I had created the Table like this:
    SQL> CREATE TABLE TEMP_SAUDA
    2 (S_A VARCHAR2(20),
    3 S_TYPE VARCHAR2(20),
    4 S_CO VARCHAR2(20),
    5 S_CONAME VARCHAR2(40),
    6 S_RATE NUMBER,
    7 S_QTY NUMBER,
    8 S_G NUMBER,
    9 S_H NUMBER,
    10 S_TIME TIMESTAMP WITH TIME ZONE,
    11 S_DATE DATE,
    12 S_PCODE VARCHAR2(20),
    13 S_SETNO VARCHAR2(20),
    14 S_M VARCHAR2(20),
    15 S_N VARCHAR2(20),
    16 S_O VARCHAR2(20),
    17 S_CLIENTOWN VARCHAR2(10),
    18 S_ISIN VARCHAR2(12),
    19 S_ORDER_TIME TIMESTAMP WITH TIME ZONE
    20 )
    21 ORGANIZATION EXTERNAL
    22 (TYPE oracle_loader
    23 DEFAULT DIRECTORY BSE17122007
    24 ACCESS PARAMETERS
    25 (RECORDS DELIMITED BY NEWLINE
    26 FIELDS
    27 (
    28 S_A CHAR(20),
    29 S_TYPE CHAR(20),
    30 S_CO CHAR(20),
    31 S_CONAME CHAR(20),
    32 S_RATE CHAR(20),
    33 S_QTY CHAR(20),
    34 S_G CHAR(20),
    35 S_H CHAR(20),
    36 S_TIME CHAR(35) date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    37 S_DATE CHAR(22) date_format DATE mask "mm/dd/yyyy hh:mi:ss ",
    38 S_PCODE CHAR(20),
    39 S_SETNO CHAR(20),
    40 S_M CHAR(20),
    41 S_N CHAR(20),
    42 S_O CHAR(20),
    43 S_CLIENTOWN CHAR(20),
    44 S_ISIN CHAR(20),
    45 S_ORDER_TIME date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM"
    46 )
    47 )
    48 location (BSE17122007:'BR171207.DAT')
    49 )
    50 ;
    Table created.
    SQL> SELECT * FROM TEMP_SAUDA;
    SELECT * FROM TEMP_SAUDA
    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 "date_format": expecting one of: "binary_double,
    binary_float, comma, char, date, defaultif, decimal, double, float, integer, (,
    nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned,
    varrawc, varchar, varraw, varcharc, zoned"
    KUP-01007: at line 21 column 14
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    Is there any mistake in this table creation.
    what i have to declare to the time format if the format in the file id hh:mm:ss
    Thank u...!
    Ravi

    The output you posted is completely wrong, I could not even create the table without errors.
    Try with this.
    CREATE TABLE TEMP_SAUDA
    (S_A VARCHAR2(20),
    S_TYPE VARCHAR2(20),
    S_CO VARCHAR2(20),
    S_CONAME VARCHAR2(40),
    S_RATE NUMBER,
    S_QTY NUMBER,
    S_G NUMBER,
    S_H NUMBER,
    S_TIME TIMESTAMP WITH TIME ZONE,
    S_DATE DATE,
    S_PCODE VARCHAR2(20),
    S_SETNO VARCHAR2(20),
    S_M VARCHAR2(20),
    S_N VARCHAR2(20),
    S_O VARCHAR2(20),
    S_CLIENTOWN VARCHAR2(10),
    S_ISIN VARCHAR2(12),
    S_ORDER_TIME TIMESTAMP WITH TIME ZONE
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY BSE17122007
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY NEWLINE
    FIELDS terminated by "|"
    S_A CHAR(20),
    S_TYPE CHAR(20),
    S_CO CHAR(20),
    S_CONAME CHAR(20),
    S_RATE CHAR(20),
    S_QTY CHAR(20),
    S_G CHAR(20),
    S_H CHAR(20),
    S_TIME CHAR(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM",
    S_DATE CHAR(10) date_format DATE mask "yyyy/mm/dd",
    S_PCODE CHAR(20),
    S_SETNO CHAR(20),
    S_M CHAR(20),
    S_N CHAR(20),
    S_O CHAR(20),
    S_CLIENTOWN CHAR(20),
    S_ISIN CHAR(20),
    S_ORDER_TIME char(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM"
    location (BSE17122007:'BR171207.DAT')
    ;With this you get:
    SQL> col s_time format a40
    SQL> col s_date format a40
    SQL> col s_order_time format a40
    SQL> r
      1* select s_time,s_date,s_order_time from temp_sauda
    S_TIME                                   S_DATE                                   S_ORDER_TIME
    01-JAN-08 10.31.01.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.31.00.000000 AM +00:00
    01-JAN-08 10.31.01.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.31.00.000000 AM +00:00
    01-JAN-08 10.33.28.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.33.28.000000 AM +00:00Be aware that your file does not contain date information for the time fields, so as you see above it is defaulted to 01-JAN-08 for the S_TIME and S_ORDER_TIME column.

  • KUP-01005 error when selecting external table

    Hi All,
    My name is arun. I am having trouble resolving the following error. I tried to google, search oracle forum but no avail. I would really appreciate some help? I hope someone point me to the right direction with this problem. Thank you.
    Scenario :
    I have done the following :
    1. Created the external directories using a user account(KDEV199). However by default its owned by SYS user.
    2. Created the table necessary for selection. This was done by user account(KDEV199)
    3. I have granted the folder privileges owned by oinstall:oracle where the 2 physical files exists. Thus all the files is owned by oracle. This was done at OS layer.
    4. I have created 2 files necessary to extract data & read in oracle. This was done at OS layer.
    The problem is that i have the following when i try to select the table :
    SQL> select * from TEXN_IGM_MST;
    select * from TEXN_IGM_MST
    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:
    "double-quoted-string, identifier, single-quoted-string"
    KUP-01007: at line 7 column 10
    This script used to create the table :
    --Create External Table
    CREATE TABLE texn_igm_mst
    COMP_NO CHAR(2),
    POL_NO CHAR(10),
    WRITING_AGENCY_NO_1 CHAR(10),
    WRITING_AGENT_NO_1 CHAR(10),
    WRITING_AGENCY_NO_2 CHAR(10),
    WRITING_AGENT_NO_2 CHAR(10),
    POL_STS_CDE CHAR(4),
    STS_CHNG_DT DATE,
    POL_DTE DATE,
    PAY_UP_DTE DATE,
    PAY_TO_DTE CHAR(10),
    MATURE_DTE DATE,
    PAY_MODE_CDE CHAR(2),
    PAY_METHOD_CDE CHAR(1),
    MODAL_PREM_AMT NUMBER(15,2),
    POL_CUR CHAR(2),
    NFO_CDE CHAR(1),
    DIVD_OPTION_CDE_1 CHAR(1),
    DIVD_OPTION_CDE_2 CHAR(1),
    OTHER_OPTION_CDE_1 CHAR(1),
    OTHER_OPTION_CDE_2 CHAR(1),
    RESTRICT_CDE CHAR(20),
    NEXT_MODAL_PREM NUMBER(15,2),
    SUSPEND_CDE CHAR(1),
    EXTRACT_DTE DATE,
    REASON_CDE CHAR(3),
    LINE_OF_BUSS CHAR(1),
    BILL_TO_DTE CHAR(10),
    DUE_DAY NUMBER(3),
    DAY_USE CHAR(1),
    PAR_TYPE CHAR(1),
    ISSUE_STATE CHAR(2),
    MED_CDE CHAR(1),
    RACE_CDE CHAR(1),
    ADMIT_CDE CHAR(1),
    REPT_STATE CHAR(2),
    COLL_OFF CHAR(2),
    WRITING_AGENCY CHAR(10),
    LAST_ANN_PROC CHAR(3),
    TIMESTAMP DATE,
    SPND_EFF_DT DATE,
    SPND_TRMN_DT DATE,
    SPND_USER_ID CHAR(8),
    CMPLN_AGT_ID CHAR(10),
    TOTAL_CWA DECIMAL(17),
    TOTAL_CWA_DT DATE,
    DELIVERY_DT DATE,
    REINSURED_CDE CHAR(1),
    SERV_AGENCY CHAR(10),
    ST_CODE CHAR(1),
    NFO_RULE CHAR(1),
    CSTAT_REASN_CD CHAR(2),
    REJ_REASN_CD CHAR(2)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY external_dir_clmlog
    ACCESS PARAMETERS
    records delimited by newline
    BADFILE external_dir_clmlog:'VILFPM1.BAD'
    LOGFILE external_dir_clmlog:'VILFPM1.LOG'
    fields terminated by '!'
    missing field values are null
    --Column and format setting
    COMP_NO,
    POL_NO,
    WRITING_AGENCY_NO_1,
    WRITING_AGENT_NO_1,
    WRITING_AGENCY_NO_2,
    WRITING_AGENT_NO_2,
    POL_STS_CDE,
    STS_CHNG_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    POL_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_UP_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_TO_DTE,
    MATURE_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_MODE_CDE,
    PAY_METHOD_CDE,
    MODAL_PREM_AMT,
    POL_CUR,
    NFO_CDE,
    DIVD_OPTION_CDE_1,
    DIVD_OPTION_CDE_2,
    OTHER_OPTION_CDE_1,
    OTHER_OPTION_CDE_2,
    RESTRICT_CDE,
    NEXT_MODAL_PREM,
    SUSPEND_CDE,
    EXTRACT_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    REASON_CDE,
    LINE_OF_BUSS,
    BILL_TO_DTE,
    DUE_DAY,
    DAY_USE,
    PAR_TYPE,
    ISSUE_STATE,
    MED_CDE,
    RACE_CDE,
    ADMIT_CDE,
    REPT_STATE,
    COLL_OFF,
    WRITING_AGENCY,
    LAST_ANN_PROC,
    TIMESTAMP CHAR date_format DATE Mask "yyyy-mm-dd-hh24.mi.ss.ffffff",
    SPND_EFF_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_TRMN_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_USER_ID,
    CMPLN_AGT_ID,
    TOTAL_CWA,
    TOTAL_CWA_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    DELIVERY_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    REINSURED_CDE,
    SERV_AGENCY,
    ST_CODE,
    NFO_RULE,
    CSTAT_REASN_CD,
    REJ_REASN_CD
    LOCATION (external_dir_clmxcom:'VILFPM1.DAT')
    DB version :
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    OS version :
    SUSE Linux Enterprise Server 11 (x86_64)
    VERSION = 11
    PATCHLEVEL = 1
    Linux KAITLSDS01 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux
    ---------------------------------------------------------------------------------------------------------------------------------------

    Pl see MOS Doc 302672.1 (Select From External Table Gives ORA-29913 ORA-29400 KUP-554 KUP-1005)
    Srini

  • Oracle External Table SELECT FROM problem from workstation

    At Solaris Oracle database server console.
    Created directory on the Solaris server as Oracle owner.
    As SYS created oracle directory object on that Solaris directory
    Granted read/write to SCHEMA_OWNER on that oracle directory object.
    Using OS Oracle user, moved a tab-delimited flat file into the Solaris directory.
    Logged on a SCHEMA_OWNER using SQLPLUS on the Solaris database server.
    Ran external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    Appropriate dataset returned.
    So at the Oracle Solaris server console,
    the create external table script worked without errors,
    and a select from statement on the external table worked without errors.
    Move to developer workstation:
    Logged on as SCHEMA_OWNER using SQLPLUS on Windows workstation.
    TNSNAMES of course points to the Solaris database server.
    Ran the external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    This failed with these errors:
    ORA29913 error executing ODCIEXTTABLEOPEN callout
    ORA29400 data cartridge error
    cant open logfile.log
    OS permission denied
    ORA06512 sys.oracle_loader line 19
    So how can I select from external tables from a windows workstation?
    Any guidance on this problem would be appreciated.

    Thank you for your response.
    I am not creating the external table on the workstation.
    In both cases,
    from the Solaris console
    and from the Windows workstation
    the external table is being created on the Solaris file system
    in an Oracle Directory object
    running an SQL script from SQLPLUS prompt.
    The external table creator, schema owner, has read and write permissions
    granted by SYS on the oracle directory object.
    The problem is:
    Logged in as the schema owner,
    you can select * from ext_table from the Solaris console SQLPLUS,
    but you can not select * from ext_table from the Windows workstation SQLPLUS.
    You can DROP TABLE ext_table from the Windows workstation SQLPLUS.
    You just cannot select * from ext_table from the Windows workstation SQLPLUS.
    I guess as a test,
    I can drop from the ext_table creation script the references
    to discardfile, badfile, and logfile,
    and remove this other file objects from the equation...
    which appears to be a file permissions problem.

  • Error when i fetch the external table in oracle 9i ?

    External table is created.
    But, when i select the external table , it is thrwing the following error.
    I have given READ and WRITE permission to the oracle directory.
    And, i having the flat file with comma delimited data.
    SQL> create table mohan_ext (
    2 EMPNO NUMBER(5) ,
    3 JOB VARCHAR2(15),
    4 SALARY NUMBER(8,2),
    5 MGR NUMBER(5) ,
    6 HIREDATE DATE,
    7 DEPTNO NUMBER(5)
    8 )
    9 organization external
    10 (type oracle_loader
    11 default directory ext_dir
    12 access parameters (records delimited by newline
    13 fields terminated by ','
    14 missing field values are null
    15 (
    16 EMPNO NUMBER(5:5) ,
    17 JOB VARCHAR2(15:15),
    18 SALARY NUMBER(8,2:8,2),
    19 MGR NUMBER(5:5) ,
    20 HIREDATE DATE,
    21 DEPTNO NUMBER(5:5)
    22 )
    23 )
    24 LOCATION('flat.txt'));
    Table created.
    SQL> select * from mohan_ext;
    select * from mohan_ext
    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 "identifier": expecting one of: "comma, char, date, defaultif,
    decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ),
    unsigned, varrawc, varchar, varraw, varcharc, zoned"
    KUP-01008: the bad identifier was: NUMBER
    KUP-01007: at line 5 column 11
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

    You may need to scrub some of the data prior to using it as an external table. For instance, ensure that you do not have any extra commas lingering around somewhere within the data as this could cause mapping issues with the data. I've used this process hundreds of times, and more often than not there is an extra comma somewhere that is causing the issue.

  • External Table Question

    I created the external table ext_sftm (see create statement below) and it worked until I added MISSING FIELD VALUES ARE NULL.
    Now when I run SELECT * FROM EXT_SFTM I get the following errors. [1]: (Error): 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 "missing": expecting one of: "exit, (" KUP-01007: at line 10 column 5 ORA-06512: at "SYS.ORACLE_LOADER", line 14 ORA-06512: at line 1
    What am I doing wrong?
    CREATE TABLE ext_sftm
    (map_id NUMBER(38,0),
    source_id NUMBER(38,0),
    member_acis VARCHAR2(20),
    source_facility_code VARCHAR2(50),
    source_facility_name VARCHAR2(100),
    source_facility_address VARCHAR2(40),
    source_facility_city VARCHAR2(30),
    source_facility_state CHAR(2),
    source_facility_zip VARCHAR2(10),
    source_name VARCHAR2(100))
    ORGANIZATION EXTERNAL (
    DEFAULT DIRECTORY DCS_DIR
    ACCESS PARAMETERS(RECORDS DELIMITED BY NEWLINE CHARACTERSET WE8ISO8859P1
    BADFILE 'DCS_DIR':'SFTM.bad'
    LOGFILE 'SFTM.log'
    READSIZE 1048576
    SKIP 1
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    REJECT ROWS WITH ALL NULL FIELDS
    MISSING FIELD VALUES ARE NULL
    LOCATION (
    DCS_DIR:'SFTM.csv'
    REJECT LIMIT UNLIMITED
    /

    According to Metalink note:
    Subject:      Select from external table gives ORA-29913 ORA-29400 KUP-00554 KUP-01005
         Doc ID:      Note:302672.1      Type:      PROBLEM
         Last Revision Date:      22-APR-2005      Status:      MODERATED
    This is an syntax error dues to wrong order of field definitions and record format info.
    I suspect something wrong with this line:
    REJECT ROWS WITH ALL NULL FIELDSSee following syntax diagram:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/img_text/et_fields_clause.htm
    Message was edited by:
    Pierre Forstmann
    Message was edited by:
    Pierre Forstmann

  • Os error in external tables in oracle 9i

    hi, iam geting the following err when selecting the external table.
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file log.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    my script for the external table is as follows
    CREATE OR REPLACE DIRECTORY EXT_data AS 'f:\kindle\daily\zippedfiles\';
    CREATE OR REPLACE DIRECTORY EXT_log AS 'd:\2.fin2004\1.sqlloader\3.logentries\thd0\log';
    CREATE OR REPLACE DIRECTORY EXT_bad AS 'd:\2.fin2004\1.sqlloader\3.logentries\thd0\bad';
    grant read, write on directory EXT_data to fincon1;
    grant read, write on directory EXT_log to fincon1;
    grant read, write on directory EXT_bad to fincon1;
    CREATE TABLE THD0_DATA1
    STATUS_CHARACTER               char(1),
    ACCOUNT_NUMBER                    VARchar(13),
    NODEF1                         VARchar(7),
    TRANSACTION_COUNTER               VARCHAR(5)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ext_data
    ACCESS PARAMETERS
         RECORDS DELIMITED BY '@'
         badfile ext_bad:'bad.bad'
         logfile ext_log:'log.log'
    FIELDs
    STATUS_CHARACTER          ,
    ACCOUNT_NUMBER          ,
    NODEF1               ,
    TRANSACTION_COUNTER     
    LOCATION ('thd0data.dat')
    REJECT LIMIT UNLIMITED
    how to rectify the above error.
    thanks and regards
    S. Djeanthi

    If you have oracle metalink support then refer to Note:150737.1. If no support, i can paste it send to your email id.

  • Use of External tables to load XML data.

    Hi,
    I have used external table definitions to load various XML files to the database, usually splitting the XML into seperate records - 1 per major element tag, and using PL/SQL to parse out a primary key to store in a relational table with all of the XML relevant to that primary key value stored as an XMLTYPE coumn in a row of the table. This has worked fine for XML with a single major entity (element tag) .
    However, I now have an XML file that contains two "major" elements (both children of the root) that I would like to split out and store in seperate tables.
    The XML file is of the following basic format:-
    <drugs>
    <drug>drug 1...</drug>
    <drug>drug 2...</drug>
    <partners>
    <partner>partner 1</partner>
    <partner>partner 2</partner>
    </partners>
    </drugs>
    The problem is there are around 18000 elements of the first type, followed by several thousand of the 2nd type. I can create two seperate external tables - one for each element type, but how do I get the external table for the 2nd to ignore all the elements of the first type? My external table definition is :-
    CREATE TABLE DRUGBANK_OWNER.DRUGBANK_PARTNERS_XML_EXTERNAL
    DRUGBANK_XML CLOB
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DRUGBANK_DIR
    ACCESS PARAMETERS
    ( records delimited by "</partner>" SKIP 100000
    characterset al32utf8
    badfile extlogs:'drugbank_partners_xml.bad'
    logfile extlogs:'drugbank_partners_xml.log'
    discardfile extlogs:'drugbank_partners_xml.dis'
    READSIZE 52428800
    fields
    drugbank_xml CHAR(50000000) terminated by '</partners>'
    LOCATION (DRUGBANK_DIR:'drugbank.xml')
    REJECT LIMIT UNLIMITED
    PARALLEL ( DEGREE 8 INSTANCES 1 )
    NOMONITORING;
    The problem is that before the first <partners> element the 1800 or so <drugs> elements cause a data cartrdige error:-
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 52428800
    This happens regardless of the value of the SKIP or the size of the drugbank_xml field.
    I have tried using an OR on the "records delimited by" access parameter, to 'delimit by "</partner>" OR "</drug>"', with the intention of filtering out the <drug> elements but this leads to a syntax error.
    Anyone ever tried anything similar and got it to work?
    Any other suggestions?
    Thanks,
    Sid.

    No, the content inside quotes is spanned across multiple lines....there are line breaks after every html tag.
    "What's the error message you are getting?"
    Iam not getting any error while selecting from external table , but I am getting tose rows in BAD file and log file has the following entries
    KUP-04021: field formatting error for field TKBS_DSCN
    KUP-04036: second enclosing delimiter not found
    Message was edited by:
    user627610

  • External Table Loads - Insufficient Privs

    Hi...please advise:
    Facts:
    1. I have 2 schemas: SCHEMA_A and SCHEMA_B
    2. I have an oracle directory 'VPP_DIR' created under SCHEMA_A and granted WRITE and READ on the dir to SCHEMA_B.
    3. The physical dir on the unix server to which VPP_DIR points has read, write, execute privs for the Oracle user.
    4. I have a procedure in SCHEMA_A (CET_PROC) which dynamically creates the external table with parameters passed to it like directory_name, file_name, column_definitions, load_when_clause etc.
    5. The CET_PROC also does a grant SELECT on external table to SCHEMA_B once it is created.
    6. SCHEMA_B has EXECUTE privs to SCHEMA_A.CET_PROC.
    7. SCHEMA_B has a proc (DO_LOAD_PROC) that calls SCHEMA_A.CET_PROC.
    At the point where SCHEMA_A.CET_PROC tries to do the EXECUTE_IMMEDIATE command with the create table code, it fails with "ORA-01031: insufficient privileges"
    If I execute SCHEMA_A.CET_PROC from within SCHEMA_A with the same parameters it works fine.
    If I create CET_PROC inside SCHEMA_B and execute this version from within SCHEMA_B it works fine.
    From accross schemas, it fails. Any advice...please?

    Works for me without CREATE ANY TABLE.
    I found it easier to follow the permissions if I replaced SCHEMA_A and SCHEMA_B with OVERLORD and FLUNKY.
    /Users/williamr: cat /Volumes/Firewire1/william/testexttable.dat
    1,Eat,More,Bananas,TodayAs SYS:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Account: SYS@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> CREATE USER overlord IDENTIFIED BY overlord                         
      2  DEFAULT TABLESPACE users QUOTA UNLIMITED ON users ACCOUNT UNLOCK;
    User created.
    SQL> CREATE USER flunky IDENTIFIED BY flunky
      2  DEFAULT TABLESPACE users QUOTA UNLIMITED ON users ACCOUNT UNLOCK;
    User created.
    SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE TO overlord,flunky;
    Grant succeeded.
    SQL> GRANT READ,WRITE ON DIRECTORY extdrive TO overlord;
    Grant succeeded.As OVERLORD:
    Account: OVERLORD@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> get afiedt.buf
      1  CREATE OR REPLACE PROCEDURE build_xt
      2      ( p_data OUT SYS_REFCURSOR )
      3  AS
      4      v_sqlstr VARCHAR2(4000) := q'|
      5          CREATE TABLE test_xt
      6          ( id   NUMBER(8)
      7          , col1 VARCHAR2(10)
      8          , col2 VARCHAR2(10)
      9          , col3 VARCHAR2(10)
    10          , col4 VARCHAR2(10) )
    11          ORGANIZATION EXTERNAL
    12          ( TYPE oracle_loader
    13            DEFAULT DIRECTORY extdrive
    14            ACCESS PARAMETERS
    15            ( RECORDS DELIMITED BY newline
    16              BADFILE 'testexttable.bad'
    17              DISCARDFILE 'testexttable.dsc'
    18              LOGFILE 'testexttable.log'
    19              FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    20              ( id, col1, col2, col3, col4 ) )
    21           LOCATION ('testexttable.dat') )
    22           |';
    23  BEGIN
    24      EXECUTE IMMEDIATE v_sqlstr;
    25      OPEN p_data FOR 'SELECT * FROM test_xt';
    26* END build_xt;
    27 
    28  .
    SQL> @afiedt.buf
    Procedure created.
    SQL> grant execute on build_xt to flunky;
    Grant succeeded.
    SQL> -- Prove it works:
    SQL> var results refcursor
    SQL>
    SQL> exec build_xt(:results)
    PL/SQL procedure successfully completed.
            ID COL1       COL2       COL3       COL4
             1 Eat        More       Bananas    Today
    1 row selected.
    SQL> drop table test_xt purge;
    Table dropped.As FLUNKY:
    Account: FLUNKY@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> SELECT * FROM user_sys_privs;
    USERNAME                       PRIVILEGE                                ADM
    FLUNKY                         CREATE TABLE                             NO
    FLUNKY                         CREATE SESSION                           NO
    FLUNKY                         CREATE PROCEDURE                         NO
    3 rows selected.
    SQL> var results refcursor
    SQL>
    SQL> exec overlord.build_xt(:results)
    PL/SQL procedure successfully completed.
            ID COL1       COL2       COL3       COL4
             1 Eat        More       Bananas    Today
    1 row selected.

  • Accesing windows files using oracle unix external tables.

    Hi, I'm trying to access files on windows2k using oracle external tables on unix:
    Oracle server on unix: oracle ver. is 9.2.0.6 and OS is 5.8 Generic_117000-03 sun4u sparc SUNW,Sun-Fire
    1. Created dir object on oracle unix pointing to windows path
    2. created user
    3. Assigned read and write privs on dir to user
    4. created external table using dir step 1
    5. select on external table
    When I FTP the files into unix and recreate dir object, it works, but if I point dir object into windows path, it fails.
    Is possible to do this?
    Tks
    GAP

    Hi
    The directory object must be accesible to your Database server, so if the Database is in unix you must create the directory in unix.
    I don´t know software that allow unix systems to see a windows file system. Maybe windows can see unix from a samba server or NFS.

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

Maybe you are looking for