Sqlloader Vs external Tables

HII All,
Currently, we use sqlloader. But now we are stuck to the top with a question. The problem is that in our production environment that they have installed customer sqlldr in the application server and the feed file in place in the Oracle server machine.

We tried everything to stay with sqlloader but nothing works very well. I tried with ftp to transfer the file from Oracle server to the client machine, but we use the secure port it did not work.

But this was easily accomplished using external table that the file is located in the server. But now I need to satisfy my clients by proving the external tables are relatively better.

I have google for Sqlloader vs. external this debate.

But I found no strong points supporting external tables.

I had also gone through the following links

http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:6611962171229

http://www.orafaq.com/Usenet/comp.databases.Oracle.misc/2007/02/13/0222.htm

So please help me by providing some plus points and other links.

Concerning
Rambeau

792353 wrote:
Yes, it's really a good point, but can be achieved once the data has been pumped into staging tables.

Who would take more space on the database, while the external tables you can do anything as the data is read. External tables would seem better in this regard.

And now, we are not concerned with all the functions for use in DEC.

People argue with me if we use external tables, we need create objects 2 db (1 external and more temporary table) which is just 1 intermediate table if sqlloader.

You only need the external table definition. If you create a temporary table with this depends on your needs and the need to have such a table "staged." Even if you did in SQL * Loader you would always create a staging table, if there is really no difference...

External table = 1 table definition and no data loaded in the database
SQL * Loader = 1 table and the data loaded into the database

Also read that when the feed file is huge its better to opt for sqlloader as it can circumvent sql analysis by choosing a DIRECT approach. Isisnt it?

External tables using SQL * Loader under the hood engine, so there is no real difference except where you want to keep your data (in the file, or load a copy first on the database). You can use the parallel with external tables to load using multiple threads, you can use the indicator append to load the data as in the direct approach of sql * loader.

So, kindly suggest me which is the best approach in a long-term process.

In the long term, the external tables are the best approach. They were introduced after SQL * Loader to provide an improved mechanism. If they were not better, Oracle would not have taken the trouble with them. They also have the advantage that the control of their use is on the database, i.e. no need to control files, no need to run a command-line utility, not two floors (loading then treatment) treatment.

There is no real reason for the use of SQL * Loader everything but more, the strange unique circumstance where you need to download data from a client computer (which will raise the question why a client machine has data on it in the first place!)

Tags: Database

