About Performing a Fast Patch Upgrade

Consider performing a fast patch upgrade when you have large databases and you have both critical uptime requirements and short maintenance windows. During the fast patch upgrade, the static checkpoint operation performed at database stop is optional, and the shared memory segment is preserved after the subdaemon disconnects. When the database is started, the checkpoint operation is not performed and a new subdaemon connects to this preserved shared memory segment. This reduces the time it takes to upgrade an instance, especially if your databases are large, by skipping both the load of the database into memory operation and the checkpoint operation.

To use a fast patch upgrade, the ramPolicy for the database must be set to enduring. This keeps the database image in memory after the subdaemon disconnects. See Specifying a RAM Policy in the Oracle TimesTen In-Memory Database Operations Guide for information on setting a RAM policy.

The size of the TimesTen shared memory segment must remain the same before and after the fast patch upgrade. The TimesTen ttShmSize utility is provided to calculate the size of the shared memory segment. Run this utility before you upgrade the instance and then run it again after you upgrade the instance to ensure the size of the shared memory segment has not changed after the upgrade. In addition, ensure you do not modify the PermSize, the TempSize, the LogBufMB, and the Connections connection attributes after the upgrade. These attributes affect the size of the shared memory segment.

See ttShmSize and Connection Attributes in the Oracle TimesTen In-Memory Database Reference for information on the ttShmSize utility and the TimesTen connection attributes.

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.

Prepare to Detach the Subdaemon from the Shared Memory Segment

Perform these operations on the instance created with the current release of TimesTen (22.1.1.25.0, in this example).

  1. Optional: Run the ttVersion utility to verify the current TimesTen release (22.1.1.25.0, in this example).
    % ttVersion
    TimesTen Release 22.1.1.1.0 (64 bit Linux/x86_64) (myinstance:6624) 2021-09-16T07:41:05Z
      Instance admin: instanceadmin
      Instance home directory: /scratch/ttuser/myinstance
      Group owner: g900
      Daemon home directory: /scratch/ttuser/myinstance/info
      PL/SQL enabled.
    
  2. Run the ttStatus utility to check if the database is open to user connections and if there are connections to the database (database1, in this example). In this example, the database1 database is open and there are two connections to the database.
    % ttStatus
    TimesTen status report as of Fri Sep 24 05:46:05 2021
    
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Data store /scratch/ttuser/database1
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    There are 14 connections to the data store
    Shared Memory Key 0x0b100699 ID 547979276
    PL/SQL Memory Key 0x0a100699 ID 547946502 Address 0x5000000000
    Type            PID     Context             Connection Name              ConnID
    Process         15076   0x0000000001f09990  database1                         1
    Process         15076   0x00000000020272b0  conn2                             2
    Subdaemon       21036   0x0000000000f3c260  Manager                        2047
    Subdaemon       21036   0x0000000000fbdbc0  Rollback                       2046
    Subdaemon       21036   0x000000000103cf40  XactId Rollback                2037
    Subdaemon       21036   0x00007f9fbc0008c0  Deadlock Detector              2043
    Subdaemon       21036   0x00007f9fc00008c0  Checkpoint                     2042
    Subdaemon       21036   0x00007f9fc007f9e0  Garbage Collector              2036
    Subdaemon       21036   0x00007f9fc40008c0  Monitor                        2044
    Subdaemon       21036   0x00007f9fcc0008c0  Flusher                        2045
    Subdaemon       21036   0x00007f9fcc0a0e70  Aging                          2041
    Subdaemon       21036   0x00007fa04c0008c0  HistGC                         2039
    Subdaemon       21036   0x00007fa0501bbb70  Log Marker                     2040
    Subdaemon       21036   0x00007fa054048370  IndexGC                        2038
    Open for user connections
    Replication policy  : Manual
    Cache Agent policy  : Manual
    PL/SQL enabled.
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
  3. Use the ttAdmin utility to close the database1 database. This prevents further user connections.
    % 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
    
  4. Disconnect all applications from the database. Run the ttStatus utility to verify there are no connections to the database (database1, in this example).
    % ttStatus
    TimesTen status report as of Fri Sep 24 05:49:55 2021
    
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Data store /scratch/ttuser/database1
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    There are 12 connections to the data store
    Shared Memory Key 0x0b100699 ID 547979276
    PL/SQL Memory Key 0x0a100699 ID 547946502 Address 0x5000000000
    Type            PID     Context             Connection Name              ConnID
    Subdaemon       21036   0x0000000000f3c260  Manager                        2047
    Subdaemon       21036   0x0000000000fbdbc0  Rollback                       2046
    Subdaemon       21036   0x000000000103cf40  XactId Rollback                2037
    Subdaemon       21036   0x00007f9fbc0008c0  Deadlock Detector              2043
    Subdaemon       21036   0x00007f9fc00008c0  Checkpoint                     2042
    Subdaemon       21036   0x00007f9fc007f9e0  Garbage Collector              2036
    Subdaemon       21036   0x00007f9fc40008c0  Monitor                        2044
    Subdaemon       21036   0x00007f9fcc0008c0  Flusher                        2045
    Subdaemon       21036   0x00007f9fcc0a0e70  Aging                          2041
    Subdaemon       21036   0x00007fa04c0008c0  HistGC                         2039
    Subdaemon       21036   0x00007fa0501bbb70  Log Marker                     2040
    Subdaemon       21036   0x00007fa054048370  IndexGC                        2038
    Closed to user connections
    RAM residence policy: Manual
    Data store is manually loaded into RAM
    Replication policy  : Manual
    Cache Agent policy  : Manual
    PL/SQL enabled.
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
  5. Run the ttShmSize utility to return the size of the shared memory segment. This size must match the size of the shared memory segment after the fast patch upgrade is completed.
    % ttShmSize -connStr DSN=database1
    The required shared memory size is 2148239512 bytes.
    
