• Arun Kumar

Import csv into database table (SQL* Loader)

Create a table inside database which will be used for rows to import from csv file

SQL> create table student(roll_no number(2), name varchar2(20));

Create a sample csv file at OS level on your database server

# mkdir -p /u02/sql_loader
# cd /u02/sql_loader
# vi load_file.csv

Put some dummy data into the csv file

1,Mukesh
2,Suresh
3,Rajesh

Save the .csv file and close it


Create sql loader control file with .ctl extension

# vi control.ctl

Put below into the control file

LOAD DATA
INFILE 'load_file.csv'
INSERT INTO TABLE student
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
roll_no,
name
)

Invoke the sql loader utility at OS level and start import

# sqlldr userid=system/oracle control=control.ctl log=track.log


Recent Posts

See All

MySQL Installation on Linux

This article demonstrates MySQL installation on Oracle Enterprise Linux 6.5 version. Installation of MySQL Make sure you are able to connect internet via virtual machine. Try to ping google.com and pr

Add ISO image storage repository on XenServer

If you have used VMware ESXI, its very easy to upload ISO files to the data store and create VMs. With XenServer, you must create your own ISO repository to upload ISO files. Create ISO directory Acce

Automate RMAN Backups using Shell Scripts

In a real environment, off course you will not manually trigger all the Oracle database backups. You need an automated mechanism to trigger RMAN backups. In this article we will look at RMAN backup au

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis

Feedback