3 Create TimesTen Databases

TimesTen Database for OKE provides the ability to use TimesTen databases as a system of record in either a non-replicated environment or in an active standby pair replication scheme. The active standby pair replication scheme configuration is recommended for highest availability. An active standby pair replication scheme includes an active TimesTen database and a standby TimesTen database.

When replication is configured, a replication agent is started for each TimesTen database. The active TimesTen database uses the replication agent to send updates to the standby database, and the standby TimesTen database uses its own replication agent to receive them. Each of these connections is implemented as a separate thread running inside the replication agent process. Replication agents communicate through TCP/IP stream sockets.

For maximum performance, the replication agent detects updates to the active TimesTen database by monitoring the existing transaction log. It then sends these updates to the standby TimesTen database in batches, if possible. Only committed transactions are replicated. On the standby TimesTen database, the replication agent updates the database through an efficient internal interface that avoids the overhead of the SQL layer.

Configuration metadata lets you define the attributes of your TimesTen database and how that database is to interact with other applications and components. The TimesTen Operator supports several metadata files that contain the configuration metadata. Each metadata file has a specific name and purpose. For example:

File Name Description

adminUser

Defines a database user in the TimesTen database and assigns ADMIN privileges to it.

db.ini

Defines the connection attributes of the TimesTen database.

schema.sql

Defines database objects, such as tables, sequences, and users.

testUser

Defines a database user in the TimesTen database and assigns CONNECT privileges to it.

This user is required for the helm test command to work if the ttclassic Helm chart is used to create the TimesTen databases.

There are other metadata files available that enable you to configure other attributes and metadata for the TimesTen database, but they are not required. These configuration options include:

  • Defining operations to be performed after the replication scheme has been configured

  • Configuring TLS for client/server communication to the TimesTen database

  • Configuring an Oracle Wallet for replication operations between TimesTen databases

See About Configuration Metadata Details in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide.

These metadata files can then be used on one or more Kubernetes facilities—such as a ConfigMap, Secret, or init container—to configure TimesTen databases. The TimesTen Operator creates a projected volume called tt-config. This tt-config volume contains the contents of all the ConfigMaps and Secrets specified in the dbConfigMap and dbSecret fields of your TimesTenClassic object. This volume is mounted as /ttconfig in the TimesTen containers. See Populate the /ttconfig Directory in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide.

The TimesTen Operator uses the TimesTenClassic object type to provide the metadata and attributes to define and create TimesTen Classic databases in the specified namespace of your OKE cluster. The metadata and attributes are applicable to replicated and non-replicated configurations. See About Defining TimesTenClassic Objects and About the TimesTenClassic Object Type in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide.

The following table consists of a typical sequence of tasks to create and use TimesTen databases in a Kubernetes cluster.

Task Description More information

Create the metadata files.

Create the metadata files with the configuration attributes and metadata for the TimesTen databases, such as a database user with ADMIN privileges, the connection attributes for the TimesTen databases and the databases objects to be created in the databases.

About Configuration Metadata Details in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

Populate the /ttconfig directory.

Create a ConfigMap, Secret or init container to incorparate the metadata files into the TimesTen containers.

Populate the /ttconfig Directory in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

Create a TimesTenClassic object.

Create a TimesTenClassic object to provide the configuration attributes and metadata to define and create the TimesTen databases in your namespace in a replicated or non-replicated configuration.

Create Replicated TimesTen Classic Databases in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

or

Create Non-Replicated TimesTen Classic Databases in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

Perform operations on the TimesTen databases

Connect, manage, and monitor your TimesTen databases.

Use TimesTen Databases in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

Manage and Monitor TimesTen Classic Databases in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide

Some of the examples described in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide assume that you know the name and location of the TimesTen container image. You can retrieve this information from the description of the Pod of the TimesTen Operator in your specified namespace.

$ kubectl get pods -n <namespace>
NAME                            READY   STATUS    RESTARTS   AGE
timesten-operator-<unique-id>   1/1     Running   0          11m

$ kubectl describe pod timesten-operator-<unique-id> -n <namespace> | grep Image:
   Image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0

These examples also assume you know the name of the Secret with the credentials to Oracle Container Registry. Use the Secret specified during that stack configuration. Also, note that the oci-bv storage class is the default for OKE clusters.

Using Helm to Create the TimesTen Databases

If you want to create TimesTen databases using the ttclassic Helm chart included with the TimesTen Operator, see The ttclassic Chart and Create TimesTen Databases and Test TimesTen in Oracle TimesTen In-Memory Database Kubernetes Operator User's Guide.

You can create a local copy of the ttclassic chart from the /timesten/operator/helm directory in the Pod of the TimesTen Operator in the specified namespace.

kubectl cp timesten-operator-<unique-id>:/timesten/operator/helm/ttclassic ttclassic -n <namespace>