timesten 从内存中卸载数据库

1、断开所有的应用到数据库的连接。

2、如果有复制代理正运行在数据库上,首先得设置复制状态为pause,然后stop复制代理。

步骤官方文档描述为:

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

3、停缓存代理。

官方文档描述如下:

If the cache agent is running on the database, stop the cache agent. This example
references a database cachedb that uses TimesTen Cache and belongs to the
TimesTen instance being upgraded. (The example does not consider replication. If
the cache agent is running, this step must be performed regardless of whether the
database is configured for replication.)
ttAdmin -cacheStop cachedb

4、从内存中卸载DS。

官方文档描述如下:

Unload the database from memory using ttAdmin. The first example assumes
RAM policy is set to manual and references a database upgradedb that belongs to
the TimesTen instance being upgraded. (The example does not consider
replication or cache. This step must be performed regardless of whether the
database is configured for replication or cache.)
ttAdmin -ramUnload upgradedb
Or, 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
Or, 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. This results in the database being unloaded.
For example:
ttAdmin -ramGrace 0 upgradedb

意思是如果ram policy设置为manual,可以执行下面的语句卸载:

ttAdmin -ramUnload TT1122_new

如果ram policy设置为always,则执行下面的语句:

ttAdmin -ramPolicy manual -ramUnload TT1122_new

如果ram policy设置为inUse,则执行下面的语句:

ttAdmin -ramGrace 0 TT1122_new

本例中无复制代理,也无缓存代理。2-3步直接跳过。

查询ram policy的方式:

[timesten@trgxtts tt1122migrate_test]$ ttAdmin -query TT1122_new
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
[timesten@trgxtts tt1122migrate_test]$

因此此例需要执行:

[timesten@trgxtts tt1122migrate_test]$ ttAdmin -ramGrace 0 TT1122_new
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
[timesten@trgxtts tt1122migrate_test]$

猜你喜欢

转载自blog.csdn.net/kadwf123/article/details/80324523