Table of Contents

Oracle Database - Direct (path insert|load) (/*+ APPEND */)

About

A direct-path insert is also known as:

A direct-path insert is a bulk operation which will only bypass redo log generation in three cases :

The insert /*+ APPEND */ will minimize redo log generation in all cases, as it minimize the amount of UNDO generated. The redo that would otherwise be generated for the UNDO information is not created, but ultimately the logging mode of the target table is what will dictate whether redo is generated for the table or not.

As a recovery is not possible from the redo log, you need coordination with the DBA to schedule necessary backup.

Why it's faster

A conventional path load executes SQL INSERT statements to populate tables. In contrast, a direct path load eliminates much of the database overhead by formatting data blocks and writing them directly to the database files. Direct writes operate on blocks above the high water mark and write directly to disk, bypassing the database buffer cache. Direct reads read directly from disk into the PGA, again bypassing the buffer cache.

Reasons to not set NOLOGGING and /*+ APPEND */ on all insert

Few reasons not to set NOLOGGING and use the direct-path insert /*+ APPEND */ on all inserts :

Setting Up for Direct Path Loads

To prepare the database for direct path loads, you must run the setup script, catldr.sql, to create the necessary views. You need only run this script once for each database you plan to do direct loads to. You can run this script during database installation if you know then that you will be doing direct loads.