SQL LOADER and SHELL SCRIPT ISSUE

Hello Guys,
I know this not the right forum but i am not sure where i should post this.
Pelase help
I am running a shell script which is giving me error
Username:SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied
SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:04 2009
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:06 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Enter user-name:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
0 rows updated.
Commit complete.
SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
SQL> SQL> Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options Thu Nov 19 13:02:06 EST 2009In shell script i have used the same username and passwd which i am using from command line
the shell script is calling sql loader to load file
and for that also the username and passwd is same.
i am able to run sqlldr command from command line dont knw why here its giving error
here is my shell script
set -a
. $HOME/.edw.env
. $admlib/checklib.sh
LOGDIR=$admsrc/sigma6/ppadala/copg
LOGFILE=${LOGDIR}/log/test`date '+%m%d'`.xtr
DB_USER=copg
DB_PWD=copg
set +a
cd $LOGDIR
if test ! -f $admsrc/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_11192009.txt
then
   echo "Error: DM_Daily_EFolderCloseCancel_Report_11192009.txt does not exist and/or is not a regular file." >> ${LOGFILE}
   exit 1
fi
echo 'End of Checking for the existence of the file - Successful'>> ${LOGFILE}
sqlldr control=$admsrc/sigma6/ppadala/copg/Close_Cancle.ctl log=$admsrc/sigma6/ppadala/copg/Close_cancle.log
userid=${DB_USER}/${DB_PWD} silent=\(HEADER,FEEDBACK,DISCARDS\)>> ${LOGFILE} 2>&1
case $? in 0) :;;1|3) echo "Error: SQL Loader" >> ${LOGFILE}
     exit 1;;
esac
sqlplus << EOD
${DB_USER}/${DB_PWD}
@Close_Cancle.sql
EOD
if [ $? -ne 0 ]
then
    echo "Error: SQL Plus for script Processing" >> ${LOGFILE}
    echo "Resi Unit Scheduling Report Refresh failed" >> ${LOGFILE}
fi
) > ${LOGFILE} 2>&1
echo `date` >> ${LOGFILE}
if [ -f ${LOGFILE} ]
then
mail -s "Resi Unit Scheduling" "[email protected]" < ${LOGFILE}
sleep 3
`ck_error ${LOGFILE}`
fiplease help guys
thanks

Thanks for the reply
In Close_cancle.log also its the same msg which i posted.
logon denied..............
and this is the log file contents when i do set - X on
+ cd /u2144009/src/sigma6/ppadala/copg
+ test ! -f
+ /u2144009/src/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_1
+ 1192009.txt echo End of Checking for the existence of the file -
+ Successful
+ 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr
+ sqlldr control=/u2144009/src/sigma6/ppadala/copg/Close_Cancle.ctl
+ log=/u2144009/src/sigma6/ppadala/copg/Close_cancle.log
Username:SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied
SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:17 2009
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
+ userid=copg/copg silent=(HEADER,FEEDBACK,DISCARDS)
+ 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr 2>& 1
+ :
+ sqlplus
+ 0<<
copg/copg
@Close_Cancle.sql
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:58 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Enter user-name:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
0 rows updated.
Commit complete.
SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
SQL> SQL> Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
+ [ 0 -ne 0 ]
Thu Nov 19 17:32:59 EST 2009Edited by: user10647455 on Nov 19, 2009 2:35 PM

