Sql*Loader and Conc. Mgr.

I would like for our users to submit a request (in GL) that will run sql*loader to load a file of their choosing to an oracle table. Oracle tells me I must use their consulting arm for this kind of question. Does anyone have any ideas on how to do this?

External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
Justin

Similar Messages

  • SQL Loader and Insert Into Performance Difference

    Hello All,
    Im in a situation to measure performance difference between SQL Loader and Insert into. Say there 10000 records in a flat file and I want to load it into a staging table.
    I know that if I use PL/SQL UTL_FILE to do this job performance will degrade(dont ask me why im going for UTL_FILE instead of SQL Loader). But I dont know how much. Can anybody tell me the performance difference in % (like 20% will decrease) in case of 10000 records.
    Thanks,
    Kannan.

    Kannan B wrote:
    Do not confuse the topic, as I told im not going to use External tables. This post is to speak the performance difference between SQL Loader and Simple Insert Statement.I don't think people are confusing the topic.
    External tables are a superior means of reading a file as it doesn't require any command line calls or external control files to be set up. All that is needed is a single external table definition created in a similar way to creating any other table (just with the additional external table information obviously). It also eliminates the need to have a 'staging' table on the database to load the data into as the data can just be queried as needed directly from the file, and if the file changes, so does the data seen through the external table automatically without the need to re-run any SQL*Loader process again.
    Who told you not to use External Tables? Do they know what they are talking about? Can they give a valid reason why external tables are not to be used?
    IMO, if you're considering SQL*Loader, you should be considering External tables as a better alternative.

  • SQL *Loader and External Table

    Hi,
    Can anyone tell me the difference between SQL* Loader and External table?
    What are the conditions under we can use SQL * Loader and External Table.
    Thanx

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • Help in calling sql loader and an oracle procedure in a script

    Hi Guru's
    please help me in writing an unix script which will call sql loader and also an oracle procedure..
    i wrote an script which is as follows.
    !/bin/sh
    clear
    #export ORACLE_SID='HOBS2'
    sqlldr USERID=load/ps94mfo16 CONTROL=test_nica.ctl LOG=test_nica.log
    retcode=`echo $?`
    case "$retcode" in
    0) echo "SQL*Loader execution successful" ;;
    1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
    2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
    3) echo "SQL*Loader execution encountered a fatal error" ;;
    *) echo "unknown return code";;
    esac
    sqlplus USERID=load/ps94mfo16 << EOF
    EXEC DO_TEST_SHELL_SCRIPT
    it is loading the data in to an oracle table
    but the procedure is not executed..
    any valuable suggestion is highly appriciated..
    Cheers

    multiple duplicate threads:
    to call an oracle procedure and sql loader in an unix script
    Re: Can some one help he sql loader issue.

  • HELP: SQL*LOADER AND Ref Column

    Hallo,
    I have already posted and I really need help and don't come further with this
    I have the following problem. I have 2 tables which I created the following way:
    CREATE TYPE gemark_schluessel_t AS OBJECT(
    gemark_id NUMBER(8),
    gemark_schl NUMBER(4),
    gemark_name VARCHAR2(45)
    CREATE TABLE gemark_schluessel_tab OF gemark_schluessel_t(
    constraint pk_gemark PRIMARY KEY(gemark_id)
    CREATE TYPE flurstueck_t AS OBJECT(
    flst_id NUMBER(8),
    flst_nr_zaehler NUMBER(4),
    flst_nr_nenner NUMBER(4),
    zusatz VARCHAR2(2),
    flur_nr NUMBER(2),
    gemark_schluessel REF gemark_schluessel_t,
    flaeche SDO_GEOMETRY
    CREATE TABLE flurstuecke_tab OF flurstueck_t(
    constraint pk_flst PRIMARY KEY(flst_id),
    constraint uq_flst UNIQUE(flst_nr_zaehler,flst_nr_nenner,zusatz,flur_nr),
    flst_nr_zaehler NOT NULL,
    flur_nr NOT NULL,
    gemark_schluessel REFERENCES gemark_schluessel_tab
    Now I have data in the gemark_schluessel_tab which looks like this (a sample):
    1 101 Borna
    2 102 Draisdorf
    Now I wanna load data in my flurstuecke_tab with SQL*Loader and there I have problems with my ref column gemark_schluessel.
    One data record looks like this in my file (it is without geometry)
    1|97|7||1|1|
    If I wanna load my data record, it does not work. The reference (the system generated OID) should be taken from gemark_schluessel_tab.
    LOAD DATA
    INFILE *
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE FLURSTUECKE_TAB
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    flst_id,
    flst_nr_zaehler,
    flst_nr_nenner,
    zusatz,
    flur_nr,
    gemark_schluessel REF(CONSTANT 'GEMARK_SCHLUESSEL_TAB',GEMARK_ID),
    gemark_id FILLER
    BEGINDATA
    1|97|7||1|1|
    Is there a error I made?
    Thanks in advance
    Tig

    multiple duplicate threads:
    to call an oracle procedure and sql loader in an unix script
    Re: Can some one help he sql loader issue.

  • Using SQL*Loader and UTL_FILE to load and unload large files(i.e PDF,DOCs)

    Problem : Load PDF or similiar files( stored at operating system) into an oracle table using SQl*Loader .
    and than Unload the files back from oracle tables to prevoius format.
    I 've used SQL*LOADER .... " sqlldr " command as :
    " sqlldr scott/[email protected] control=c:\sqlldr\control.ctl log=c:\any.txt "
    Control file is written as :
    LOAD DATA
    INFILE 'c:\sqlldr\r_sqlldr.txt'
    REPLACE
    INTO table r_sqlldr
    Fields terminated by ','
    id sequence (max,1) ,
    fname char(20),
    data LOBFILE(fname) terminated by EOF )
    It loads files ( Pdf, Image and more...) that are mentioned in file r_sqlldr.txt into oracle table r_sqlldr
    Text file ( used as source ) is written as :
    c:\kalam.pdf,
    c:\CTSlogo1.bmp
    c:\any1.txt
    after this load ....i used UTL_FILE to unload data and write procedure like ...
    CREATE OR REPLACE PROCEDURE R_UTL AS
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER ;
    l_pos INTEGER := 1;
    l_blob BLOB;
    l_blob_len INTEGER;
    BEGIN
    SELECT data
    INTO l_blob
    FROM r_sqlldr
    where id= 1;
    l_blob_len := DBMS_LOB.GETLENGTH(l_blob);
    DBMS_OUTPUT.PUT_LINE('blob length : ' || l_blob_len);
    IF (l_blob_len < 32767) THEN
    l_amount :=l_blob_len;
    ELSE
    l_amount := 32767;
    END IF;
    DBMS_LOB.OPEN(l_blob, DBMS_LOB.LOB_READONLY);
    l_file := UTL_FILE.FOPEN('DBDIR1','Kalam_out.pdf','w', 32767);
    DBMS_OUTPUT.PUT_LINE('File opened');
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ (l_blob, l_amount, l_pos, l_buffer);
    DBMS_OUTPUT.PUT_LINE('Blob read');
    l_pos := l_pos + l_amount;
    UTL_FILE.PUT_RAW(l_file, l_buffer, TRUE);
    DBMS_OUTPUT.PUT_LINE('writing to file');
    UTL_FILE.FFLUSH(l_file);
    UTL_FILE.NEW_LINE(l_file);
    END LOOP;
    UTL_FILE.FFLUSH(l_file);
    UTL_FILE.FCLOSE(l_file);
    DBMS_OUTPUT.PUT_LINE('File closed');
    DBMS_LOB.CLOSE(l_blob);
    EXCEPTION
    WHEN OTHERS THEN
    IF UTL_FILE.IS_OPEN(l_file) THEN
    UTL_FILE.FCLOSE(l_file);
    END IF;
    DBMS_OUTPUT.PUT_LINE('Its working at last');
    END R_UTL;
    This loads data from r_sqlldr table (BOLBS) to files on operating system ,,,
    -> Same procedure with minor changes is used to unload other similar files like Images and text files.
    In above example : Loading : 3 files 1) Kalam.pdf 2) CTSlogo1.bmp 3) any1.txt are loaded into oracle table r_sqlldr 's 3 rows respectively.
    file names into fname column and corresponding data into data ( BLOB) column.
    Unload : And than these files are loaded back into their previous format to operating system using UTL_FILE feature of oracle.
    so PROBLEM IS : Actual capacity (size ) of these files is getting unloaded back but with quality decreased. And PDF file doesnt even view its data. means size is almot equal to source file but data are lost when i open it.....
    and for images .... imgaes are getting loaded an unloaded but with colors changed ....
    Also features ( like FFLUSH ) of Oracle 've been used but it never worked
    ANY SUGGESTIONS OR aLTERNATE SOLUTION TO LOAD AND UNLOAD PDFs through Oracle ARE REQUESTED.
    ------------------------------------------------------------------------------------------------------------------------

    Thanks Justin ...for a quick response ...
    well ... i am loading data into BLOB only and using SQL*Loader ...
    I've never used dbms_lob.loadFromFile to do the loads ...
    i 've opend a file on network and than used dbms_lob.read and
    UTL_FILE.PUT_RAW to read and write data into target file.
    actually ...my process is working fine with text files but not with PDF and IMAGES ...
    and your doubt of ..."Is the data the proper length after reading it in?" ..m not getting wat r you asking ...but ... i think regarding data length ..there is no problem... except ... source PDF length is 90.4 kb ..and Target is 90.8 kb..
    thats it...
    So Request u to add some more help ......or should i provide some more details ??

  • Is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader

    Hi
    Can anyone tell me whether is there any difference in Oracle 9i SQL Loader and Oracle 10g SQL Loader?
    I am upgrading the 9i db to 10g and wanted to run the 9i SQL Loader control files on upgraded 10g db. So please let me know is there any difference which I need to consider any modifications in the control files..
    Thank you in advance
    Adi

    answered

  • Import and process larger data with SQL*Loader and Java resource

    Hello,
    I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
    After that, we have to analysis the data, and export the results into a another database.
    I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
    I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
    Please tell me some advice about the solution.
    Thank you very much.

    With '?' mark i mean " How i can link this COL1 with column in csv file ? "
    Attilio

  • SQL*Loader and DECODE function

    Hi All,
    I am loading data from data files into oracle tables and while loading the data using SQL*Loader, the following requirement needs to be fulfilled.
    1) If OQPR < 300, RB = $ 0-299, SC = "SC1"
    2) If 300 < OQPR < 1200, RB = $ 300-1199, SC = "SC2"
    3) If 1200 < OQPR < 3000, RB = $ 1200-2999, SC = "SC3"
    4) If OQPR > 3000 USD, RB = > $3000, SC = "SC4"
    Here OPQR is a field in the data file.
    Can anyone suggest how do we handle this using DECODE function? Triggers and PL/SQL functions are not to be used.
    TIA.
    Regards,
    Ravi.

    The following expression gives you different values for your different intervals and boundaries :
    SIGN(:OQPR - 300) + SIGN(:OQPR - 1200) + SIGN(:OQPR - 3000)

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

  • SQL*LOADER and decode

    I'm setting up a sql*loader script and trying to use the decode function as referred to in 'Applying SQL Operators to Fields' I'm getting an error message ' Token longer than max allowable length of 258 chars'. Is there a limit to the size of the decode statement within sql*loader - or is it better to use a table trigger to handle this on insert? I ran the decode statement as a select through SQL*Plus and it works okay there. Oracle 8.0 Utilities shows example of decode in Ch. 5, but Oracle 9i Utilities Ch. 6 does not. Has anyone done this and what's the impact on performance of the load if I can get it to work? See my example below:
    LOAD DATA
    INFILE 'e2e_prod_cust_profile.csv'
    APPEND
    INTO TABLE APPS.RA_CUSTOMER_PROFILES_INTERFACE
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    (Insert_update_flag CHAR(1),
    Orig_system_customer_ref CHAR(240),
    customer_profile_class_name CHAR(30) NULLIF customer_profile_class=BLANKS
    "decode(customer_profile_class_name,
    'NORTHLAND Default','(MIA) Default',
    'NORTHLAND Non Consolidated','(MIA) Non Cons',
    'NORTHLAND Consolidated A','(MIA) Cons A',
    'NORTHLAND Consolidated B','(MIA) Cons B',
    'NORTHLAND Consolidated C','(MIA) Cons C',
    'NORTHLAND Consolidated D','(MIA) Cons D',
    'NORTHLAND Cons A NonZS','(MIA) Cons A NonZS',
    'NORTHLAND Cons B NonZS','(MIA) Cons B NonZS',
    'NORTHLAND Cons C NonZS','(MIA) Cons C NonZS',
    'NORTHLAND Cons D NonZS','(MIA) Cons D NonZS',
    'NORTHLAND International Billing','(MIA) International Billing',
    customer_profile_class_name)",
    credit_hold CHAR(1),
    overall_credit_limit INTERGER EXTERNAL,
    "e2e_cust_profile.ctl" 49 lines, 1855 characters
    SQL*Loader-350: Syntax error at line 15.
    Token longer than max allowable length of 258 chars
    'NORTHLAND Consolidated D','(MIA) Cons D',
    ^

    Your controlfile is incomplete and has some typos, but you could try something like:
    create or replace function decode_profile_class_name (p_longname IN VARCHAR2)
    return VARCHAR2
    is
    begin
      CASE p_longname
        WHEN 'NORTHLAND Default'               THEN RETURN '(MIA) Default';
        WHEN 'NORTHLAND Non Consolidated'      THEN RETURN '(MIA) Non Cons';
        WHEN 'NORTHLAND Consolidated A'        THEN RETURN '(MIA) Cons A';
        WHEN 'NORTHLAND Consolidated B'        THEN RETURN '(MIA) Cons B';
        WHEN 'NORTHLAND Consolidated C'        THEN RETURN '(MIA) Cons C';
        WHEN 'NORTHLAND Consolidated D'        THEN RETURN '(MIA) Cons D';
        WHEN 'NORTHLAND Cons A NonZS'          THEN RETURN '(MIA) Cons A NonZS';
        WHEN 'NORTHLAND Cons B NonZS'          THEN RETURN '(MIA) Cons B NonZS';
        WHEN 'NORTHLAND Cons C NonZS'          THEN RETURN '(MIA) Cons C NonZS';
        WHEN 'NORTHLAND Cons D NonZS'          THEN RETURN '(MIA) Cons D NonZS';
        WHEN 'NORTHLAND International Billing' THEN RETURN '(MIA) International Billing';
        ELSE RETURN p_longname;
      END CASE;
    end;
    LOAD DATA
    INFILE 'e2e_prod_cust_profile.csv'
    APPEND
    INTO TABLE APPS.RA_CUSTOMER_PROFILES_INTERFACE
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    Insert_update_flag          CHAR(1),
    Orig_system_customer_ref    CHAR(240),
    customer_profile_class_name CHAR(30) NULLIF customer_profile_class=BLANKS "decode_profile_class_name(:customer_profile_class_name)"
    credit_hold                 CHAR(1),
    overall_credit_limit        INTEGER EXTERNAL

  • SQL*Loader and HTMLDB_APPLICATION_FILES

    Hello!
    Can I use SQL*Loader for loading data from file stored in HTMLDB_APPLICATION_FILES as blob to tables in database? Files are always CSV in my case.
    Best regards,
    Tom

    Hello Maxim!
    Of course files are stored in HTMLDB_APPLICATION_FILES as blobs and of course I can do 'select blob_content from htmldb.....' - BUT I have to get text from this blob, and copy certain words from this blob, NOT the blob itself.
    Example: I have a file.csv. I upload it to HTMLDB_APPLICATION_FILES so it is stored there as a blob. Now I want copy data delimited by ';'(for example) to table in database.
    Any ideas?
    Best regards,
    Tom

  • SQL*Loader and XML

    Does anyone know if SQL*Loader can read an XML file? Is this capability coming?

    For simple (and fairly small) load sizes, you might be able to
    use "OracleXML putXML" as indicated above, or for more complex
    examples, check out "Building Oracle XML Applications" by Steven
    Muench.
    Mike

  • SQL*Loader and binary

    i am trying to load binary data using SQL*Loader. given a table created a la:
    create table oofa ( data raw(500) );
    and a control file (running on x86 linux):
    LOAD DATA
    INFILE *
    APPEND INTO TABLE OOFA
    ( DATA VARRAW(500) )
    BEGINDATA
    X'05003132333435'
    i get an error "variable length field exceeds maximum length" and no record loaded. i tried using X'00053132333435' just in case i'd muffed the big- little-endian stuff, but the same thing happens.
    anyone successfully loaded binary data as above? if so, how'd you do it?
    also, is there a way to make SQL*Loader more verbose?
    thanks.

    i am trying to load binary data using SQL*Loader. given a table created a la:
    create table oofa ( data raw(500) );
    and a control file (running on x86 linux):
    LOAD DATA
    INFILE *
    APPEND INTO TABLE OOFA
    ( DATA VARRAW(500) )
    BEGINDATA
    X'05003132333435'
    i get an error "variable length field exceeds maximum length" and no record loaded. i tried using X'00053132333435' just in case i'd muffed the big- little-endian stuff, but the same thing happens.
    anyone successfully loaded binary data as above? if so, how'd you do it?
    also, is there a way to make SQL*Loader more verbose?
    thanks.

  • SQL*Loader and binary data

    i have a C routine that builds SQL*Loader input files. the input files contain multiple records, with a couple of integer columns and a raw(1400) field. the control file specifies a record separator of '|', which seems weird (having text in the middle of raw data) but also is somewhat co-operative (see below).
    so i basically write each integer to the file, then a short (2-byte) length value for the raw field, then the raw field. then the '|' separator.
    i've noticed that if the size of raw field is 400 bytes or less, everything works fine, i get the correct number of records in the database.
    unfortunately, with a size of 401 or more, SQL*Loader parses the thing into twice as many records as it should. so if i've written 3 records to my input data file, with each record's raw field at 400 bytes or less i get 3 records loaded. but any with a raw field of 401+, i get two records for each.
    any ideas why? and how to correct this? also, any ideas on a better way to do this? all the examples of large data in the online doc and the o'reilly book favor showing examples with large character data, which does me not much good.
    tia. john

    i have a C routine that builds SQL*Loader input files. the input files contain multiple records, with a couple of integer columns and a raw(1400) field. the control file specifies a record separator of '|', which seems weird (having text in the middle of raw data) but also is somewhat co-operative (see below).
    so i basically write each integer to the file, then a short (2-byte) length value for the raw field, then the raw field. then the '|' separator.
    i've noticed that if the size of raw field is 400 bytes or less, everything works fine, i get the correct number of records in the database.
    unfortunately, with a size of 401 or more, SQL*Loader parses the thing into twice as many records as it should. so if i've written 3 records to my input data file, with each record's raw field at 400 bytes or less i get 3 records loaded. but any with a raw field of 401+, i get two records for each.
    any ideas why? and how to correct this? also, any ideas on a better way to do this? all the examples of large data in the online doc and the o'reilly book favor showing examples with large character data, which does me not much good.
    tia. john

Maybe you are looking for

  • Help Please!!! I get the following error message when attempting to download files.

    I get this message each time I try to download a file. my system tells me that Adobe Reader is up to date. What should I do? Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be

  • Complete mess: Here is my story

    I've BT line and O2 broadband at the moment. As O2 is not upgrading to fibre in near future, I've decided to sign up with SKY because it is slightly cheaper and no traffic shaping. 06 July: Called BT to terminate the line, but got offered a very good

  • REPORT - Sold quantity and OnHand quantity

    Hello Everyone, How can I create a query to show what I have sold within a date range and how much inventory I have of those items.  Thank you. itemcode      sold        onhand     whscod x                    10                5            AH x      

  • How to control portlet adding?

    Hi all! I'm developing a MyPortal page (allow customization for logged users). My customer needs to control the number of portlets added by a user - for example , in a page a user can only add 6 portlet and after that he cannot click on "AddPortlet",

  • HT1766 i have ann error (-1) when restoring my phone in itunes anyone can help please

    i dont know what i need to do?  i have iphone 5 i always have a msg from itune whenever i am restoring my phone it says error (-1) please help