1

I have big CSV files and placed it on Linux (Amazon AMI). I have installed instant client on Amazon Linux AMI and I can connect to my Oracle database using SQL Plus. How can I import all the CSVs to Oracle from Linux terminal?

My Oracle database is located on Amazon RDS.

1

3 Answers 3

1

Use sql*loader to load the data :

http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_params.htm#sthref540

(or external tables).

1) setup a .ctl file with your file format

2) setup / point to a receiving table in your database.

3) invoke sql*loader (sqlld)

2
  • I do not have sqlldr on my linux. How can I install it?
    – dang
    Commented Apr 15, 2015 at 7:20
  • 1
    @dang - I believe you'd need the full Oracle client to get SQL*Loader. I don't believe that's been built with the Instant Client. If you can place the file on the database server machine, then you could use an external table to load it (which is basically SQL*Loader syntax within a CREATE TABLE statement). Depending on how big the file is and whether this is a one-time process or an ongoing process, you might also be able to run SQL Developer on the client machine and use that GUI to load the data. Commented Sep 1, 2015 at 20:08
1

You can use Python to do the load. I see it like this:

  1. Python reads all CSV file names from given directory.
  2. Creates SQL*Loader co-routines for each file.
  3. Waits for load to finish
  4. Validates results.

I took similar approach in CSV-Loader-For-Oracle

0

Oracle SQL*Loader have two different option: direct and conventional path (https://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#SUTIL1284):

enter image description here

And loader concept / command line parameters are explained here:

https://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_params.htm#SUTIL1016

http://docs.oracle.com/cd/B28359_01/server.111/b28319/ldr_concepts.htm

But Oracle does provide another tool: Oracle export/import tool.

More information:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.