PK
Y7Aoa, mimetypeapplication/epub+zipPK Y7A iTunesMetadata.plist\
This chapter describes upgrading from one release of TimesTen to a newer release of TimesTen. It includes the following topics:
Performing an online upgrade with active standby pair replication
Performing an offline TimesTen upgrade when using Oracle Clusterware
Performing an online TimesTen upgrade when using Oracle Clusterware
Performing a Client/Server online upgrade from TimesTen release 6.0 and above
When a TimesTen database is loaded into shared memory, many of its attributes are fixed, including size, logging options, TimesTen software release number, and the location of its checkpoint and transaction log files on disk. This chapter describes the steps required to change these attributes and to upgrade TimesTen databases when you install a new release of TimesTen.
The following sections describe the compatibility and character set of the installed TimesTen release:
In prior releases of TimesTen, release numbers used either five parts (7.0.0.0.0 and later), or three parts (releases before 7.0.0.0.0, such as 6.0.17) to represent the release. Starting with TimesTen release 11.2.1.0.0, five parts are used, with the first three parts, such as 11.2.2, indicating a major release of TimesTen. The fourth part indicates the patch release of a major release, and the fifth part indicates a port patch. For example, TimesTen release number 11.2.2.2.1 indicates the first port patch of the second patch release of TimesTen 11g Release 2 (11.2.2).
TimesTen databases are not compatible between major releases, but they are always compatible between patch releases. For example, a database created with TimesTen release 7.0.5.1.0 is not compatible with a TimesTen release 11.2.1.1.0 application, but a database created with TimesTen 11.2.1.0.0 is compatible with a TimesTen release 11.2.1.1.0 application.
TimesTen supports a selection of Oracle data types in addition to the original TimesTen data types that are maintained for backward compatibility. For details on all data types, see "Type specifications" in the Oracle TimesTen In-Memory Database SQL Reference. Because some Oracle data types have the same names as the backward-compatible TimesTen data types, a set of aliases exists for addressing the data types. Which data types the aliases refer to depends on the TypeMode that is set for the database. See "TypeMode" in the Oracle TimesTen In-Memory Database Reference for more information.
TimesTen backward-compatible data types are replication-compatible with the data types in releases of TimesTen before 7.0. However, TimesTen backward-compatible data types are not compatible with TimesTen IMDB Cache to Oracle— use only Oracle data types with IMDB Cache to Oracle. If you want to use IMDB Cache to Oracle, you must convert any original TimesTen data types to the new Oracle data types when performing a database upgrade with ttMigrate. See "Converting data types to Oracle data types" for details.
Oracle data types are not replication-compatible with releases of TimesTen before 7.0. To perform an upgrade that requires replication with a release of TimesTen from before 7.0, you must upgrade the original data types as TimesTen data types. See "Upgrading data types as TimesTen data types" for more information.
TimesTen requires a database to be configured to support a specific character set when it is created. The character set for the database is specified using the database attribute DatabaseCharacterSet
. The value of this attribute is used to determine which characters may be input to and output from character fields, and how character data is stored and sorted. See "Choosing a database character set" in the Oracle TimesTen In-Memory Database Operations Guide for more information.
Before upgrading your database from a release before TimesTen 7.0, you must specify a database character set by adding the DatabaseCharacterSet
attribute to your database's DSN. This attribute is ignored by releases of TimesTen before 7.0. In most cases, you want to choose a database character set that makes sense for your region and that matches the character data that is present in your database. Consider the following important restrictions, however.
If you plan to use the database with TimesTen IMDB Cache to Oracle, you must specify a value for DatabaseCharacterSet
that is the same as the character set specified for the Oracle database that the TimesTen database connects to.
Replication is not possible between databases with different character sets. Because databases created with releases of TimesTen before 7.0 do not have a database character set specified, a special database character set, TIMESTEN8
, has been created, which allows replication compatibility between databases created by the current release of TimesTen and those created by earlier releases. If you plan to perform the database upgrade as an online upgrade with replication (see "Performing an online upgrade with replication"), then you must specify a DatabaseCharacterSet
of TIMESTEN8
in your DSN.
If you use TimesTen Client/Server and intend to connect to the upgraded database with an application linked to a Client ODBC library from a release before TimesTen 7.0, you must specify a DatabaseCharacterSet
of TIMESTEN8
in your DSN to ensure compatibility. See "Performing a Client/Server online upgrade from TimesTen release 6.0 and above".
Note: TheTIMESTEN8 database character set is intended for use only when transitioning from a release of TimesTen before 7.0. When you no longer need your database to replicate to a pre-7.0 release of TimesTen, or to connect to a pre-7.0 client application, you should use ttMigrate to convert your database to a database character set other than TIMESTEN8 . See "Database character set conversion" for details. |
TimesTen includes three utilities that may be used when upgrading databases.
The ttBackup
and ttRestore
utilities can export and import, respectively, an image copy of the TimesTen database. This database image is only compatible between patch releases of TimesTen, and it must be backed up and restored using the same bit-level of TimesTen (32-bit or 64-bit). You may use the ttBackup
and ttRestore
utilities to:
Move a database from one TimesTen instance to another TimesTen instance running the same major release version of TimesTen.
Move a database from one computer to another computer running the same major release version of TimesTen.
Move a database from one patch release of TimesTen (such as 11.2.2.1.0) to a different patch release of TimesTen (such as 11.2.2.2.0).
The ttMigrate
utility, however, exports the TimesTen database to a release-neutral format that can be used to migrate the database across major releases and between 32-bit and 64-bit versions of TimesTen. You must use the ttMigrate
utility to:
Move a database from one major release of TimesTen (such as 7.0) to a different major release (such as 11.2.2).
Move a database from a 32-bit version of TimesTen to a 64-bit version (or vice versa).
Reduce the size of a TimesTen database.
Note: ThettMigrate utility cannot migrate databases across different hardware platforms. For example, you cannot migrate a Windows database to a Solaris database. The release of ttMigrate must also match the release of the database you are copying from or to. In the procedures detailed in the following sections, use the ttMigrate utility in the older version to save the tables of the original database a disk file and use the ttMigrate utility in the new version to restore the file into the new database. |
On Windows, these utilities use the ODBC driver manager.
On UNIX platforms, the utilities are directly linked with the TimesTen Data Manager ODBC driver.
For a full description of the syntax and usage of these and other utilities, see "Utilities" in the Oracle TimesTen In-Memory Database Reference.
Access control is mandatory in TimesTen beginning with release 11.2.1. If you have been using previous versions of TimesTen without access control and you do not want to initially secure your database objects after upgrading to the current release, you can grant the ADMIN
system privilege to PUBLIC
using the following SQL command:
GRANT ADMIN TO PUBLIC;
If you grant the ADMIN
privilege to PUBLIC
, all users have unrestricted access to all database objects and are able to perform all administrative tasks, except for those tasks that must be performed as the instance administrator. Granting the ADMIN
privilege to PUBLIC
should be viewed as a temporary workaround, for upgrade purposes only.
Note: This is never recommended as a long-term approach, as it results in an inherently insecure system. |
When performing an upgrade from a release before TimesTen 7.0, you must choose whether to preserve the data types in your database as TimesTen data types, or whether to convert them to Oracle data types. Your planned use for the database and your preferred upgrade method have an impact on this decision.
Note: If you intend to use your database with TimesTen IMDB Cache, you must convert your data types to Oracle data types. However, you cannot perform an online upgrade using replication in this case, as data types may only replicate to like data types.This is not an issue if you are upgrading from TimesTen 7.0 or later and your data types have been converted to Oracle data types. |
To convert the data types from a release before TimesTen 7.0 to Oracle data types, you must use the -convertTypesToOra
option for ttMigrate
when you restore your database as part of your upgrade procedure. For example, if you restore the database salesdata
as part of an upgrade procedure, you may use the following to upgrade the data types to Oracle data types:
ttMigrate -r -convertTypesToOra salesdata salesdata.mig
See "TimesTen to Oracle data type conversions" in the Oracle TimesTen In-Memory Database Reference for more information.
Note: Because the Oracle and TimesTen versions of some data types behave slightly differently, you should thoroughly test any applications written for releases of TimesTen before 7.0 with the Oracle data types before deploying them with the new release of TimesTen. |
Note: If you intend to perform an online upgrade using replication, you must upgrade your data types as TimesTen data types. See "Online upgrades with replication" for more information. |
If you choose to upgrade the data types in a database from a release before TimesTen 7.0 as TimesTen data types, you are not required to use any special options when restoring the database with ttMigrate
. The data types from a release before TimesTen 7.0 are automatically restored as TimesTen data types.
Note: The defaultTypeMode attribute for databases is 0, which indicates Oracle type mode. In Oracle type mode, a data type such as CHAR has the semantics of the Oracle CHAR data type rather than the TimesTen CHAR data type. To guarantee compatibility with applications written for TimesTen releases before 7.0, you should configure the DSN for your database with a TypeMode of 1 before restoring the database with ttMigrate as part of the upgrade procedure. |
A character set must be specified for each TimesTen database using the DSN attribute DatabaseCharacterSet
. In some cases, you may need to change the configured database character set as part of the upgrade process. There are two different cases in which a database character set conversion are required:
You have specified the database character set as TIMESTEN8
to upgrade your database from a release of TimesTen before 7.0 using online upgrade with replication or Client/Server. After the upgrade is complete for all databases and client applications, you should convert each database from this special transitional character set to the national character set you prefer to use for your region. See "Converting from the TIMESTEN8 character set".
You must change your database's character set from the one that you originally specified to a new one that fits your requirements more closely. See "Converting from a character set other than TIMESTEN8", following shortly.
You may use ttMigrate
to convert a database from TIMESTEN8
to any other character set by completing the following steps:
Save the database to a file using ttMigrate
. For example, to save the database salesdata
to the file salesdata.mig
, use the command:
ttMigrate -c DSN=salesdata salesdata.mig
Destroy the database:
ttDestroy salesdata
Change the value of the DSN attribute DatabaseCharacterSet
for your database to the value specifying the new character set. For example, if you want your database to use the WE8ISO8859P1
character set instead of TIMESTEN8
, use the following line in your ODBCINI
file:
DatabaseCharacterSet=WE8ISO8859P1
Load the database from the file using ttMigrate
with the -noCharsetConversion
command-line option. This option ensures that no character values are changed when the data is loaded into the DSN using the new character set. For example:
ttMigrate -r -noCharsetConversion DSN=salesdata salesdata.mig
Note: If you find that you have accidentally converted your database fromTIMESTEN8 to the wrong character set, you can use the same procedure to convert your database to the correct character set without any accidental modification of the character data. |
You may use ttMigrate
to convert a database from any character set to any other character set by completing the following steps:
Save the database to a file using ttMigrate
. For example, to save the database salesdata
to the file salesdata.mig
, use the command:
ttMigrate -c DSN=salesdata salesdata.mig
Destroy the database:
ttDestroy salesdata
Change the value of the DSN attribute DatabaseCharacterSet
for your database to the value specifying the new character set. For example, if you want your database to use the WE8ISO8859P1
character set, use the following line in your ODBCINI
file:
DatabaseCharacterSet=WE8ISO8859P1
Load the database from the file using ttMigrate
. TimesTen automatically converts the character data from the character set the file was saved with to the character set used by the DSN. For example:
ttMigrate -r DSN=salesdata salesdata.mig
Note: It is possible that character data is lost in the conversion process if no mapping exists from one character set to the other for a given character. |
TimesTen enables you to perform the following types of upgrades:
TimesTen databases from different patch releases of the same major release are structurally equivalent or identical. For example, when upgrading from release 11.2.2.0.0 to 11.2.2.1.0, you are not required to migrate your existing databases using the ttMigrate
utility, unless you change the instance name and or daemon home directory. If you are changing the instance name or the daemon home directory, keep the old installation installed. Install the new installation. Then use the ttAdoptStores
utility to move your data stores to the new installation. Review your data stores, then remove the old instance of TimesTen.
However, during the installation of any new release, you should disconnect your application and stop the TimesTen daemon. If you have not explicitly performed these steps, the TimesTen daemon process from the prior release is stopped, effectively disconnecting all applications from the database. While preparing for the upgrade, ensure that all databases are unloaded from memory before upgrading TimesTen.
For a description of the procedures for unloading a database from memory, see "Unloading a database from memory".
In-place upgrades are available (on UNIX systems only) for moving to a new patch release of TimesTen, such as moving from the first patch release of 11.2.2, release 11.2.2.1.0, to the second patch release of 11.2.2, release 11.2.2.2.0.
In a TimesTen in-place upgrade, software libraries and binaries are updated in place while the TimesTen directory structure and database files remain unchanged.
During the in-place upgrade process, all applications must disconnect from databases in the TimesTen instance being upgraded. This type of upgrade enables you to preserve the existing databases in the TimesTen instance without using the TimesTen backup and migration utilities.
During the time required to perform an offline upgrade, the database is not available to applications. Offline upgrades usually require enough disk space for an extra copy of the upgraded database.
Offline upgrades are used to do the following:
Move to a new major or patch release of TimesTen.
Move to a different directory or computer.
Reduce database size.
Move between 32-bit and 64-bit databases.
Offline upgrades require all applications to disconnect from the database during the upgrade procedure. The database must also be unloaded from shared memory. Offline upgrades require you to use TimesTen's ttMigrate
or ttBackup
utilities. (See "ttMigrate
" and "ttBackup
" in Oracle TimesTen In-Memory Database Reference.)
See "Performing an offline upgrade" and "Performing an offline TimesTen upgrade when using Oracle Clusterware".
When upgrading to a new major release of TimesTen, you may have a mission-critical database that must remain continuously available to your applications. You can use TimesTen replication to keep two copies of a database synchronized, even when the databases are from different releases of TimesTen, allowing your applications to stay connected to one copy of the database while the other one is being upgraded. When the upgrade is finished, any updates that have been made on the active database are transmitted immediately to the upgraded database, and your applications can then be switched to the upgraded database with no data loss and no down time. For more information, see "Performing an online upgrade with replication".
The online upgrade process supports only updates to user tables during the upgrade. Data definition changes such as CREATE TABLE
or CREATE INDEX
are not replicated. In addition, all tables to be replicated must have a PRIMARY KEY
or a unique index on non-nullable columns. Because two copies of the database to be upgraded are required, you must have available twice the memory and disk space that the database usually requires, if performing the upgrade on a single system.
In addition to the reference above, also refer to the following topics related to replication:
If you are upgrading a TimesTen Client/Server installation to a new major release, you can minimize downtime by performing a Client/Server online upgrade. During this process, TimesTen clients from the previous release are able to continue to communi cate with a database that has been upgraded to the new release. See "Performing a Client/Server online upgrade from TimesTen release 6.0 and above".
The Client/Server online upgrade process minimizes, but does not eliminate, the interruption of client application access to the database being upgraded. To maintain nearly continuous availability of a database to all clients, you may use the approach outlined in "Online upgrades with replication". This procedure keeps an identical copy of the database available to the old release of TimesTen Server, while you upgrade the original to the new release. Once the upgraded original database is available to the new release of TimesTen Server, you may stop the old release and start the new release, listening on the same port. The only interruption in availability using this method is the very brief period after the old server is stopped and before the new server is started.
You can perform an "in-place upgrade" of a TimesTen instance (on UNIX systems only), which does not require exporting its databases to an external format. Prior to the upgrade, for each database in the instance, all applications must disconnect from the database and the database must be unloaded from shared memory.
The following subsections discuss the process for performing an in-place upgrade:
All steps must be completed for each database in the TimesTen instance.
A TimesTen database remains loaded in shared memory as long as any applications or TimesTen agents, such as the cache agent or replication agent, is connected to it. A database may also be kept in shared memory if the RAM policy of the database has been modified using the ttAdmin
utility, even when no applications or agents are connected. (See "ttAdmin
" in Oracle TimesTen In-Memory Database Reference.)
Use the following steps to unload a database from memory in a TimesTen instance being upgraded.
Disconnect all applications from the database.
If the replication agent is running on the database, set the replication state to pause
and stop the replication agent. This example references an active standby pair, activedb
and standbydb
, where activedb
belongs to the TimesTen instance being upgraded. The example sets the replication state from activedb
to standbydb
to pause
, then stops the replication agent on activedb
. Assume standbydb
does not belong to the TimesTen instance being upgraded.
ttRepAdmin -receiver -name activedb -state pause standbydb ttAdmin -repStop activedb
If the cache agent is running on the database, stop the cache agent. This example references a database cachedb
that uses IMDB cache and belongs to the TimesTen instance being upgraded. (The example does not consider replication.)
ttAdmin -cacheStop cachedb
If the RAM policy is set to manual
, unload the database from memory using ttAdmin
. This example references a database upgradedb
that belongs to the TimesTen instance being upgraded (and does not consider replication or cache):
ttAdmin -ramUnload upgradedb
If the RAM policy is set to always
, change it to manual
, then unload the database from memory. For example:
ttAdmin -ramPolicy manual -ramUnload upgradedb
If the RAM policy is inUse
and a grace period is set, set the grace period to 0 or wait for the grace period to elapse. For example:
ttAdmin -ramGrace 0 upgradedb
Use the ttStatus
utility to verify that the databases belonging to the TimesTen instance being upgraded have been unloaded from memory. (See "ttStatus" in Oracle TimesTen In-Memory Database Reference.)
Also see the next section, "Reloading a database into memory".
Note: Theactivedb , cachedb and upgradedb databases, for example, can be the same database. A TimesTen database can have both replication and cache configured, as well as a RAM policy other than manual. |
When doing an in-place upgrade (applicable on UNIX systems only), you must use the TimesTen installer option to upgrade an existing instance (not install a new instance). UNIX installer options are covered in "Installing TimesTen".
After unloading the databases from memory (as shown in the preceding section, "Unloading a database from memory") and upgrading the TimesTen instance, use commands such as the following to reload a database into memory. (These examples are independent of each other.) Such steps must be performed, as applicable, for each database in the instance that was upgraded.
To restart replication (assuming activedb
of an active standby pair was in the TimesTen instance being upgraded):
ttRepAdmin -receiver -name activedb -state start standbydb ttAdmin -repStart activedb
To restart IMDB cache (assuming cachedb
uses cache and was in the TimesTen instance being upgraded):
ttAdmin -cacheStart cachedb
To reload the database into memory (assuming RAM policy was set to manual
for the database upgradedb
, which was in the TimesTen instance being upgraded):
ttAdmin -ramLoad upgradedb
If you changed the RAM policy from always
to manual
when you unloaded the database from memory, change it back to always
. For example:
ttAdmin -ramPolicy always upgradedb
If the RAM policy was inUse
before you unloaded the database from memory and you changed the grace period to 0, change it back to its original setting. For example:
ttAdmin -ramGrace 300 upgradedb
You can do an offline upgrade by exporting the database into an external file and then importing the database with the desired changes. These update procedures require that all applications be disconnected from the database and that the database be unloaded from shared memory. For applications that require continuous availability, see "Performing an online upgrade with replication".
Note: If the database to be upgraded is replicated, you must usettMigrate to move the database between releases. |
For simple upgrades that do not require any changes to the size or structure of the database, such as moving between patch releases, you can use the ttBackup
and ttRestore
utilities. For upgrades that require structural changes to the database, such as major release upgrades, you must use the ttMigrate
utility. The ttMigrate
utility exports the database in a release-neutral format that is more flexible, while the ttBackup
utility exports an image copy of the database that is only compatible across patch releases. The ttBackup
utility may be used to move the database to a different computer or directory. The ttMigrate
utility must be used if you want to do the following:
Move to a new major or patch release of TimesTen.
Reduce database size.
Move between 32-bit and 64-bit databases.
The general steps in an offline upgrade include:
Disconnect all applications from the database and unload the database from memory. For more information, see "Unloading a database from memory".
Use either ttMigrate
with the -c
and -relaxedUpgrade
options or ttBackup
to back up the database.
Install the new release of TimesTen. For more information, see Chapter 1, "TimesTen Installation".
Use either ttMigrate
with the -r
and -relaxedUpgrade
options or ttRestore
to restore the backed up database to the new TimesTen release.
Reconnect applications to the upgraded database.
Note: AfterttMigrate has been used, all autorefresh cache groups in a destination database that is not part of an active standby pair have AUTOREFRESH STATE set to OFF , no matter how it was set on the source database. Reset AUTOREFRESH STATE to ON by using the ALTER CACHE GROUP statement. |
The TimesTen daemon identifies a database by the full path name of the database's checkpoint files. To move a TimesTen database to a different directory, back up the database using the ttBackup
utility, create a new DSN definition that specifies the new database path name, then restore the database into its new location using the ttRestore
utility. When you have verified that the database functions properly in the new location, free up the disk space by using ttDestroy
to remove the old database.
For example, to move a database from /old/SalesData/sales
with a database name SalesData
("DSN=SalesData"
) to /new/SalesData/sales
with database name NewSalesData
("DSN=NewSalesData"
), using the /tmp/dump
directory for temporary storage, use the following commands:
mkdir /tmp/dump
ttBackup -dir /tmp/dump -fname salesdata "DSN=SalesData"
Create a DSN definition for the NewSalesData
database and specify the new database path: /new/SalesData/sales/NewSalesData
.
ttRestore -dir /tmp/dump -fname salesdata "DSN=NewSalesData"
(Verify that NewSalesData
is operational.)
rm -r /tmp/dump
ttDestroy /old/SalesData/sales/SalesData
Remove the DSN definition for the SalesData
database.
Note: You must reconfigure replication if the moved database has been configured to replicate. |
You can also use the ttBackup
and ttRestore
utilities to move a database between two computers that have the same CPU architecture and are running the same operating system.
Note: Before moving a replicated database to another computer, you should be experienced with TimesTen replication. We highly advise calling TimesTen customer support for help with this procedure. |
To copy a database from one system to another with the same CPU architecture and operating system:
Back up the database on the original system using ttBackup
.
Move the backup to the new system.
Reconfigure the replication scheme on any databases the replicate to the moved database to specify the new host computer. (See "Reversing the roles of the master databases" in Oracle TimesTen In-Memory Database Replication Guide for information relevant in specifying a host in a replication scheme.)
Restore the backup using ttRestore
.
The following example uses the -o
flag of ttBackup
to use standard output for the backup. Using the -o
flag, the backup is stored in a single file, which is easily copied over the network to the other system. Once you have copied the database to the other system, you must create a data source name for access to the new database copy.
To move a database from /ds/Sales/Data
with database name salesdata
on the source system to /data/Sales/View
with database name salesview
on the destination system, use the following commands.
Step | On the source system | On the destination system |
---|---|---|
1. | ttBackup -o "DSN=SalesData" >/tmp/salesbackup | |
2. | ftp /tmp/salesbackup to the destination system as /tmp/salesbackup
Note: Use the | |
3. | ttRestore -i"DSN=SalesView" </tmp/salesbackup | |
4. | rm /tmp/salesbackup | |
5. | rm /tmp/salesbackup |
Once a database has been defined with a particular size for the permanent partition (indicated by the PermSize
DSN attribute), it cannot be loaded at a smaller size, even if tables or rows are deleted. A copy of the database made with ttBackup
also has the database's permanent partition size embedded in it.
To reduce the allocated size of the permanent partition of a database, save a copy using the ttMigrate
utility with the -relaxedUpgrade
option. Then re-create the database with a smaller permanent partition size and restore the data.
Note: The permanent partition size of a database cannot be reduced below the size that is actually required by the data currently stored in the database. This value can be determined by querying theperm_in_use_size column of the table sys.monitor . |
Perform these steps to reduce the permanent partition size of a database:
Back up the old database, as follows.
ttMigrate -c -relaxedUpgrade
Create a new DSN definition for the new copy of the database with a smaller PermSize
value.
Restore the backup, as follows.
ttMigrate -r -relaxedUpgrade
Note: To modify the original DSN rather than create a new one in Step 2, then you must destroy the original database files using thettDestroy utility before restoring from the backup. |
Here are the steps to reduce a database's allocated size from 400 MB to 100 MB. The database is in /ds/Sales/Data
and has the DSN salesdata
.
ttMigrate -c -relaxedUpgrade DSN=salesdata /tmp/salesbackup
ttDestroy salesdata
Update the DSN salesdata
to have a size of 100 MB.
ttMigrate -r -relaxedUpgrade "DSN=salesdata;AutoCreate\=1" /tmp/salesbackup
Note: The temporary partition size of a database may be changed by simply modifying theTempSize attribute of the DSN, unloading the database from memory, and then reconnecting to it. See "Unloading a database from memory" for the steps to unload a database from memory. |
The internal format of a 32-bit TimesTen database differs from that of a 64-bit database. To convert a 32-bit database to a 64-bit database:
Export the 32-bit database using the TimesTen 32-bit ttMigrate
utility with the -relaxedUpgrade
option.
Create a Data Source Name (DSN) for the 64-bit database. See "Creating a Data Manager DSN on UNIX" or "Creating a Data Manager DSN on Windows" in Oracle TimesTen In-Memory Database Operations Guide.
Import the file created in Step 1 into the 64-bit database DSN using the 64-bit ttMigrate
utility with the -relaxedUpgrade
option.
For example, suppose that the 32-bit database DSN is salesdata32
while the 64-bit database DSN is salesdata64
. If a 32-bit instance of TimesTen is installed in /opt/TimesTen/giraffe32
and a 64-bit instance is installed in /opt/TimesTen/giraffe64
, the required steps are:
/opt/TimesTen/giraffe32/bin/ttMigrate -c -relaxedUpgrade DSN=salesdata32/tmp/salesbackup
/opt/TimesTen/giraffe64/bin/ttMigrate -r -relaxedUpgrade "DSN=salesdata64;AutoCreate=1"/tmp/salesbackup
Note: TimesTen does not support replication between 32-bit and 64-bit databases. |
You can have multiple TimesTen major releases installed on a system at the same time. However, TimesTen databases created by one major release cannot be accessed directly by applications of a different major release. To migrate data between TimesTen major releases, for example from TimesTen 6.0 to 11.2.2, you must export the data using the ttMigrate
utility from the old release and import it using the ttMigrate
utility from the new release. The procedure for this upgrade is similar to the steps outlined in "Moving between 32-bit and 64-bit databases".
If you must upgrade two or more databases that are replicating to each other, you must perform a few extra steps to ensure that replication continues to operate during and after the upgrade. For example, to migrate two replicating databases, master1
on host computer masterhost
and subscriber1
on host computer subscriberhost
, from TimesTen release 6.0 to TimesTen release 11.2.2, perform the steps that follow.
Note: TimesTen 11.2.1 introduced the cache grid feature. By default, this feature is enabled and requires additional configuration before cache groups can be created on a database. If you are upgrading a database containing cache groups from a release preceding 11.2.1, you should set theCacheGridEnable attribute to 0 in each DSN definition before beginning. For more information, see the Oracle In-Memory Database Cache User's Guide. |
Configure the replication scheme on both databases to use static TCP/IP ports for replication. This is necessary because the intermediate result of this procedure is that replication occurs between two different releases of TimesTen. Each release does not necessarily know how to find the main daemon of the other to have the replication ports assigned dynamically. See "Port assignments" in the Oracle TimesTen In-Memory Database Replication Guide for more information.
On the computer masterhost
, use the ttAdmin
utility of the 6.0 release to stop the replication daemon on the database:
ttAdmin -repStop master1
Next, use the ttMigrate
utility of the 6.0 release with the -c
option to back up database master1
to a binary file:
ttMigrate -c DSN=master1 master1.bak
Use the ttDestroy
utility of the 6.0 release to destroy database master1,
where the database's files are located in the directory data_store_path
:
ttDestroy /data_store_path/master1
Use the ttMigrate
utility of the 11.2.2 release with the -r
option to restore database master1
from the binary file. Restoring the database automatically upgrades it from release 6.0 to release 11.2.2. If you are restoring a very large database, you should use the -C
option to tell ttMigrate
to perform a checkpoint operation on the database periodically. This saves time if the restore fails at some point before the operation has been completed. For more information, see "Checkpoint operations" in the Oracle TimesTen In-Memory Database Operations Guide.
ttMigrate -r -C 20 DSN=master1 master1.bak
Use the ttAdmin
utility of the 11.2.2 release to start the replication daemon:
ttAdmin -repStart master1
Replication is now occurring between the database master1
on release 11.2.2 and the database subscriber1
on release 6.0.
Now upgrade database subscriber1
from release 6.0 to release 11.2.2. Perform the steps that follow.
On the computer subscriberhost
, use the ttAdmin
utility of the 6.0 release to stop the replication daemon:
ttAdmin -repStop subscriber1
Use the ttDestroy
utility of the 6.0 release to destroy database subscriber1
, where the database files are located in the directory data_store_path
:
ttDestroy data_store_path/subscriber1
If you are upgrading from a release preceding 11.2.2, you must create a user with ADMIN
privileges to duplicate a database using replication. For example, to create the user pat
with the password patpwd
on the standby master database:
CREATE USER pat IDENTIFIED BY patpwd; GRANT ADMIN TO pat;
Use the ttRepAdmin
utility of the 11.2.2 release with the -duplicate
option to duplicate database subscriber1
from database master1
using replication.
ttRepAdmin -duplicate -from master1 -host masterhost -uid pat -pwd patpwd -setMasterRepStart subscriber1
Use the ttAdmin
utility of the 11.2.2 release to start the replication daemon:
ttAdmin -repStart subscriber1
The databases are now upgraded and replicating to each other.
In "Performing an offline upgrade" we showed how to perform various maintenance operations on TimesTen databases that require that all applications be stopped. This section describes how to use the TimesTen replication feature to perform online upgrades for applications that require continuous data availability. You can do an online upgrade when moving between major TimesTen releases. If moving to a patch release, you may instead perform an in-place or offline upgrade.
Normally, 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" Oracle TimesTen In-Memory Database Replication Guide.
Note: Replication functions across releases only if the database of the more recent release of TimesTen was upgraded from a database of the older release of TimesTen. A database created in the more recent release of TimesTen is not guaranteed to replicate correctly with the older release. For example, replication between a database created in the 5.1 release of TimesTen and a database created in the 7.0 release of TimesTen is not supported. However, if one database was created in the 5.1 release, and the peer database was created in the 5.1 release and then upgraded to the 7.0 release, replication between them is supported. |
Note: For security reasons, replication is not normally allowed between databases in TimesTen 7.0 and databases in releases preceding TimesTen 7.0. To perform an online upgrade with replication, you must start the main TimesTen 7.0 or later daemon with the-insecure-backwards-compat option. |
The following sections describe how to perform an online upgrade with replication.
Upgrading a database from an older TimesTen release to a newer release is performed by disconnecting all applications from one of two replicated copies of a database, making a backup of the database with the ttMigrate
utility from the older release, loading the backup into a newer release database using the ttMigrate
utility from the newer release, and then reconnecting all applications to the upgraded database.
The general steps in an online upgrade include:
Disconnect all applications from the database being upgraded.
Shut down replication on the system being upgraded.
Back up the database residing on the system being upgraded using the older release's ttMigrate
with the -c
option.
Install the newer release of TimesTen on the system being upgraded.
Restore the replicated database on the system being upgraded using the newer release's ttMigrate
with the -r
option.
Reconnect all applications to the upgraded database.
Restart replication on the upgraded system.
Note: AfterttMigrate has been used, all autorefresh cache groups in an upgraded database that is not part of an active standby pair have AUTOREFRESH STATE set to OFF , no matter how it was set on the database before the upgrade. Reset AUTOREFRESH STATE to ON by using the ALTER CACHE GROUP statement. |
To maintain continuous availability, applications continue to run on one copy of the database while the upgrade is performed on the disconnected copy of the database. TimesTen replication retains updates made to the active copy of the database during the upgrade period, and then transfers and applies the updates to the upgraded database when replication is restarted. When the replicated updates have been completely applied, the applications may be reconnected to the upgraded database.
The following timeline illustrates the steps for performing an online upgrade while replication is running. The upgrade system is the system on which the database upgrade is being performed, and the active system is the system containing the database to which the application remains connected.
Note: The following steps are for a standard upgrade. Upgrading from an 11.2.1 database that has the connection attributeReplicationApplyOrdering set to 0 , or from an 11.2.1 or 11.2.2 database that has ReplicationParallelism set to <2 , requires that you re-create the database, even if the version is the same or only the minor version has changed. |
After the above procedures are carried out on the upgrade system, the active system can be upgraded using the same steps.
Online upgrades can be performed only on databases for which all the user tables meet the replication requirements. All the user tables must contain either a PRIMARY KEY
declaration or have a unique index declared over non-nullable columns.
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.
If you are performing an online upgrade on a single system where a bidirectional replication configuration does not exist, you must ensure that enough memory and disk space are available to support two copies of the database being upgraded. Both the original database and its copy remain active for the duration of the upgrade. To maintain the performance of your production applications, you may want to create the copy of the database on a second system.
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 sys.monitor
table, using ttIsql
:
Command> SELECT perm_in_use_size FROM sys.monitor;
This section describes how to perform an online upgrade of two bidirectionally replicated TimesTen databases, using a specific example.
Note: TimesTen 11.2.1 introduced the cache grid feature. By default, this feature is enabled, and requires additional configuration before cache groups may be created on a database. If you are upgrading a database containing cache groups from a release preceding 11.2.1, you should set theCacheGridEnable attribute to 0 in each DSN definition before beginning. For more information, see the Oracle In-Memory Database Cache User's Guide. |
We'll refer to the two TimesTen systems being upgraded as the upgrade system, on which the TimesTen instance and the database are upgraded, and the active system, which remains operational and connected to the application for the duration of the upgrade. After this procedure is completed, the same steps can be followed to upgrade the active system. However, you may prefer to delay conversion of the active system to first test the upgraded TimesTen instance.
The upgrade system in this example consists of the database upgrade
on the server upgradehost
. The active system consists of the database active
on the server activehost
.
Follow the steps listed here in the order they are presented. The online upgrade procedures are as follows.
Step | Upgrade system | Active system |
---|---|---|
1. | Use ttIsql to alter the replication scheme repscheme , setting static replication port numbers so that the databases can communicate across releases:
| Use ttIsql to alter the replication scheme repscheme , setting static replication port numbers so that the databases can communicate across releases:
|
2. | Disconnect all production applications connected to the database. Any workload being run on the upgrade system must start running on the active system instead. | Use the ttRepAdmin utility to pause replication from the database active to the database upgrade :
ttRepAdmin -connStr DSN=active -receiver -name upgrade -state pause This command temporarily stops the replication of updates from the database |
3. | Wait for all replication updates to be sent to the database active . You can verify that all updates have been sent by applying a recognizable update to a table reserved for that purpose on the database upgrade . When the update appears in the database active , you know that all previous updates have been sent. | |
4. | Stop the replication agent with ttAdmin :
ttAdmin -repStop upgrade From this point on, no updates are sent to the database | Stop the replication agent with ttAdmin :
ttAdmin -repStop active From this point on, no updates are sent to the database For details on starting and stopping replication agents, see "Starting and stopping the replication agents" in Oracle TimesTen In-Memory Database Replication Guide. |
5. | Use ttRepAdmin to stop replication from the database upgrade to the database active :
ttRepAdmin -connStr DSN=upgrade -receiver -name active -state stop This step prevents | |
6. | Use ttMigrate to back up the database upgrade . If the database is very large, this step could take a significant amount of time. If sufficient disk space is free on the /backup file system, use the following ttMigrate command:
ttMigrate -c DSN=upgrade /backup/upgrade.dat | |
7. | If the ttMigrate command is successful, destroy the database upgrade .
To destroy a permanent database ( ttDestroy upgrade To destroy a temporary database ( ttAdmin -ramUnload upgrade | Restart the replication agent on the database active :
ttAdmin -repStart active |
8. | Install the new release of TimesTen. | Resume replication from active to upgrade by setting the replication state to start :
ttRepAdmin -connStr DSN=active -receiver -name upgrade -start start |
9. | Use ttMigrate to load the backup created in Step 6. into the database upgrade for the new release of TimesTen:
ttMigrate -r "DSN=upgrade;AutoCreate=0" /backup/upgrade.dat If the database is temporary (Temporary=1), first use ttAdmin -ramLoad upgrade Note: In this step, you must use the | |
10. | Use ttRepAdmin to clear the replication bookmark and logs by resetting the receiver state for the database active and then setting replication to the stop state and then the start state:
ttRepAdmin -connStr DSN=upgrade -receiver -name active -reset ttRepAdmin -connStr DSN=upgrade -receiver -name active -state stop sleep 10 ttRepAdmin -connStr DSN=upgrade -receiver -name active -state start sleep 10 Note: The | |
11. | Use ttAdmin to start the replication agent on the new database upgrade and to begin sending updates to the database active :
ttAdmin -repStart upgrade | |
12. | Verify that the database upgrade is receiving updates from active . You can verify that updates are sent by applying a recognizable update to a table reserved for that purpose in the database active . When the update appears in upgrade , you know that replication is operational. | If the applications are still running on the database active , let them continue until the database upgrade has been successfully migrated and you have verified that the updates are being replicated correctly from the active to upgrade . |
13. | Once you are sure that updates are replicated correctly, you can disconnect all of the applications from the database active and reconnect them to the database upgrade . After verifying that the last of the updates from active are replicated to upgrade , the database active is ready to be upgraded.
Note: You may choose to delay upgrading |
You generally use active standby pair replication to provide high availability of your data to your applications. It is possible to maintain continuous availability of your data, even during a upgrade of TimesTen, your operating system, or your system hardware, by performing an online upgrade with active standby pair replication. This section describes the following procedures:
Upgrading the databases in an active standby pair with no cache groups
Upgrading the databases in an active standby pair with cache groups
This section includes the following topics:
Upgrades for TimesTen patch releases on the standby master database and subscriber databases
Upgrades for TimesTen patch releases on the active master database
Upgrades for major TimesTen releases, application software and hardware
To upgrade to a TimesTen patch release on the standby master database and subscriber databases, complete the following tasks on each database:
Stop the replication agent on the database using the ttRepStop
built-in procedure or the ttAdmin
utility. For example, to stop the replication agent for standby database master2
, you may use:
ttAdmin -repStop master2
Install the TimesTen patch. See "Performing an in-place upgrade".
Restart the replication agent using the ttRepStart
built-in procedure or the ttAdmin
utility:
ttAdmin -repStart master2
To upgrade the active master database, you must first reverse the roles of the active and standby master databases, and then perform an in-place upgrade:
Pause any applications that are generating updates on the active master database.
Execute the ttRepSubscriberWait
built-in procedure on the active master database, using the DSN and host of the standby master database. For example, to ensure that all transactions are replicated to the standby master master2
on the host master2host
:
call ttRepSubscriberWait( null, null, 'master2', 'master2host', 120 );
Stop the replication agent on the current active master database using the ttRepStop
built-in procedure or the ttAdmin
utility. For example, to stop the replication agent for the active master database master1
:
ttAdmin -repStop master1
Execute the ttRepDeactivate
build-in procedure on the current active master database. This puts the database in the IDLE
state:
call ttRepDeactivate;
On the standby master database, set the database to the ACTIVE
state using the ttRepStateSet
built-in procedure. This database becomes the active master in the active standby pair:
call ttRepStateSet( 'ACTIVE' );
Resume any applications that were paused in Step 1, connecting them to the database that is now acting as the active master (in this example, database master2
).
Upgrade the former active master database, which is now the standby master database. See "Performing an in-place upgrade".
Restart replication on the upgraded database using the ttRepStart
built-in procedure or the ttAdmin
utility:
ttAdmin -repStart master2
To make the newly upgraded database the active master database again, see "Reversing the roles of the active and standby master databases" in Oracle TimesTen In-Memory Database Replication Guide.
When you upgrade an active standby pair across major releases of TimesTen, you must explicitly specify the TCP/IP port for each database. If your active standby pair replication scheme is not configured with a PORT
attribute for each database, you must prepare for the upgrade by following these steps:
Stop the replication agent on every database using the call ttRepStop
built-in procedure or the ttAdmin
utility. For example, to stop the replication agent on the database master1
:
ttAdmin -repStop master1