Loading Data Using Buffers

Example

Assume there are three data files that need to be imported. With aggregate storage databases, data loads are most efficient when all data files are loaded using one import operation. Therefore, load buffers are useful when loading more than one data file.

  1. Use alter database to create a load buffer. Only one active load buffer is supported, so you can always use 1 as the BUFFER-ID number.
    alter database ASOSamp.Sample initialize load_buffer with buffer_id 1;
    
  2. Load data into the buffer, using the import data statement.
    import database ASOSamp.Sample data 
    from server data_file 'file_1' 
    to load_buffer with buffer_id 1
    on error abort;
    
    import database ASOSamp.Sample data 
    from server data_file 'file_2' 
    to load_buffer with buffer_id 1
    on error abort;
    
    import database ASOSamp.Sample data 
    from server data_file 'file_3' 
    to load_buffer with buffer_id 1
    on error abort;
  3. Move the data from the buffer into the database.
    import database ASOSamp.Sample data from load_buffer with buffer_id 1;

    The data-load buffer is implicitly destroyed.

  4. Assume that in Step 2, after loading 'file_2' into the load buffer, you decided not to load the data. Because the data is in a buffer and not yet in the database, you would simply use alter database to destroy the buffer without moving the data to the database.
    alter database ASOSamp.Sample destroy load_buffer with buffer_id 1;

©2004 Hyperion Solutions Corporation. All Rights Reserved.
http://www.hyperion.com