3 Replies Latest reply on Mar 17, 2017 3:18 PM by RamaniNJ

    Running into issues using SQLLDR

    RamaniNJ

      Hi:

       

      I was following instructions I found in one of the forums for loading files into a table that has an attribute defined as a Blob.

       

      Here's the table structure:
      ID Number(38)
      Type_of_Blob varchar2(20)
      Content Blob

      Here's my control file (Name: Ora_Load.txt)
      LOAD DATA
      INFILE 'ora_loader.txt'
        INTO TABLE VENKI
        FIELDS TERMINATED BY ','
         ( id    CHAR(10),
           type_OF_BLOB   CHAR(20),
           fname FILLER   CHAR(80),
           text    LOBFILE(fname) TERMINATED BY EOF
         )

      Here's my data:
      1,Text File,Oracle-Connection_String.txt
      2,Erwin File, sample_erwin
      3,Excel File,WPS_ArgusAdapter.xls

      I tried using the following command:
      C:\temp>sqlldr system/324Ramani control=ora_load.txt log=loader.log bad=loader.bad

      I get the following error:
      SQL*Loader: Release 11.2.0.1.0 - Production on Thu Mar 16 18:10:29 2017

      Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

      SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
      ORA-12560: TNS:protocol adapter error

      I tried using SQL-Plus and I am able to connect to the oracle instance with the same credentials I used above.

      What am I doing wrong?

      venki

        • 1. Re: Running into issues using SQLLDR
          AndrewSayer

          RamaniNJ wrote:

           

          Hi:

           

          I was following instructions I found in one of the forums for loading files into a table that has an attribute defined as a Blob.

           

          Here's the table structure:
          ID Number(38)
          Type_of_Blob varchar2(20)
          Content Blob

          Here's my control file (Name: Ora_Load.txt)
          LOAD DATA
          INFILE 'ora_loader.txt'
          INTO TABLE VENKI
          FIELDS TERMINATED BY ','
          ( id CHAR(10),
          type_OF_BLOB CHAR(20),
          fname FILLER CHAR(80),
          text LOBFILE(fname) TERMINATED BY EOF
          )

          Here's my data:
          1,Text File,Oracle-Connection_String.txt
          2,Erwin File, sample_erwin
          3,Excel File,WPS_ArgusAdapter.xls

          I tried using the following command:
          C:\temp>sqlldr system/324Ramani control=ora_load.txt log=loader.log bad=loader.bad

          I get the following error:
          SQL*Loader: Release 11.2.0.1.0 - Production on Thu Mar 16 18:10:29 2017

          Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

          SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
          ORA-12560: TNS:protocol adapter error

          I tried using SQL-Plus and I am able to connect to the oracle instance with the same credentials I used above.

          What am I doing wrong?

          venki

          That error suggests you haven't even managed to connect to the database so it was a good idea to check with sql plus.

           

          Perhaps you have multiple Oracle homes?

          Post the output of the following from you cmd window (from c:\temp again)

          where sqlldr

          where sqlplus

          sqlplus system/324Ramani

           

          Perhaps you didn't set your oracle_sid environment variable?

          • 2. Re: Running into issues using SQLLDR
            Gbenga Ajakaye

            In addition to what addrew wrote, review this thread SQL*Loader-704

            • 3. Re: Running into issues using SQLLDR
              RamaniNJ

              Thanks so much, Andrew.

               

              Yes, it was the environments. Looks like I have several versions. I went to the folder that had SQL-PLUS and executed the SQLLDR and it worked!

               

              Now, I am off to cleaning up my environment.

               

              Venki