Case 8: Loading Partitioned Tables - Oracle 8i

Case 8 demonstrates:

  • Partitioning of data.
  • Explicitly defined field positions and datatypes.
  • Loading using the fixed record length option.

Control File
The control file is ULCASE8.CTL. It loads the LINEITEM table with fixed length records, partitioning the data according to shipment date.

Notes:

  • Specifies that each record in the datafile is of fixed length (129 characters in this example).
  • Identifies the column name and location of the data in the datafile to be loaded into each column.

Table Creation
In order to partition the data, the LINEITEM table is created using four partitions according to the shipment date:

Input Data File
The datafile for this case, ULCASE8.DAT, looks as follows. Each record is 129 characters in length. Five blanks precede each record in the file.


Invoking SQL*Loader
Before invoking SQL*Loader, run the script ULCASE8.SQL as SCOTT/TIGER.

Then invoke SQL*Loader at the command line:

sqlldr scott/tiger control=ulcase8.ctl data=ulcase8.dat

Additional Information: The command sqlldr is a UNIX-specific invocation. To invoke SQL*Loader on your operating system, refer to your Oracle operating system-specific documentation.

Log File
The following shows a portion of the log file:

Table LINEITEM, partition SHIP_Q1, loaded from every logical record.
Insert option in effect for this partition: TRUNCATE


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Oracle 8i Topics