Perform Operations on the oratt_grid.readtab Table

This section performs operations on the oratt_grid.readtab table.

  1. Create a shell from which you can access your Oracle Database and then use SQL*Plus to connect to the Oracle Database as the schema user (oratt_grid, in this example). Then, insert a new row, delete an existing row, and update an existing row in the oratt_grid.readtab table of the Oracle Database and commit the changes.
    sqlplus oratt_grid/oraclepwd@oracache;
    INSERT INTO oratt_grid.readtab VALUES (3,'Welcome');
    DELETE FROM oratt_grid.readtab WHERE keyval=2;
    UPDATE oratt_grid.readtab SET str='Hi' WHERE keyval=1;
    Commit.
    commit;
    The output is the following.
    Commit complete.

    Since the read-only cache group was created with an autorefresh interval of 5 seconds, the TimesTen oratt_grid.readtab cache table in the readcache cache group is automatically refreshed after 5 seconds with the committed updates from the cached oratt_grid.readtab table of the Oracle Database. The next step is to test that the data was correctly propagated from the Oracle Database to the TimesTen database.

    Exit ttIsql and exit the shell.

    exit;
    exit;
  2. Use the kubectl exec -it command to invoke the shell in the container of the Pod that is running a data instance.
    kubectl exec -it cachegrid-data-1-0 -c tt -- /bin/bash
  3. Use the TimesTen ttIsql utility to connect to the cachegrid database. Query the TimesTen oratt_grid.readtab table to verify that the table has been updated with the committed updates from the Oracle Database.
    ttIsql cachegrid
    The output is similar to the following.
    Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
    
    
    
    connect "DSN=cachegrid";
    Connection successful: DSN=cachegrid;Durability=0;UID=timesten;
    DataStore=/tt/home/timesten/datastore/cachegrid;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;PermSize=200;
    Connections=100;OracleNetServiceName=Oracache;
    (Default setting AutoCommit=1)
     SELECT * FROM oratt_grid.readtab;
    The output is the following.
    < 1, Hi >
    < 3, Welcome >
    2 rows found.
    Exit ttIsql and exit the shell.
    exit;
    exit;

You have verified that TimesTen Cache is working correctly.