Monday, 22 September 2014

SQL * Loader

SQL*Loader loads data from external files into tables of an Oracle database

A typical SQL*Loader session takes as input a control file, which controls the behavior of SQL*Loader, and one or more datafiles. The output of SQL*Loader is an Oracle database (where the data is loaded), a log file, a bad file, and potentially a discard file

sqlldr



 SQL*Loader is invoked when you specify the sqlldr command and, optionally, parameters that establish session characteristics.

Customer.txt
101,Raju,9847743994
102,Sreenu,9768443324
103,Pramod,9088765644

Customer.ctl
LOAD DATA
INFILE 'C:\DataUpload\Customers.txt'
append INTO TABLE Customer
FIELDS TERMINATED BY ','  optionally enclosed by ' " '
(Cno ,Cname ,Mobile  )



Execution : sqlldr scott/tiger control=customer.ctl   log=customer.log  parallel=true direct=true 



How to improve the performace of SQL Loader :


  • Use Paralle Loads
  • Use Direct path Loads instead of Conventional path loader 
  • Disable indexes and constraints 
  • Use ROWS=n to commit Less frequently 
  • Ue Fixed width data, it saves affords when parsing the data 
  • Disable archiving during Load 
  • Use unrecoverable, it disables the writing of data to th redo logs 






No comments:

Post a Comment