Performing an Online Upgrade with Classic Replication
This section describes how to use the TimesTen replication feature to perform online upgrades for applications that require continuous data availability.
This procedure is for classic replication in a unidirectional, bidirectional, or multidirectional scenario.
Typically, applications that require high availability of their data use TimesTen replication to keep at least one extra copy of their databases up to date. An online upgrade works by keeping one of these two copies available to the application while the other is being upgraded. The procedures described in this section assume that you have a bidirectional replication scheme configured and running for two databases, as described in Unidirectional or Bidirectional Replication in the Oracle TimesTen In-Memory Database Replication Guide.
Note the following:
-
For active standby pairs, see Online Upgrades for an Active Standby Pair with No Cache Groups and Online Upgrades for an Active Standby Pair with Cache Groups for details. Online major upgrades for active standby pairs with cache groups are only supported for read-only cache groups. Instead see Offline Upgrades for an Active Standby Pair with Cache Groups for this information.
-
For the use of Oracle Clusterware, see Performing an Online TimesTen Upgrade When Using Oracle Clusterware for information. Online major upgrades are not supported for active standby pairs managed by Oracle Clusterware.
The following sections describe how to perform an online upgrade with replication.
Requirements
To perform online upgrades with replication, replication must be configured to use static ports. See Port Assignments in Oracle TimesTen In-Memory Database Replication Guide for information.
Additional disk space must be allocated to hold a backup copy of the database made by the ttMigrate
utility. The size of the backup copy is typically about the same as the in-use size of the database. This size may be determined by querying the v$monitor
view, using ttIsql
:
Command> SELECT perm_in_use_size FROM v$monitor;
Upgrade Steps
The following steps illustrate how to perform an online upgrade while replication is running. The upgrade host is the host on which the database upgrade is being performed, and the active host is the host containing the database to which the application remains connected.
Step | Upgrade host | Active host |
---|---|---|
1. |
Configure replication to replicate to the active host using static ports. |
Configure replication to replicate to the upgrade host using static ports. |
2. |
n/a |
Connect all applications to the active database, if they are not connected. |
3. |
Disconnect all applications from the database that will be upgraded. |
n/a |
4. |
n/a |
Set replication to the upgrade host to the |
5. |
Wait for updates to propagate to the active host. |
n/a |
6. |
Stop replication. |
n/a |
7. |
Back up the database with |
n/a |
8. |
Stop the TimesTen daemon for the old release. |
n/a |
9. |
Create a new installation and a new instance for the new release. See "Creating an Installation on Linux/UNIX" and "Creating an Instance on Linux/UNIX: Basics" for information. |
n/a |
10. |
Create a DSN for the post-upgrade database for the new release. Adjust parallelism options for the DSN. |
n/a |
11. |
Restore the database from the backup with |
n/a |
12. |
Clear the replication bookmark and logs using |
n/a |
13. |
Start replication. |
n/a |
14. |
n/a |
Set replication to the upgrade host to the |
15. |
n/a |
Start replication. |
16. |
n/a |
Wait for all of the updates to propagate to the upgrade host. |
17. |
Reconnect all applications to the post-upgrade database. |
n/a |
After the above procedures are completed on the upgrade host, the active host can be upgraded using the same steps.
Online Upgrade Example
This section describes how to perform an online upgrade in a scenario with two bidirectionally replicated databases.
In the following discussion, the two hosts are referred to as the upgrade host, on which the instance (with its databases) is being upgraded, and the active host, which remains operational and connected to the application for the duration of the upgrade. After the procedure is completed, the same steps can be followed to upgrade the active host. However, you may prefer to delay conversion of the active host to first test the upgraded instance.
The upgrade host in this example consists of the database upgrade
on the server upgradehost
. The active host consists of the database active
on the server activehost
.
Follow these steps in the order they are presented:
Step | Upgrade host | Active host |
---|---|---|
1. |
Use
|
Use
|
2. |
Disconnect all production applications connected to the database. Any workload being run on the upgrade host must start running on the active host instead. |
Use the ttRepAdmin -receiver -name upgrade -state pause active This command temporarily stops the replication of updates from the database See Set the Replication State of Subscribers in Oracle TimesTen In-Memory Database Replication Guide for details. |
3. |
Wait for all replication updates to be sent to the database For example, call the Command> call ttRepSubscriberWait (,,,,60); < 00 > 1 row found. See ttRepSubscriberWait in the Oracle TimesTen In-Memory Database Reference for information. |
n/a |
4. |
Stop the replication agent with ttAdmin -repStop upgrade From this point on, no updates are sent to the database |
Stop the replication agent with ttAdmin -repStop active From this point on, no updates are sent to the database See Starting and Stopping the Replication Agents in Oracle TimesTen In-Memory Database Replication Guide for details. |
5. |
Use ttMigrate -c upgrade /backup/upgrade.dat |
n/a |
6. |
If the ttDestroy upgrade |
Restart the replication agent on the database ttAdmin -repStart active |
7. |
Create a new installation and a new instance for the new release. See Creating an Installation on Linux/UNIX and "Creating an Instance on Linux/UNIX: Basics" for information. |
Resume replication from ttRepAdmin -receiver -name upgrade -start start active |
8. |
Use ttMigrate -r upgrade /backup/upgrade.dat Change the ramPolicy to manual (The ramPolicy is set to inUse by default).
ttAdmin -ramLoad upgrade Note: In this step, you must use the |
n/a |
9. |
Use ttRepAdmin -receiver -name active -reset upgrade ttRepAdmin -receiver -name active -state stop upgrade sleep 10 ttRepAdmin -receiver -name active -state start upgrade sleep 10 Note: The |
n/a |
10. |
Use ttAdmin -repStart upgrade |
n/a |
11. |
Verify that the database |
If the applications are still running on the database |
12. |
n/a |
Once you are sure that updates are replicated correctly, you can disconnect all of the applications from the database Note: You may choose to delay upgrading the instance with |