Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2013
    Posts
    1

    Unanswered: How to load large xml file into the database?

    Hello,
    I have a large xml file (16MB).

    <?xml version="1.0" encoding="UTF-8"?>
    <cars>
    <car>
    <car_name>Ferrari</car_name>
    <model>Testarossa</address>
    <noo>87654321</noo>
    </car>
    <car>
    <car_name>Suzuki</car_name>
    <address>Swift</address>
    <noo>12345678</noo>
    </car>
    (...)
    </cars>

    How fast load it into the Oracle database?

  2. #2
    Join Date
    Oct 2013
    Location
    Poland / USA
    Posts
    5

    External Table

    You can use External Table.

    CREATE DIRECTORY ext_tab_dir AS 'path_your_file';


    CREATE TABLE cars_ext
    (car_name VARCHAR2(60),
    model VARCHAR2(60),
    no VARCHAR2(60)
    )
    ORGANIZATION EXTERNAL
    (
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ext_tab_dir
    ACCESS PARAMETERS
    (
    records delimited by "</car>"
    fields
    (
    record_line char(2000) terminated by "<car>",
    car_name char(60) enclosed by "<car_name>" and "</car_name>",
    model char(60) enclosed by "<model>" and "</model>",
    noo char(60) enclosed by "<noo>" and "</noo>"
    )
    )
    LOCATION ('cars.xml')
    )
    PARALLEL
    REJECT LIMIT UNLIMITED;
    Last edited by gvee; 10-21-13 at 04:58. Reason: links neutered

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •