oracle sql and dba tutorial logo

 

Oracle DBA

Learn Oracle 11g / 12c Database Admin step by step



Oracle SQL

Tutorial for Oracle SQL


Oracle DBA Interview Questions

Most asked Oracle DBA Interview Questions.

60 Technical Questions
42 Backup & Recovery Questions

Unix For Oracle DBA 20 Questions



Download Oracle 11g / 12 c Software

Links to Download Oracle 12c / 11g for Linux, Windows etc.


MySQL Tutorial

Learn MySQL step by step


 

 

 

 

 

 

 

 

 

Migrating MS SQL Server table to Oracle Using SQL Loader - Step 4: Write SQL Loader Control File

Step 4: Write SQL Loader control file

We have to write a SQL Loader control file describing the input file, loading options, column structure and other settings.

The SQL*Loader control file is a text file that contains data definition language (DDL) instructions. DDL is used to control the following aspects of a SQL*Loader session:

For more detailed information please visit SQL Loader Control file reference

Open Visual Editor in Linux command prompt by typing vi and type the following script

LOAD DATA
INFILE '/opt/oracle/customers.txt'
BADFILE '/opt/oracle/customers.bad'
DISCARDFILE '/opt/oracle/customers.dsc'
APPEND INTO TABLE SCOTT.customers
FIELDS TERMINATED BY '\t' TRAILING NULLCOLS
(CustomerID, CompanyName, ContactName,
    ContactTitle, Address, City, Region, PostalCode,
                   Country, Phone, Fax)

Here is the explanation of different commands In the above script:

  1. The LOAD DATA statement tells SQL*Loader that this is the beginning of a new data load.
  2. The INFILE clause specifies the name of a datafile containing data that you want to load.
  3. The BADFILE parameter specifies the name of a file into which rejected records are placed.
  4. The DISCARDFILE parameter specifies the name of a file into which discarded records are placed.
  5. The APPEND parameter is one of the options you can use when loading data into a table that is not empty.

control file script

After writing the above contents save the file and quit vi by pressing ESC and then :wq

Next, run SQL Loader command

 

 

 

 


HomeContact Us

Data Loader

Data Loader is a simple yet powerful tool to
export and import Data between many common database formats


Forms Data Loader

Tool to load data into Oracle E-Business Suite R12 / Oracle Apps using Macros and Forms Record and Playback

Interface Computers Academy © 2007-2017 All Rights Reserved