Similar Questions

  • Using the external table error

    Hi all

    This is the first time I use the external table for loading the data.

    I did these steps

    In the D:\sqlloade folder, I have my text file containing data example.txt

    I ran these queries

    CREATE OR REPLACE DIRECTORY  ext_tab_data AS 'D:\sqlloader';
    
    

    Directory created

    CREATE TABLE fxops.t_ext (
    t number
    )
    ORGANIZATION EXTERNAL (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY ext_tab_data
      ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        MISSING FIELD VALUES ARE NULL
        (
         t number
        )
      )
      LOCATION ('sample.txt')
    )
    PARALLEL 5
    REJECT LIMIT UNLIMITED;
    
    

    create table

    When I tried to create a view on that table, he throws an error

    CREATE OR REPLACE VIEW fxops.t_view  AS
      SELECT *
      FROM   fxops.t_ext;
    
    SQL Error: ORA-06564: object EXT_TAB_DATA does not exist
    06564. 00000 -  "object %s does not exist"
    *Cause:    The named object could not be found.  Either it does not exist
               or you do not have permission to access it.
    *Action:   Create the object or get permission to access it.
    
    

    Sign in, and then run this:

    Select HOST_NAME from v$ instance;

    is this the same hostname that you are connected?

    Kind regards

    Harry

  • How to specify a constant value in the external tables?

    Create table cp_portfolio_ext
    (
    rec_type                                                varchar2(1),
    acct_nbr                                                varchar2(23),
    acct_title                                              varchar2(50),
    prod_type_cd                                            varchar2(5),
    acct_desc                                               varchar2(35),
    country_code                                            varchar2(2),
    acct_ref_ccy_cd                                         varchar2(3),
    nom_accr_int_amt                                        number(20,4),
    ineligible_cash                                         number(20,4),
    pldg_amt                                                number(20,4),
    posn_as_of_dt                                           date,
    moody_rating                                            varchar2(5),
    sp_rating                                               varchar2(4),
    mat_dt                                                  date,
    anl_pct_rt                                              number(20,6),
    acct_pp_cd                                              varchar2(10),
    filler                                                  varchar2(229),
    process_status                                                  char(1)
    )
    Organization External
    (
    type                    oracle_loader
    default directory     TEST_DIR
    access parameters
                        (
                             records delimited by newline
                             fields
                                  (
                                  REC_TYPE                            POSITION(1:1),
                                  ACCT_NBR                            POSITION(2:24),
                                  ACCT_TITLE                          POSITION(25:74),
                                  PROD_TYPE_CD                        POSITION(75:79),
                                  ACCT_DESC                           POSITION(80:114),
                                  COUNTRY_CODE                        POSITION(115:116),
                                  ACCT_REF_CCY_CD                     POSITION(117:119),
                                  NOM_ACCR_INT_AMT                    POSITION(120:139),
                                  INELIGIBLE_CASH                     POSITION(140:159),
                                  PLDG_AMT                            POSITION(160:179),
                                  POSN_AS_OF_DT                       POSITION(180:187) DATE "DDMMYYYY" NULLIF POSN_AS_OF_DT ='00000000',
                                  MOODY_RATING                        POSITION(188:192),
                                  SP_RATING                           POSITION(193:196),
                                  MAT_DT                              POSITION(197:204) DATE "DDMMYYYY" NULLIF MAT_DT = '00000000',
                                  ANL_PCT_RT                          POSITION(205:215),
                                  ACCT_PP_CD                          POSITION(216:225),
                                  FILLER                              POSITION(226:454),
                                  process_status               
                                  )
                        )
    location('ODS_CP_DAILY_EXTRACT.DAT')
    )reject limit unlimited;
    I won't receive flow file process_status, but I would like to have a value by default "n" must be provided. How to get there? I tried to use defaultif, but it does not work it.

    I know that you donw with the CONSTANT Keywork using sqlloader. But what in external tables. ??

    Published by: 792353 on September 30, 2010 21:21

    I think it should useful to you

    http://Jiri.WordPress.com/2010/03/29/Oracle-external-tables-by-examples-part-4-column_transforms-clause-load-CLOB-BLOB-or-any-constant-using-external-tables/

    Iqbal

  • Doubt of external Table

    Hi Master,

    Using Sql * Loader I can load the dat/csv/txt data to oracle tables. I can use it when clause contained in the data file and load control in different tables.

    e.g. when deptno = 20 then table 1. Where deptno = 10 then table2 etc...

    But using the external table... How can I load data in different tables as an example above? I googled. but do not get appropriate information. Please advise... !!

    Concerning

    AR

    Bad code. You use positional WHEN when you define variable length fields. As a result, your code will load Department 201, 2090,...:

    SQL > create table T_DEPTNO_20)

    NUMBER 2 DEPTNO,

    3 DNAME VARCHAR2 (14).

    LOC 4 VARCHAR2 (13)

    5)

    6 EXTERNAL ORGANIZATION

    () 7

    ORACLE_LOADER TYPE 8

    9 DEFAULT TEMP DIRECTORY

    10 ACCESS SETTINGS

    (11)

    12 RECORDS DELIMITED BY NEWLINE

    13 CHARGE WHEN (1:2) = "20"

    14 LOGFILE 'MyFile.log.

    15 BADFILE "MyFile.bad."

    16 NODISCARDFILE

    17 FIELDS TERMINATED BY ', '.

    18 EVENTUALLY FRAMED BY "" "

    RTRIM 19

    20 MISSING FIELD VALUES ARE NULL

    (21)

    22 DEPTNO,

    23 DNAME,

    LOC 24

    25)

    26)

    27 RENTAL ("MyFile.csv")

    28)

    RELEASE 29 UNLIMITED LIMIT

    30.

    Table created.

    SQL > select * from T_DEPTNO_20

    2.

    DEPTNO DNAME LOC

    ---------- -------------- -------------

    SEARCH 20 DALLAS

    201 DO NOT LOAD ARMPIT

    SQL > drop table T_DEPTNO_20

    2.

    Deleted table.

    SQL > create table T_DEPTNO_20)

    NUMBER 2 DEPTNO,

    3 DNAME VARCHAR2 (14).

    LOC 4 VARCHAR2 (13)

    5)

    6 EXTERNAL ORGANIZATION

    () 7

    ORACLE_LOADER TYPE 8

    9 DEFAULT TEMP DIRECTORY

    10 ACCESS SETTINGS

    (11)

    12 RECORDS DELIMITED BY NEWLINE

    13 CHARGER WHEN deptno = '20'

    14 LOGFILE 'MyFile.log.

    15 BADFILE "MyFile.bad."

    16 NODISCARDFILE

    17 FIELDS TERMINATED BY ', '.

    18 EVENTUALLY FRAMED BY "" "

    RTRIM 19

    20 MISSING FIELD VALUES ARE NULL

    (21)

    22 DEPTNO,

    23 DNAME,

    LOC 24

    25)

    26)

    27 RENTAL ("MyFile.csv")

    28)

    RELEASE 29 UNLIMITED LIMIT

    30.

    Table created.

    SQL > select * from T_DEPTNO_20

    2.

    DEPTNO DNAME LOC

    ---------- -------------- -------------

    SEARCH 20 DALLAS

    SQL >

    SY.

  • external table

    Hello

    I try to get data by using the external table as follows

     create table nfs_acq
     (
      Participant_ID                            char( 3         ),
      Transaction_Type                          char( 2         ),
      From_Account_Type                         char( 2         ),
      To_Account_Type                           char( 2         ),
      Trans_srno                                char( 12        ),
      Response_Code                             char( 2         ),
      PAN_Number                                char( 19        ),
      Member_Number                             char( 1         ),
      Approval_Number                           char( 6         ),
      System_Trace_Number                char( 12       ),
      Transaction_Date                           char( 6        ),
      Transaction_Time                           char( 6        ),
      Merchant_Category_Code                     char( 4        ),
      Card_Acceptor_S_Date                       char( 6        ),
      Card_Acceptor_ID                           char( 15       ),
      Card_Acceptor_t_ID                         char( 8        ),
      Card_Acceptor_t_Location           char( 40       ),
      Acquirer_ID                                char( 11       ),
      Acquirer_Settlement_Date                   char( 6        ),
      Transaction_Currency_code                  char( 3        ),
      Transaction_Amount                         char( 15       ),
      Actual_Transaction_Amount                  char( 15       ),
      Transaction_Acitivity_fee                  char( 15       ),
      Acquirer_Cur_Code                         char( 3         ),
      Acquirer_s_Amount                         char( 15        ),
      Acquirer_Settlement_Fee                    char( 15       ),
      Acquirer_settl_proc_fee                   char( 15        ),
      Tran_Acq_Conv_Rate                        char( 15        )
     )
     --
            ORGANIZATION EXTERNAL
             ( TYPE ORACLE_LOADER
               DEFAULT DIRECTORY HRK_NEW
               ACCESS PARAMETERS
               ( RECORDS fixed 274
           skip 1
             FIELDS (
     --
      Participant_ID                            char( 3         ),
      Transaction_Type                          char( 2         ),
      From_Account_Type                         char( 2         ),
      To_Account_Type                           char( 2         ),
      Trans_srno                                char( 12        ),
      Response_Code                             char( 2         ),
      PAN_Number                                char( 19        ),
      Member_Number                             char( 1         ),
      Approval_Number                           char( 6         ),
      System_Trace_Number                       char( 12       ),
      Transaction_Date                           char( 6        ),
      Transaction_Time                           char( 6        ),
      Merchant_Category_Code                     char( 4        ),
      Card_Acceptor_S_Date                       char( 6        ),
      Card_Acceptor_ID                           char( 15       ),
      Card_Acceptor_t_ID                         char( 8        ),
      Card_Acceptor_t_Location                   char( 40       ),
      Acquirer_ID                                char( 11       ),
      Acquirer_Settlement_Date                   char( 6        ),
      Transaction_Currency_code                  char( 3        ),
      Transaction_Amount                         char( 15       ),
      Actual_Transaction_Amount                  char( 15       ),
      Transaction_Acitivity_fee                  char( 15       ),
      Acquirer_Cur_Code                         char( 3         ),
      Acquirer_s_Amount                         char( 15        ),
      Acquirer_Settlement_Fee                    char( 15       ),
      Acquirer_settl_proc_fee                   char( 15        ),
      Tran_Acq_Conv_Rate                        char( 15        )
     )
                       )
                                 LOCATION ('
           ACQRPKJB110116.mkjb')
          )
     reject limit unlimited
    /
    

    table design

    However

    When I select data from table, I get below error

    ORA-29913: error in executing ODCIEXTTABLEOPEN legend

    ORA-29400: data cartridge error

    KUP-00554: error occurred when parsing the access settings

    KUP-01005: syntax error: found 'minussign': expected an a: 'double-quoted-string, identifier, single-quoted-string '.

    KUP-01007: in column 2 line 4

    29913 00000 - "error in the execution of %s legend".

    * Cause: The execution of the specified legend caused an error.

    * Action: Examine the error messages take appropriate measures.

    This is a sequential I am trying to import

    KJB0403 4643470817234643471601110731336011160111ATM00201 001107001303004213191476009651 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000070000000000000070000000000000000000356000000000070000000000000000000000000000000000000001000000000 CHOWK

    KJB0503 0174520817337281611601110956246011160111ATM00201 001109001320004293932011713114 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000000000000000000000000000000000000000356000000000000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 0176940817339062491601110957576011160111ATM00201 001109001321004293932011713114 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000050000000000000050000000000000000000356000000000050000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 8653240817340573261601110959156011160111ATM00201 001109001322004722554560104882 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000320000000000000320000000000000000000356000000000320000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 4459000817360340861601111015066011160111ATM00201 001110001326005044372611412016 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000001000000000000001000000000000000000000356000000001000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 6468820817392369431601111037426011160111ATM00201 001110001335004214090575031872 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000100000000000000100000000000000000000356000000000100000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 9133280817459788951601111119146011160111ATM00201 001111001359006074194560106006 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000600000000000000600000000000000000000356000000000600000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 1985030817481985031601111131596011160111ATM00201 001111001362005360160500127597 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000001000000000000001000000000000000000000356000000001000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 4400820817484400821601111133216011160111ATM00201 001111001363004213371215519505 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000200000000000000200000000000000000000356000000000200000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 0817491361901601111137166011160111ATM00201 001111001366044135083790012559 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000300000000000000000000000000000000000356000000000000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 6891010817496562841601111140096011160111ATM00201 001111001368004214090322036455 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000050000000000000050000000000000000000356000000000050000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 1310430817509973121601111147346011160111ATM00201 001111001371004689680028170636 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000001000000000000001000000000000000000000356000000001000000000000000000000000000000000000000001000000000 CHOWK

    KJB0503 0309320817544106971601111206046011160111ATM00201 001112001375005296160001593353 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000000000000000000000000000000000000000356000000000000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 0322130817546216041601111207116011160111ATM00201 001112001376005296160001593353 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000700000000000000700000000000000000000356000000000700000000000000000000000000000000000000001000000000 CHOWK

    KJB0502 8851180817548851181601111208376011160111ATM00201 001112001377005087530341448208 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000000000000000000000000000000000000000356000000000000000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 0566530817550566531601111209336011160111ATM00201 001112001378005087530341448208 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000420000000000000420000000000000000000356000000000420000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 6943770817556943771601111213006011160111ATM00201 001112001379004214920342912709 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000050000000000000050000000000000000000356000000000050000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 7864780817559532151601111214256011160111ATM00201 001112001380006220180039900075266 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000330000000000000330000000000000000000356000000000330000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 1083880817581341641601111226086011160111ATM00201 001112001382004378990101766440 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000800000000000000800000000000000000000356000000000800000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 4830820817582764451601111226546011160111ATM00201 001112001383006071600100041514 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000700000000000000700000000000000000000356000000000700000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 6286600817597510771601111234376011160111ATM00201 001112001386005326760302103432 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000100000000000000100000000000000000000356000000000100000000000000000000000000000000000000001000000000 CHOWK

    KJB0402 0029180817604353121601111238126011160111ATM00201 001112001389004704560203009224 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000001000000000000001000000000000000000000356000000001000000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 3000000817608080441601111240116011160111ATM00201 001112001390005044339052564987192 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000400000000000000400000000000000000000356000000000400000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 0139290817626145271601111249456011160111ATM00201 001112001396005346800000069646 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000900000000000000900000000000000000000356000000000900000000000000000000000000000000000000001000000000 CHOWK

    KJB0403 1126320817671162161601111313226011160111ATM00201 001113001406005196190081887558 ATM00201TILAK KALYAN THANE MHIN800044 160111356000000000020000000000000020000000000000000000356000000000020000000000000000000000000000000000000001000000000 CHOWK

    Help, please

    External table reference...

    Comments are lines that start with two dashes followed text. Comments must be placed before all access settings, for example:

    access_parameters Clause

    
    The access parameters clause contains comments, record formatting, and field formatting information. The syntax for the access_parameters clause is as follows:
    
    Text description of the illustration et_access_parameter.gif
    
    
    
    

    Comments

    
    Comments are lines that begin with two dashes followed by text. Comments must be placed before any access parameters, for example:
    
    
    --This is a comment
    --This is another comment
    RECORDS DELIMITED BY NEWLINE
    
    
     
    
  • The external Table storage

    Since data is stored outdoors, and the definition that is stored inside, it means that a the table structure of the outer table is stored in the database as well (or a virtual table based on the definition of the external table...)

    I'll hit the ORA-DOCS again once, back in the external tables read tonight on them 2 or 3 sources and it is not quite clear whether real data with structure exists outside the database or an internal table set (and stored) retrieves data from an outside source.

    Since data is stored outdoors, and the definition that is stored inside, it means that a the table structure of the outer table is stored in the database as well (or a virtual table based on the definition of the external table...)

    The 'definition' you refer to IS the structure of the table; they are one and the same. There is no 'table' stored in the database using space or storage. When a query on an external table is executed, the data source is read.

    
    I'll be hitting the ORA-DOCS up again, just got back into external tables tonight reading up on them from 2-3 sources and it is not quite clear if an actual data with structure exists out of the database , or an internally defined (and stored?) table draws data from an outside source.
    

    I suggest you that start with the documentation of Oracle - including the ground provided the link to:

    If any "metadata" are stored outside the database depends on if the file that is outside of the database was produced by Oracle using the robot UNLOADING discussed in this doc

    Unloading of data using ORACLE_DATAPUMP Access driver

    To unload data, you use the ORACLE_DATAPUMP driver access. The stream that is discharged is in a proprietary format and contains all of the data column for each row being unloaded.

    A discharge operation also creates a stream of metadata that describes the content of the data stream. The information in the metadata stream are required to load the stream. Therefore, the metadata stream is written to the file data and placed before the data stream.

    If YOU provide data/files, then you MUST provide it in the format expected by the external table statement. You can, if you wish, use a preprocessor to convert ANY file (zip, encrypted, etc.) in the required format.

    For YOUR files, you can the metadata stored in the same file, or elsewhere, if you choose, but Oracle will have NO knowledge of this fact and not will NOT be involved in the transformation or read any of the metadata that you provide. Your preprocessor must remove all these metadata and ONLY provide data in the format appropriate for Oracle to use.

    If the file was produced by the process of UNLOADING Oracle then it will include metadata that Oracle WILL read, use, and remove as says this quote from doc above. These external metadata is added to the real external table definintion/metadata stored in the dictionary.

  • ORA-29913 for external table on Windows 7

    Hello

    Please help with the following problem.

    I installed Oracle 11 g on Windows 7 Pro workstation and have created an external table.

    I'm getting an ORA-29913 when I select.

    What I did is given below.

    create the directory imp_files as 'C:\app\user\admin\orcl\dpdump\'-'C:\orcl_work '.
    ;

    drop table people
    ;
    create table people)
    first name varchar2 (250).
    VARCHAR2 (250) last_name,.
    hire_date date,
    number of salary
    )
    (external) Organization
    type oracle_loader
    the default directory data_pump_dir
    (settings) access
    records delimited by newline
    BadFile data_pump_dir: 'pers1%a_%p.bad' /*'pers.bad'*/
    data_pump_dir log file: "pers1%a_%p.log" /*'pers.log'*/
    fields termintated by ' |'
    missing field values are null
    (first_name, last_name, hire_date 'dd.mm.yyyy' format mask, salary)
    )
    location ("pers_table1.txt")
    )
    reject limit unlimited
    ;

    Hello

    you completed wrongly spelt...

    Try to fix that and try again.

    See you soon,.

    rich

  • error when reading flat file of external table... "ORA-01849: time must be between 1 and 12"

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Here is the data file I am trying to download...

    KSEA | 08-10 - 2015-17.00.00 | 83.000000 | 32.000000 | 5.800000

    KBFI | 2015-08-06 - 15.00.00 | 78.000000 | 35.000000 | 0.000000

    KSEA | 08-10 - 2015-11.00.00 | 73.000000 | 55.000000 | 5.800000

    KSEA | 08-08 - 2015-05.00.00 | 61.000000 | 90.000000 | 5.800000

    KBFI | 2015-08-06 - 16.00.00 | 78.000000 | 36.000000 | 5.800000

    KSEA | 2015-08-07 - 18.00.00 | 82.000000 | 31.000000 | 10.400000

    KSEA | 08-10 - 2015-00.00.00 | 65.000000 | 61.000000 | 4.600000

    KBFI | 08-08 - 2015-07.00.00 | 63.000000 | 84.000000 | 4.600000

    KSEA | 08-10 - 2015-15.00.00 | 81.000000 | 34.000000 | 8.100000

    This is the external table script

    CREATE TABLE MWATCH. MWATCH. WEATHER_EXT ".

    (

    LOCATION_SAN VARCHAR2 (120 BYTE),

    DATE OF WEATHER_DATETIME,

    NUMBER (16) TEMP.

    NUMBER (16) OF MOISTURE,

    WIND_SPEED NUMBER (16)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY METERWATCH

    ACCESS SETTINGS

    (records delimited by newline

    BadFile "METERWATCH": "weather_bad" logfile 'METERWATCH': 'weather_log '.

    fields ended by ' |' missing field values are null

    (location_san, WEATHER_DATETIME char date_format DATE mask "YYYY-mm-dd - hh.mi.ss", TEMPERATURE, MOISTURE, wind_speed)

    )

    LOCATION (METERWATCH: 'weather.dat')

    )

    REJECT LIMIT UNLIMITED

    PARALLEL (DEGREE 5 1 INSTANCES)

    NOMONITORING;

    Here is the error in the weather_bad which is generated files...

    column WEATHER_DATETIME of 55 error processing in the 1st row to the /export/home/camsdocd/meterwatch/weather.dat data file
    ORA - 01849ther_log.log 55 56 error processing column WEATHER_DATETIME in the row 1 for the /export/home/camsdocd/meterwatch/weather.dat data file
    5756 ORA - 01849ther_log.log: time must be between 1 and 12
    58column WEATHER_DATETIME 57 error during treatment number 2 for the /export/home/camsdocd/meterwatch/weather.dat data file
    59ORA-58 01849: time must be between 1 and 12
    60column WEATHER_DATETIME of 59 error processing 5th for the /export/home/camsdocd/meterwatch/weather.dat data file
    61ORA-60 01849: time must be between 1 and 12
    62column WEATHER_DATETIME of 61 error treatment in line 6 to the /export/home/camsdocd/meterwatch/weather.dat data file
    63ORA-62 01849: time must be between 1 and 12
    64column WEATHER_DATETIME of 63 error treatment in row 7 for datafile /export/home/camsdocd/meterwatch/weather.dat
    65ORA-64 01849: time must be between 1 and 12
    66column WEATHER_DATETIME of 65 error treatment 9 for the /export/home/camsdocd/meterwatch/weather.dat data file online
    67: time must be between 1 and 12

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Yes it is possible.  Let's not your date mask.  You're masking for 12-hour format when your data is in 24-hour format.  Change the mask of your date to be "YYYY-mm-dd-hh24. MI.ss ".  Notice the change in "BOLD".

  • External table with mixed columns

    Hello everyone. We use Oracle 11R1. We have an external table pointing to a CSV with 7 columns inside. The file has always column 7 but the column order differs from time to time. Each column has a header that remains consistent. Is there a way to map the column names to the column header, s so that we did not change the definition of the external table every time a new file is available in?

    Thank you.

    Hello

    As John said, you must assign names of columns when the table is created.  I guess you could have a dynamic SQL solution that reads the header you mentioned, uses this information to write a CREATE table, drop the table, and then recreated with the new order of the columns.

    You may have a view that maps the 7 columns in your table of 7 columns in the view.  Which column gets the mapping to that may depend on the header.

  • create an external table based on local drive

    Hello world

    Is it possible to create an external table and that it points to a file on my local drive?

    It is perhaps a silly question. I'm sorry.

    Thank you

    Lydiea

    In addition to the response of William Robertson (which is correct), if you do not have a way to make the server access to your local disk, you can use sql loader on your local computer to load the data into an actual table.

  • Load the XML file into Oracle external Table


    I load the data from the XML file into an intermediate table Oracle using external Tables.

    Let's say below, it is my XML file

    < header >
    < A_CNT > 10 < / A_CNT >
    < E_CNT > 10 < / E_CNT >
    < AF_CNT > 10 < / AF_CNT >
    < / header >
    < student >
    <>students-details
    < Student_info >
    < Single_Info >
    < ID > 18 / < ID >
    New York < City > < / City >
    < country > United States < / country >
    < Name_lst >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >
    Aware of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >

    < TerminationDt > 20050812 < / TerminationDt >
    History of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < / Name_lst >
    < Personal_Info >
    <>men < / Type >
    < 27 > < / Age >
    < / Personal_Info >
    < / Single_Info >
    < / Student_info >

    < student - register >
    class < A >
    < info >
    < detail >
    < ID student > 18 < / student >
    EE < major > < / Major >
    < course-Grades >
    < course > VLSI < / course >
    < degree > 3.0 < / Grade >
    < / course-Grades >
    < course-Grades >
    < course > nanotechnology < / course >
    < degree > 4.0 < / Grade >
    < / course-Grades >
    < / details >
    < detail >
    < ID student > 18 < / student >
    THIS < major > < / Major >
    < / details >
    < / info >
    class < A >
    < Student_Enrol >
    <>students-details
    < student >

    I load this XML data file into a single table using an external Table. Could someone help me please with coding.

    Thank you

    Reva

    Could you please help me how to insert my XML content into that.

    Same as before, try a plain old INSERT:

    insert into xml_pecos

    values)

    XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))

    );

    But you'll probably hit the same limitation as with the binary XMLType table.

    In this case, you can use FTP to load the file as a resource in the XML DB repository.

    If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.

    Could you post the exact statement that you used to save the scheme?

    In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:

    https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/

    And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672

  • Pretreatment of an external table - table is empty at the end

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    "CORE 11.2.0.1.0 Production."

    AMT for Solaris: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    Solaris 10 x 86

    I'm trying to create an external table that first pre-process a file and then the bed. The problem is that, in the end, the outer table is empty even if the read file is not empty.

    First, the table works gunzip on the 'employees.csv.gz' file located in/export/home/oracle/archives and then bed. The file employees.csv.gz exists in the specified location. This is the complete script:

    -This Directory keeps the archived files

    CREATE or REPLACE DIRECTORY arch_dir AS 'archives/export/home/oracle/archives";

    -This directory shows where the command gunzip

    CREATE or REPLACE the bin_dir AS DIRECTORY ' / usr/bin';

    CREATE TABLE emp_exadata

    (

    employee_id NUMBER (22, 0),

    first name VARCHAR2 (20).

    last_name VARCHAR2 (25).

    e-mail VARCHAR2 (25).

    Phone_Number VARCHAR2 (20).

    hire_date DATE,

    job_id VARCHAR2 (10),

    higher wages (22: 2),

    commission_pct NUMBER 22 (2)

    manager_id NUMBER (22, 0),

    department_id NUMBER (22, 0)

    )

    EXTERNAL ORGANIZATION

    (

    TYPE oracle_loader

    Arch_dir default DIRECTORY

    ACCESS SETTINGS

    (

    RECORDS delimited BY NEWLINE

    preprocessor bin_dir: "gunzip".

    end fields BY «»

    missing field VALUES are NULL

    (

    employe_id,

    first name,

    last_name,

    E-mail

    Phone_Number,

    hire_date CHAR date_format DATE mask "dd-mm-yyyy hh24:mi:ss."

    job_id,

    salary,

    commission_pct,

    manager_id,

    department_id

    )

    )

    LOCATION ("employees_exp.csv.gz")

    )

    REJECT LIMIT UNLIMITED;

    When I choose to emp_exadata the result set is empty!

    SELECT * FROM emp_exadata;

    no selected line

    When I look at the db server in the directory /export/home/oracle/archives I see no archived file employees_exp.csv. Here is the result of the first three lines:


    bash - $3.2-3 employees_exp.csv head

    198, Donald, Ollivier, DOCONNEL, 650.507.9833, 21/06/2007 00:00:00, SH_CLERK, 2600, 124, 50,.

    199, Douglas, grant, DGRANT, 650.507.9844, 2008-01-13 00:00:00, SH_CLERK, 2600, 124, 50,.

    200 Jennifer Whalen, JWHALEN 515.123.4444, 17/09/2003 00:00:00, AD_ASST, 4400, 101, 10.

    The end of the lines in the file line is LF (unix style). The encoding is in ANSI format.

    I tried to experiment around, but cannot view records when I select in the external table. Please help me to solve it.

    I also register the generated log file:

    LOG file opened at 01/06/15 16:40:11

    For table EMP_EXADATA field definitions

    Record format DELIMITED BY newline

    Data in file have same "endianness" as platform

    Rows with all null fields are accepted

    Fields of the Data Source:

    EMPLOYEE_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    FIRST NAME CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    LAST_NAME CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    EMAIL CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    PHONE_NUMBER CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    HIRE_DATE TANK (19)

    Day DATE data type, date mask dd-mm-yyyy hh24:mi:ss

    Completed by «,»

    Trim whitespace same as SQL Loader

    JOB_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    SALARY CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    COMMISSION_PCT CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    MANAGER_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    DEPARTMENT_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    You need to carefully examine the description of the PREPROCESSOR option in the chapter of the manual external Tables utility.

    The first point that applies to your question is that the preprocessor must write its data transformed to stdout. To do this with gunzip, you use the - c command line parameter. The second point that applies to your case, in view of the answer to the first point, is that you must write a script shell if your preprocessor requires command line settings.

    Kind regards

    Bob

  • Access to an external table via the display in the UCM configuration manager problem

    Hi all

    I know that this question is already asked here: to access the external tables in DB / in UCM Applet configuration manager but the conversation has already been archived, and I can't comment there. I'm following approach given by William Phelps in above said archived thread.

    I am able to create dblink with data remote and created the view by using the linked table in my diagram of the Complutense University of Madrid. The problem that I face is that this point of view such as told by William is not visible in the configuration manager. Although I tried to give (create view and create all views) system diagram University Complutense of MADRID user privileges, but I'm not sure that it will also provide access rights. I am using the SQL Developer and working at the University Complutense of MADRID 11 g.

    All comment or suggestion will be a great help.

    Stéphane yapi

    The value of this configuration variable: EBRIncludeViewsInTableList = 1

    https://jonathanhult.com/blog/2013/11/use-database-view-WebCenter-content-schema-view/

    Jonathan

    http://jonathanhult.com

  • Loading external Table with quotes

    I have a file with fields in the file are as TAB delimiter ~ TAB.

    Example as below:

    QM ~ CD ~ Exzm ~ BMW

    DM ~ BD ~ Exzm ~ BMW

    CREATE TABLE test

    (

    Col_1 VARCHAR2 (100),

    Col_2 VARCHAR2 (100),

    Col_3 VARCHAR2 (100),

    Col_4 VARCHAR2 (100)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    DEFAULT DIRECTORY 'Test_Report '.

    ACCESS SETTINGS

    (records delimited by '\n'

    CHARACTERSET 'UTF8 '.

    fields terminated by '\t~\t '.

    missing field values are null

    )

    LOCATION ("test.asc")

    )

    REJECT LIMIT UNLIMITED;

    OUTPUT:

    ----------------

    Data loaded in DB, but col_4 data comes from the quotation as below

    col_4

    -------

    "BMW".

    "BMW".

    Note: Col1 - col3 data arrives correctly.

    2807064 wrote:

    A finding on my side.

    I found that the values of Col_4 after inserting into DB with "transport return character" (CHR (13)) at the end of each value as shown below when I copy paste the value in notepad ++ "»

    Example:

    ----------

    "BMW".

    "

    But if I see the file I saw that BMW.

    My question is, in this case the external table loading must fail right? Why is this it is to load data in DB?

    Do you have this file begin life on windows, and then are transferred to * nix to serve an external table?  If so, which explains a lot.  Windows is the standard record delimiter x '0d0a' (Chr (13) 10)  On * nix, it's just x '0A' (10.  When the process of loader is scanning for record delimiter he's just looking for the '0A' x and x'd 0' gets included in the data.

    Two solutions-

    1 - Make sure that the data file is transferred so that the Records delimiters are converted.  It's supposed to to happen with ascii ftp mode, but this week I saw several examples in the House of it does not.

    2. attach your table definition external to seek the delimiter of actual recording instead of the default value of the operating system. == RECORDS DELIMITED BY X '0D0A '.

  • Bulk insert in an external table

    Hi, I get the error ora-29913, ora-01410 trying to do a bulk insert of external table

    INSERT

    IN CORE_TB_LOG

    (SELECT 'MODEL', 'ARCH_BH_MODEL', ROWID, "MODEL-D-000000001', - 45, 'A', SYSDATE, 'R'")

    OF ARCH_BH_MODEL1

    WHERE length (MOD_XCODIGO) > 10)

    INSERT

    *

    ERROR on line 1:

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend

    ORA-01410: invalid ROWID

    ARCH_BH_MODEL1 is the external table.


    What's wrong?


    Thank you.

    Hello

    There is no ROWID in external tables.

    It makes sense: ROWID identifies where a line is stored in the database; It shows the data file and the block number in this file.

    External tables are not stored in the database.  They exist independently of any data file in the database.  The concept of an Oracle block does not apply to them.

    Why would you copy the ROWID, even if you could?

    Apart from ROWID and SYSDATE, you select only literals.  You don't want to select all the real data of the external table?

    What is the big picture here?  Post a small example of data (a CREATE TABLE statement and a small data file for the external table) and the desired results from these sample data (in other words, what core_tb_log must contain after INSERTION is complete.)  Explain how you get these results from data provided.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

