Performing the Initial Data Load

The first procedure to starting the cache operations is to perform an initial data load of what is currently in the tables that are to be cached.

  1. On the host with the Oracle database, determine the current SCN value (using SQL*Plus):

    Command>SELECT CURRENT_SCN FROM V$DATABASE;
     
    CURRENT_SCN
    -----------
        2791297
  2. On the host with the TimesTen database, connect to the TimesTen database as the cacheadmin user specifying both the TimesTen and Oracle database passwords for this user:

    $ ttIsql -connStr "DSN=cache1;UID=cacheadmin;PWD=ttpwd;OraclePWD=ttpwd"
  3. Load the data for each of the tables based on the Oracle database SCN value determined above:

    Command>call ttLoadFromOracle('oratt', 'customer', 
          'SELECT * FROM oratt.customer AS OF scn 2791297');
    Command>call ttLoadFromOracle('oratt', 'orders', 'SELECT * FROM oratt.orders 
          AS OF SCN 2791297');
    Command>call ttLoadFromOracle('oratt', 'item', 'SELECT * FROM oratt.item 
          AS OF SCN 2791297');
  4. Update the optimizer statistics for the tables that you just loaded to ensure optimal query plans in TimesTen:

    statsupdate customer;
    statsupdate orders;
    statsupdate item;
    quit;