Similar Messages

  • Error while calling sql loader from shell script.

    In the table DBMS_SCHEDULER_JOB_RUN_DETAILS im getting the error as ""SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon denied""....do we need previliges for creating session of the db user????.....or wht other settings we require to do.....if the username and password used is right.

    user1122577 wrote:
    SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon deniedI don't know, but somehow the error you recived looks like ORA-01017 : )
    [oracle@dell ~]$ sqlplus ring/ring
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 22 11:50:58 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    [oracle@dell ~]$
    [oracle@dell ~]$
    [oracle@dell ~]$ sqlldr ring/ring
    control = i don't have it
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:08 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Loader-500: Unable to open file (i don't have it.ctl)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    [oracle@dell ~]$
    [oracle@dell ~]$
    [oracle@dell ~]$ sqlldr ring/wrongpassword
    control = i don't have it again
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:38 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    [oracle@dell ~]$

  • 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.

  • Passing params from SQL file to Shell Script and then from Shell to SQL Fil

    Afternoon guys,
    Have a fun question for all you gurus in shell scripting out there. I have a shell script that is calling 2
    different SQL programs. My objective is to pass a variable called request_number from one sql program
    to the shell script and then from the shell script back to another SQL program. I will explain why I
    need this to happen.
    Here is what the shell script looks like which calls sql programs student_load_a.sql and
    student_load_b.sql. Student_load_a.sql basically creates the control file (.ctl) which is needed for the
    SQL*Loader and then student_load_b.sql reads the table that was just loaded and does the main
    processing. My main objective here is to be passing the request_number which is being generated
    using an Oracle Sequence in student_load_a.sql and using this generated number in my main
    processing in student_load_b.sql to select records from the table based on request_number.
    Any ideas ?Any help or recommendations is welcome and appreciated.
    *1. Shell Script*
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id
    exit_status=$?
    # Do sqlloads
    sdesqlldr.exe userid=$p_user_id control=student_load-$p_job_id.ctl \
                                                 log=student_load-$p_job_id.log \
                                                 bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id
    exit_status=$?
    exit 0*2. student_load_a.sql (Would like to pass back the Sequence Number back to shell script and then use in student_load_b.sql*
    -- Accept system input parameters
    define p_job_id = &1
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ' || '''' || request_number_seq.nextval || ''',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    *3. student_load_b.sql (This is a big file so I am only adding code that is relevant for the SQL)*
    {code}
    declare
      v_request_number    number(6);
      v_student_id                  number(7);
      cursor cur_student_load is
        select  student_id
        from   TMP_STUDENT_LOAD
        where  request_number = v_request_number
        order by 1;
    begin
        v_user_id := '&1';
        v_job_id := &2;
        -- This is the variable I would like to be be passing from shell script to student_load_b.sql
        -- v_request_number = '&3';
         open  cur_student_load;
         fetch cur_student_load into v_student_id;
          exit when cur_student_load%notfound;
          .... more logic of if then else in here
         close cur_student_load;
    end;
    {code}
    Edited by: RDonASnowyDay on Jan 29, 2010 4:03 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How come you are mixing WinDoze script (*.exe) with Unix?
    You are aware that you will be passing the password along with the user id to the second sql script?
    I will assume Unix ksh:
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    p_seqno=`sqlplus -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id`
    exit_status=$?
    # Do sqlloads
    sqlldr userid=$p_user_id control=student_load-$p_job_id.ctl \
           log=student_load-$p_job_id.log \
           bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql \
               $p_user_id $p_job_id $p_seqno
    exit_status=$?
    exit 0And the first sql script would look like this:
    -- student_load_a.sql
    -- Accept system input parameters
    set echo off pages 0 feed off lin 80 trims on ver off
    def p_job_id = &1
    col seqno NEW_VALUE seqno
    select request_number_seq.nextval seqno from dual;
    set term off
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ''&&seqno'',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    :p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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.

  • 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

  • Use of SQL*Loader and Thin Client

    I have a java application that is currently using the thin client. For portability issues, I am unable to use an OCI driver. My application also uses SQL*Loader.
    My big issue is that The Thin client requires the HOST and SID for a connection.
    But, for SQL*Loader to work in a client/server environment it needs to use the SERVICE_NAME and net8. Is there any way to have SQL*Loader use similar information that the thin client is using?
    I know the right solution is to use the OCI drivers, but right now that is not feasible.
    Thanks for any help in advance
    Jeff McNurlan
    Navigation Technologies.

    I assume you are using an ObjectInputStream. Without seeing your code or a snippet I can't be certain...
    The JDBC spec says the following about ObjectInputStream :
    "An ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream"
    Since there was nothing written by ObjectOutputStream, ObjectInputStream has nothing to deserialize and this exception would be raised.

  • 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 commit

    Hi,
    I am trying to execute a sql loader script that populates many tables. The order of the tables in the script is very important because the table of the last table has a constraint with the first table of the script. So I need that sqlloader executes a commit after the filling of the first tables because if sql loader executes the script simply as it is written the last tables launches an error because the constraint is violated (the last table sees the first one empty).
    How can I force a commit after a filling in sql loader?
    The sctructure of the tables was not defined by me so I must not modify it (constraint included).
    Thanks, bye bye.

    Hi,
    If you have to enable/disable manually the constraints you can execute:
    DECLARE
      v_ds_action VARCHAR2(7);
    BEGIN
      v_ds_action := 'DISABLE';
        FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'R') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'C') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'U') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'P') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    END;
    DECLARE
      v_ds_action VARCHAR2(7);
    BEGIN
      v_ds_action := 'ENABLE';
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'P') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'U') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'C') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
      FOR reg IN (SELECT * FROM user_constraints uc WHERE uc.constraint_type = 'R') LOOP
        EXECUTE IMMEDIATE 'ALTER TABLE ' || reg.table_name || ' ' ||
                          v_ds_action || '  CONSTRAINT ' || reg.constraint_name;
      END LOOP;
    END;
    /Regards,

  • 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

  • Rman windows and  Shell Script

    hi,
    How to take the backup by windows script and shell script.please any one tell that.
    thanks
    with regards

    Dear user!
    How to take the backup by script is a very imprecisely kind of question. So the only thing I can give you is a very imprecise answer.
    For linux shellscript you may use:
    vim my_backup_script.sh
    #!/bin/bash
    BACKUP DATABASE;Save and run this script in the following way:
    rman target / catalog catuser/password@CATDB CMDFILE my_backup_script.shYou may customize this script to fit your needs. On Windows you may write a batchscript like that:
    notepad my_backup_script.bat
    BACKUP DATABASE;Save and run this script like that:
    rman target / catalog catuser/password@CATDB CMDFILE my_backup_script.batMaybe if you could state your needs a little bit more precisely I could give you a more helpful answer.
    Yours sincerely
    Florian W.

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Xgettext for perl and shell scripts on Solaris 9

    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks,
    Lokesh

    Signature link blocked.
    db
    Contentprise wrote:
    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks

