why do we need UNIX shell script to load data into Oracle database

Hello everyone,

I am new to shell scripting/ loading data into a database.
I want to load data into Oracle database using SQL loader. Can some one please explain why do we need unix shell script to load the data into the database? Also can someone please explain what has to be in that script?

Can't I say sql loader with the username, password and the .ctl file to be loaded into the database?

Sorry to ask this silly question, but I want to understand.

Thank you!

Yes, you want to use sqlldr and a control file (.ctl file)

The sqlldr command can be run from a shell script if youwant, or from the command line interactively.

Oracle SQLLoader: The Definitive Guide: Chapter 1: Introduction to SQLLoader

Thanks Jim for your quick reply. I want to use a shell script but don't know how to write it.But can you please explain me why do we need UNIX shell script to load the data into a database and what will be the contents in the script.

I am really new to scripting/ loading data.

Thank you.

Something has to tell the utility what data to load, it's not psychic. If you don't want to tell it what data by hand, you write a script that tells it.

1 Like

Thank you Corona 688 for your reply. Now I understood the purpose of the UNIX script to load the data.

Can you please provide an example shell script to load the data in to a database.

Thank you.

Also, in a shell script you can redirect all responses to a file (thus storing in a file) for later analysis. You will appreciate how useful this is when you need to analyse few error messages among large amounts of "1 row(s) inserted" that normally fly past.

OK