About Performing a Basic Patch Upgrade

A basic patch upgrade is used when you do not have critical uptime requirements and short maintenance windows. When you stop the database, the contents of the shared memory segment is written to the checkpoint file on disk. The shared memory segment is then destroyed. When you start the database after an upgrade, a new shared memory segment is created and the contents of the checkpoint file are read into this newly created shared memory segment. Depending on the size of your database, the checkpoint operation performed when the database stops and the subsequent ramLoad operation performed when the database starts could be time consuming.

The process involves downloading the TimesTen full distribution (the upgrade release) and creating a new installation. The instance that requires upgrading is then modified to point to the new installation. The ttInstanceModify utility is used to perform this instance modification. As previously noted, you must close all TimesTen databases and disconnect all applications from TimesTen.

Download and Create the New Installation

To upgrade to a new patch release of TimesTen, you must first create the new installation.

  1. Create the subdirectory into which you will download and unzip the new full distribution of TimesTen. Navigate to this directory and download the new full distribution into this directory. Then, use the ZIP utility to unpack this distribution. This example creates the new_installation_dir subdirectory and unpacks the timesten2211260.server.linux8664.zip file. Unzipping the timesten2211260.server.linux8664.zip file creates the new installation that will be used for this patch upgrade.
    % mkdir -p new_installation_dir
    % cd new_installation_dir

    Download the full distribution into the new_installation_dir subdirectory. Then use the ZIP utility to unpack the distribution.

    % unzip /timesten/installations/timesten2211260.server.linux8664.zip
    Archive:  /timesten/installations/timesten2211260.server.linux8664.zip
       creating: tt22.1.1.26.0/
    ...
  2. Optional: Use the ttInstallationCheck utility, located in the bin subdirectory of the new installation (new_installation_dir/bin in this example) to verify the installation is successful.
    % new_installation_dir/tt22.1.1.26.0/bin/ttInstallationCheck
    This installation has been verified.
    
  3. Optional: Verify the subdirectories are created under the full installation directory. These subdirectories may change from release to release.
    % ls new_installation_dir/tt22.1.1.26.0
    3rdparty     bin      info        network        plsql    ttoracle_home
    PERL         grid     kubernetes  nls            startup
    README.html  include  lib         oraclescripts  support
    
You have successfully created the new installation.

Unload the Database from Memory

Perform the following steps to unload the database from memory.

  1. Close the database. This prevents any future connections to the database.
    % ttAdmin -close database1
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : True
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database State                  : Closed
    

    See Opening and Closing the Database for User Connections in the Oracle TimesTen In-Memory Database Operations Guide.

  2. Disconnect all applications from the database. See Disconnecting from a Database in the Oracle TimesTen In-Memory Database Operations Guide for details.
  3. Unload the database from memory. See Specifying a RAM Policy in the Oracle TimesTen In-Memory Database Operations Guide for information on specifying a RAM policy.

    If the RAM policy is set to always, change it to manual, then unload the database from memory.

    % ttAdmin -ramPolicy manual -ramUnload database1
    
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : False
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database state                  : closed
    

    If the RAM policy is set to manual, unload the database from memory.

    ttAdmin -ramUnload database1
    
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : False
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database state                  : closed
    

    If the RAM policy is set to inUse and a grace period is set, set the grace period to 0 or wait for the grace period to elapse. TimesTen unloads a database with an inUse RAM policy from memory once all active connections are disconnected.

    % ttAdmin -ramGrace 0 database1
    
    RAM Residence Policy            : inUse
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database state                  : closed
    

Modify the Instance to Point to the New Installation

The patch upgrade process requires you to modify the existing TimesTen instance to point to the new installation.
Perform these steps:
  1. Use the ttDaemonAdmin utility to stop the TimesTen main daemon.
    % ttDaemonAdmin -stop
    TimesTen Daemon (PID: 21031, port: 6624) stopped.
    
  2. Use the ttInstanceModify utility to modify the myinstance instance to point to the new installation. Recall that the TimesTen full distribution was unpacked and a new installation was created in new_installation_dir/tt22.1.1.26.0. See "Download and Create the New Installation" for details.
    % $TIMESTEN_HOME/bin/ttInstanceModify -install new_installation_dir/tt22.1.1.26.0
    
    Instance Info (UPDATED)
    -----------------------
    
    Name:           myinstance
    Version:        22.1.1.26.0
    Location:       /scratch/ttuser/myinstance
    Installation:   new_installation_dir/tt22.1.1.26.0
    Daemon Port:    6624
    Server Port:    6625
    
    
    The instance myinstance now points to the installation in new_installation_dir/tt22.1.1.26.0
  3. Use the ttDaemonAdmin utility to restart the TimesTen main daemon. Then run the ttVersion utility to verify the myinstance instance has been upgraded to the new patch release (22.1.1.26.0, in this example).
    % ttDaemonAdmin -start
    TimesTen Daemon (PID: 20699, port: 6624) startup OK.
    
    % ttVersion
    TimesTen Release 22.1.1.26.0 (64 bit Linux/x86_64) (myinstance:6624) 2021-09-15T16:53:47Z
      Instance admin: instanceadmin
      Instance home directory: /scratch/ttuser/myinstance
      Group owner: g900
      Daemon home directory: /scratch/ttuser/myinstance/info
      PL/SQL enabled.
    
You have successfully modified the instance to point to the new installation.

Load the Database into Memory

Follow these steps to load a database into memory.

  1. Load the database into memory. This example sets the RAM policy to manual and then loads the database1 database into memory.

    Set the RAM policy to manual.

    % ttAdmin -ramPolicy manual database1
    
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : False
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database state                  : closed
    

    Load the database1 database into memory.

    % ttAdmin -ramLoad database1
    
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : True
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database state                  : closed
    

    See Specifying a RAM Policy in the Oracle TimesTen In-Memory Database Operations Guide for information on the RAM policy.

  2. Open the database for user connections.
    % ttAdmin -open database1
    RAM Residence Policy            : manual
    Manually Loaded In RAM          : True
    Replication Agent Policy        : manual
    Replication Manually Started    : False
    Cache Agent Policy              : manual
    Cache Agent Manually Started    : False
    Database State                  : Open
    

    See Opening and Closing the Database for User Connections in the Oracle TimesTen In-Memory Database Operations Guide.

Verify the Patch Upgrade

Verify the patch upgrade:
  1. Verify the instance administrator user (instanceadmin, in this example) can connect to the database1 database and perform a query.
    % ttisql database1;
    
    Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
    
    
    
    connect "DSN=database1";
    Connection successful: DSN=database1;UID=instanceadmin;DataStore=/scratch/ttuser/database1;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;LogBufMB=1024;
    PermSize=500;TempSize=300;
    (Default setting AutoCommit=1)
    Command> connect adding "uid=user1;pwd=********" as user1;
    Connection successful: DSN=database1;UID=user1;DataStore=/scratch/ttuser/database1;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;LogBufMB=1024;
    PermSize=500;TempSize=300;
    (Default setting AutoCommit=1)
    user1: Command> SELECT COUNT (*) FROM employees;
    < 107 >
    1 row found.
    
You have successfully performed the patch upgrade.