Maybe you are looking for

  • JPopupMenu for a JTree, enabling and disabling options

    Hi all. I'm trying to activate/deactivate some JMenuItem options for a JPopupMenu launched for a JTree object. Let's say, depending on "some state", I want some options in the JPopupMenu (the JMenuItems) should be enabled or disabled, and change when

  • Passing parameters from report portlet to a forms portlet

    Hello All, I am trying to link data in a report to a form. Here's the gist: I click on a record in the report and the data is passed to a form in update mode. The problem is that when I click on the record the data is not passed right away to the for

  • USB Headphones Not Always Picking Up Audio

    I have Logitech USB headphones that I use with Rosetta Stone. They work just fine. They will also work if I'm watching a video that's on my computer (using the Apple "DVD Player") or when listening to iTunes. However, they don't work for any audio th

  • Undesired Enlargement

    I finally succeeded installing Adobe Reader X using Chrome (which I could not achieve via Firefox or Explorer), it seemed to work like a charm for one use. Now, when opening a PDF file, every open program or desktop icon is grossly enlarged. In betwe

  • Extension functional location and equipment master data

    Hi, We have around 200 functional location (having 3 structure indicators) and 10,000 equipments (Having external number range) on a controlling area and on different company codes. Several orders have been created by this data and now company wants