Database Reference
In-Depth Information
COUNT(1)
----------
25
SQL>
Note that the count of the rows in the LNE6 PDB HR.COUNTRIES table matches what was
in the export and import log files.
Understanding and Using SQL*Loader
SQL*Loader is conceptually straightforward. Data that is to be loaded into the Oracle data-
base is stored in SQL*Loader data files, which are basically text files. The SQL*Loader con-
trol file, also a text file, contains the instructions SQL*Loader will use to find the data files
and which tables to load into.
There are a variety of options that you indicate in the control file, and we'll go over that
in detail in an upcoming section.
There are also different data load paths. The conventional path data load uses SQL INSERT
statements to insert rows into database tables. The direct path load writes data blocks directly
to the database files, operating on blocks above the high-water mark (HWM) in a table, and
doesn't use the DB buffer cache. These enhancements greatly reduce overhead and improve
performance.
SQL*Loader will use a control file and one or more data files and insert data into an
Oracle database. SQL*Loader will also create a log file, a bad file that indicates rejected
records of data, and, if you choose, a discard file that contains records that failed the SQL
selection criteria indicated in the control file. The difference between bad records and dis-
carded records is that with a bad record SQL*Loader attempted to load a record but there
was something wrong with the record and the load failed, whereas a discarded record had
nothing wrong with it but it did not meet the WHERE criteria.
SQL*Loader express mode is activated when you specify the target table on the
SQL*Loader command line, for example:
C:>\$ORACLE_HOME\bin\sqlldr hr/hr@LNE6 table=countries
SQL*Loader express mode uses the database table column definitions and does not use a
control file. It will utilize the data file with the same name as the database table and with the
extension .dat in the current directory. It will use defaults for the character set, field delim-
iters, and the names of data, log, and bad files unless you specify them with command-line
parameters. We will demonstrate express mode in an upcoming section.
In this section we will introduce the SQL*Loader utility, a tool that you can use to load
data from operating system files into tables in an Oracle database. You can use it to load data
from multiple data files into multiple database tables.
Search WWH ::




Custom Search