Maybe you are looking for

  • How do I log on to Windows 7 with DigitalPersona

    Hello I AES2501 works well to open a session for windows7. But as in Vista, using the digital persona, I have web opening session and other apps., I can not connect to the web using AES2501. do you have a solution for this? [Topic has been replaced b

  • Pavilion dv9005us does not illuminate

    My Pavilion dv9005us does not light with or without the battery. I held the power to discharge remaining power, then plugged in the ac adapter shows blue light to the decision-making of the laptop, but none of the front lights light up. The motherboa

  • Problems with wifi, I have a wifi extension in my house and I can not connect

    Original title: Wifiproblems Problems with wifi, I have a wifi extension in my house and I can't connect it, I try with support but it did not work. It's a shame in a new tablet to have this problem It only happens with the tablet surface, not with o

  • Connection to a wireless - printing Via Ethernet network?

    Hi, I had a search here but you can't find what I'm looking for, sorry if it was taken! I just bought a HP C310a wireless all in one, very happy so far. I connected my Netgear DGN2200 wireless, job done. I printed the test page and all is well. I'm n

  • Groovy ODI command-line script

    I've been playing with ODI 12 c groovy script for a while now and it is a very powerful tool, but did someone knows if it is possible to run the command-line groovy scripts?I also think that the editor groovy in ODI is very limited. There are much be