Databases Reference
In-Depth Information
Our first simple load
Let' start working with the basics. In this scenario we will perform a simple load
where the main points will be presented. A simple source datafile will be loaded
and exposed to the main points a simple load has to consider.
In order for you to perform the first basic load, a simple text file has to be created;
this file will be the control file. The control file defines how the load will be executed,
it specifies the target table(s), the data file format, what to do in case of error, and
which other special features will be either used or not.
This first control file was taken from the demonstrations available from the Oracle
Home once the companion disk (demo section) has been installed. This is the
ulcase1.ctl control file. The comments are specified by using two hyphens at
the beginning of the line. All text following the hyphens up to the end of the line is
considered a comment and it is not interpreted.
LOAD DATA : The beginning of the file starts with the keyword LOAD DATA ( A ).
It assumes the target table is empty. In case there is data already loaded, and
depending on what exactly is being planned we can either APPEND or REPLACE .
If no modifier is specified, then it means the table must be empty before attempting
to insert data, otherwise a runtime error will show up. The user must have at least
the SELECT privilege on the table. If the option APPEND is used, it means that we can
just proceed to insert data; the user must be careful with the unique and primary
key constraints. For the REPLACE option, all data in the table will be removed prior
to starting the load; the user must have the SELECT and DELETE privileges to be able
to perform the operation with this option. It should be pointed out that deleting a
complete table may lead to severe performance problems, so it is better to use the
TRUNCATE option, it will be faster and as it applies over all the data rows, it performs
significantly faster than the REPLACE option.
 
Search WWH ::




Custom Search