Restoring the TimesTen and Oracle Database Systems
Complete the following tasks to restore the TimesTen and Oracle database systems to their original state.
Dropping Cache Groups
Start the ttIsql
utility and connect to the
database1
DSN as the instance administrator. Use
ttIsql
to grant the DROP ANY TABLE
privilege to the
TimesTen cache administration user so that this user can drop the underlying cache tables
when dropping the cache groups.
% ttIsql "DSN=database1" Command> GRANT DROP ANY TABLE TO cacheadmin; Command> exit
In order to drop the cache group, you should first pause the autorefresh operations
to avoid any contention. Start the ttIsql
utility and connect to the
database1
DSN as the TimesTen cache administration user.
-
Use an
ALTER CACHE GROUP
statement to set the cache group's autorefresh state toPAUSED
. -
Use
DROP CACHE GROUP
statement to drop thereadcache
read-only cache group.
% ttIsql "DSN=database1;UID=cacheadmin;PwdWallet=/wallets/cacheadminwallet" Command> ALTER CACHE GROUP readcache SET AUTOREFRESH STATE PAUSED; Command> DROP CACHE GROUP readcache;
The readcache
cache group and its cache table sales.readtab
are dropped from the TimesTen database.
See Dropping a Cache Group in the Oracle TimesTen In-Memory Database Cache Guide.
Stopping the Cache Agents for TimesTen Scaleout
On the active management instance, use ttGridAdmin dbCacheStop
command to stop the cache agent on all data instances within the
database.
% ttGridAdmin dbCacheStop database1
Database database1 : Stopping cache agents.
Database database1 element level status as of Mon Dec 7 14:52:51 PST 2020
Host Instance Elem Status CA Status Date/Time of Event Message
----- --------- ---- ------ --------- ------------------- -------
host3 instance1 1 opened stopped 2020-11-23 08:37:35
host4 instance1 2 opened stopped 2020-11-23 08:37:35
host5 instance1 3 opened stopped 2020-11-23 08:37:35
host6 instance1 4 opened stopped 2020-11-23 08:37:35
host7 instance1 5 opened stopped 2020-11-23 08:37:35
host8 instance1 6 opened stopped 2020-11-23 08:37:35
You can stop the cache agent for a specific data instance if you specify the -instance
option.
% ttGridAdmin dbCacheStop database1 -instance host4.instance1
Database database1 : Stopping cache agents.
% ttGridadmin dbStatus database1 -element
Database database1 element level status as of Mon Dec 7 14:52:51 PST 2020
Host Instance Elem Status CA Status Date/Time of Event Message
----- --------- ---- ------ --------- ------------------- -------
host3 instance1 1 opened started 2020-11-23 08:37:35
host4 instance1 2 opened stopped 2020-11-23 08:37:35
host5 instance1 3 opened started 2020-11-23 08:37:35
host6 instance1 4 opened started 2020-11-23 08:37:35
host7 instance1 5 opened started 2020-11-23 08:37:35
host8 instance1 6 opened started 2020-11-23 08:37:35
If there is only one cache agent running, do not stop the last cache agent immediately after you have dropped or altered a cache group with autorefresh. Instead, wait for at least two minutes to enable the cache agent to clean up Oracle database objects such as change log tables and triggers that were created and used to manage the cache group. This is not an issue when you have more than one cache agent running.
Dropping the Oracle Database Users and Their Objects
Start SQL*Plus and connect to the Oracle database as the sys
user. Use SQL*Plus to drop the Oracle cache administration user cacheadmin
.
% sqlplus sys as sysdba
Enter password: password
SQL> DROP USER cacheadmin CASCADE;
User dropped.
Specifying CASCADE
in a DROP USER
statement drops all objects such as tables and triggers owned by the user before dropping the user itself.
Next use SQL*Plus to drop the TT_CACHE_ADMIN_ROLE
role:
SQL> DROP ROLE TT_CACHE_ADMIN_ROLE;
Role dropped.
Then use SQL*Plus to drop the default tablespace cachetblsp
used by
the Oracle cache administration user including the contents of the
tablespace and its data file:
SQL> DROP TABLESPACE cachetblsp INCLUDING CONTENTS AND DATAFILES;
Tablespace dropped.
SQL> exit