Load Utility in DB2
The load utility is capable of efficiently moving
large quantities of data into tables.
The utility can handle all data types, including large objects (LOBs) and
user-defined types (UDTs).
The load utility is faster than the import utility, because it writes formatted
pages directly into the database, while the import utility performs SQL
INSERTs.
The load utility does not fire triggers, and does not perform referential or
table constraints checking (other than validating the uniqueness of the
indexes).
db2 "load from data.ixf of ixf insert into
abc.data"
Syntax
Load from filename | pipename | device Of filetype
Lobs from lobpath modified by filetype_mod method
load_method
[Savecount n] [Rowcount n] [Warningcount n]
[Messages message_file]
Insert | Replace | Restart | Terminate into
table_name [(column {, column})]
-- Difference between Load and Import in DB2
IMPORT
1. Inserts one record at a time.
2. Before a row is inserted, it checks for any
constraint violations. Only if the inserted row complies with the rules, the
row is inserted.
3. After a row in inserted , the change is logged.
(Rollback is possible)
4. Table may or may not exist.
LOAD
1. Reads all the records from the external file and
builds data pages out of it.
2. All the built pages are directly written to the
database in a single shot.
3. Logs the entire operation and not on individual
record insert (Cannot be undone/rolled back)
4. Table must exist.
5. Checks for constraint violations and duplicate
rows after data pages are inserted. Any rows not complying with the rules are
deleted post insert.
6. Indexes are rebuilt after insert.
Comments
Post a Comment