You have completed the preparatory steps to disconnect the subdaemon from the shared memory segment.

Detach the Subdaemon from the Shared Memory Segment

Perform these steps to disconnect the subdaemon from the shared memory segment.

  1. Run the ttAdmin utility to check the ramPolicy for the database1 database. In this example, the ramPolicy is set to manual and the database1 database is manually loaded in RAM.
    % ttAdmin -query 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
    
  2. Use the ttAdmin utility to change the ramPolicy to enduring. The enduring setting preserves the shared memory segment in memory when the subdaemon disconnects from the shared memory segment.
    % ttAdmin -ramPolicy enduring database1
    RAM Residence Policy            : enduring
    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
    
  3. Use the ttAdmin utility with the -shmDetach option to disconnect the subdaemon from the shared memory segment.
    % ttAdmin -shmDetach database1
    RAM Residence Policy            : enduring
    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
    
  4. Use the ttStatus utility to verify the subdaemon is disconnected from the shared memory segment.
    % ttStatus
    TimesTen status report as of Fri Sep 24 06:12:04 2021
    
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Data store /scratch/ttuser/database1
    Daemon pid 21031 port 6624 instance myinstance
    TimesTen server pid 21039 started on port 6625
    There are no connections to the data store
    Closed to user connections
    RAM residence policy: Enduring
    Subdaemon is manually detached from data store (Shared Memory Key 0x0b100699 ID 547979276)
    Replication policy  : Manual
    Cache Agent policy  : Manual
    PL/SQL enabled.
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
The subdaemon is disconnected from the shared memory segment. You are now ready to perform the patch upgrade.

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.

Attach a New Subdaemon to the Existing Shared Memory Segment

Perform these steps to connect a new subdaemon to the existing shared memory segment:

  1. Run the ttShmSize utility to return the size of the shared memory segment. This size must match the size of the shared memory segment before the patch upgrade. Recall the size was 2148239512 bytes. See "Prepare to Detach the Subdaemon from the Shared Memory Segment" for details.
    % ttShmSize -connStr DSN=database1
    The required shared memory size is 2148239512 bytes.
    
  2. Use the ttAdmin utility to attach a new subdaemon to the existing shared memory segment.
    % ttAdmin -shmAttach database1
    RAM Residence Policy            : enduring
    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
    
  3. Use the ttStatus utility to verify the subdaemon is connected to the shared memory segment.
    % ttStatus
    TimesTen status report as of Fri Sep 24 06:35:10 2021
    
    Daemon pid 20699 port 6624 instance myinstance
    TimesTen server pid 20706 started on port 6625
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Data store /scratch/ttuser/database1
    Daemon pid 20699 port 6624 instance myinstance
    TimesTen server pid 20706 started on port 6625
    There are 12 connections to the data store
    Shared Memory Key 0x0b100699 ID 547979276
    PL/SQL Memory Key 0x0d100699 ID 548044806 Address 0x5000000000
    Type            PID     Context             Connection Name              ConnID
    Subdaemon       20704   0x000000000207f260  Manager                        2047
    Subdaemon       20704   0x0000000002100bc0  Rollback                       2046
    Subdaemon       20704   0x000000000217ff40  Aging                          2041
    Subdaemon       20704   0x00007f7ac40008c0  Checkpoint                     2042
    Subdaemon       20704   0x00007f7ac407f9e0  Garbage Collector              2040
    Subdaemon       20704   0x00007f7acc0008c0  Monitor                        2045
    Subdaemon       20704   0x00007f7acc0a0e70  IndexGC                        2038
    Subdaemon       20704   0x00007f7ad00008c0  Deadlock Detector              2043
    Subdaemon       20704   0x00007f7ad007f9e0  XactId Rollback                2039
    Subdaemon       20704   0x00007f7ad40008c0  Flusher                        2044
    Subdaemon       20704   0x00007f7ad407f9e0  HistGC                         2037
    Subdaemon       20704   0x00007f7b580bed90  Log Marker                     2036
    Closed to user connections
    RAM residence policy: Enduring
    Data store is manually loaded into RAM
    Replication policy  : Manual
    Cache Agent policy  : Manual
    PL/SQL enabled.
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
  4. Use the ttAdmin utility to change the ramPolicy back to manual.
    % ttAdmin -ramPolicy manual 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
    
  5. Use the ttAdmin utility to open the database1 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
    
  6. 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.
    
A new subdaemon connected to the preserved shared memory segment. The fast patch upgrade is successful.