Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoke SQL Loader from Java Program is not running if file size > 40 MB

2c8ffbfe-fbd5-49d7-b244-c0503ce9abf7Oct 11 2018 — edited Oct 14 2018

Hello All,

We are trying to load a huge file (say ~1 GB size) into Oracle database via SQL Loader. I have created a Java program which will execute the SQLLoader command from the program and loader will load the file into the table.

My Code Java Code is Given below :

public void invokeSQLLoader(){

             

        String stringCommand="/usr/lib/oracle/18.3/client64/bin/sqlldr <userId>/<password>@<dburl> control=/u01/hmpoc/HM_EDW_PASSBACK.ctl data=/u01/hmpoc/Passback_Report.csv bad=/u01/hmpoc/PASSBACK.bad discard=/u01/hmpoc/PASSBACK.dsc log=/u01/hmpoc/PASSBACK.log ERRORS=1000000";

        System.out.println("Passing Command::"+stringCommand);

      

       

        Process proc = null;

        try {

                System.out.println("Starting procedure call---"+new java.util.Date());

                Runtime rt = Runtime.getRuntime();

                proc = rt.exec(stringCommand.trim());

                System.out.println("End Procedure call---"+new java.util.Date());

        }catch (IOException e) {

                e.printStackTrace();

        } catch (NullPointerException e) {

                e.printStackTrace();

        }/*finally {

                proc.destroy();

        }*/

        System.out.println("SQLLDR Ended");

    }

Question and Query to all the experts :-

1. When the file size is ~ 40 MB , we can load data via my Java program.

2. When the file size > 42 MB , Java program runs successfully but data not get loaded with the file. No error or exception shown in the Java console.Where as if I ran the same command from command prompt with same control file and data file it is getting loaded.

Can anyone please help me? If I am missing something or what is the best way to invoke sqlloader from Java program apart from my approach.

Thank You all in advance.

Comments
Post Details
Added on Oct 11 2018
7 comments
3,648 views