Synchronizing Data Between TimesTen and Oracle Databases

Data is sychronized between the TimesTen database and the Oracle database through load, refresh, or propagate operations. The load and refresh operations can be performed manually or configured to occur automatically.

  • Load operations:

    • Static load: A static load operation manually loads new cache instances into cache tables on a TimesTen database from the Oracle database tables using a LOAD CACHE GROUP SQL statement. The LOAD CACHE GROUP SQL statement loads committed inserts on the Oracle database tables into the cache tables on a TimesTen database.

      A load operation is primarily used to initially populate a cache group. When you first set up a cache within a TimesTen database, some cache group types require performing a manual load of the subset of data that you want to be available in the cache. This creates a copy of the data that exists on the Oracle database. This is true for both read-only and read-write cache groups except for cache groups that use dynamic load. (You will learn about dynamic load later.)

    • Dynamic load: When the application requests data that does not exist in the TimesTen database, the TimesTen database has mechanisms to dynamically retrieve and load the new data from the Oracle database into the TimesTen database. The application dynamically requests data with a SELECT SQL statement with a WHERE clause specifying the data.

  • Refresh operations: These operations are only for read-only caching, data can be modified at any time on the Oracle database with INSERT, UPDATE or DELETE SQL statements. A refresh operation synchronizes changed data from an Oracle database to cache table in a TimesTen database. Thus, cache instances in the cache tables on a TimesTen database contain the latest copy of the data from the Oracle database tables. A refresh operation is primarily used to apply committed changes on the Oracle database tables to existing cache tables after the cache group has been initially populated. You can request a refresh manually or automatically at a specified time interval.

    • Manual refresh: For a manual refresh operation, run the REFRESH CACHE GROUP SQL statement.



    • Automatic refresh (autorefresh) operations: TimesTen provides mechanisms so that you can set an interval of time after which TimesTen automatically refreshes (known as autorefresh) all changes from the Oracle database to the TimesTen database. If you have specified autorefresh for your read-only caching, then the cached data is automatically synchronized at a specified interval of time. Normally, if you have autorefresh specified, you will not use manual refresh unless you want to refresh in between the autorefresh interval.

  • Automatic propagation of changes from the TimesTen database to the Oracle database: This operation is only available for read-write caching. When you change data on the cache tables on TimesTen, committed changes are automatically propagated to the cached Oracle Database tables.