MS SQL Server to Oracle Using SQL Loader - Step 5: Running the SQL Loader utility

 

Step 5

Now we are ready to run the SQL Loader command.

Type the sqlldr command to start SQL Loader at Linux machine. It's better to start the SQL Loader from the same directory where your control file and source data file (customers.txt) is located.

We have to call sqlldr with several arguments as shown below

$sqlldr userid=scott/tiger control=/opt/oracle/customers.ctl log=customers.log

where:

userid: Is the username and password required to connect to the Oracle database.

control: Is the name of the control file including the path

log: Is the name of the log file which will be created by SQL Loader utility and will contain the actions performed by SQL Loader including any errors if any.

Once you type the above command you should get the following output

sqlloader-output

The output shows that 91 Rows successfully loaded. It means our SQL Loader session has gone smoothly and if there were any errors then SQL Loader would have displayed the error message instead of this successful message.

We can open the log file to view the actions performed by SQL Loader. Type the following command to view the log file

$vi customers.log

sqlloader log file

Now to verify the rows are properly inserted we can go to sqlplus and view the table contents

Type this simple SELECT command after logging as Scott user

SQL> SELECT * FROM customers;

sqlplus output

This finishes our exercise of migrating MS SQL Server Table to Oracle. The SQL Loader utility is robust, but it's quite tedious if we need to transfer multiple tables. If you need to transfer hundreds of tables then look for third party tools which will do migration automatically without writing a single piece of code. You can find the link to one of the best tool at bottom of this page.

Thanks.

 

 

 

New: Modern Oracle

Concepts here also apply to Oracle 19c/21c/23ai unless a version note says otherwise. See the homepage for what's changed.