当前位置: 首页 > 工具软件 > TimesTen > 使用案例 >

TimesTen Classic 18c 卸载 (uninstall)全过程

越勇
2023-12-01

当前TimesTen Classic 18c已安装,已配置读写缓存组。以下为卸载全过程。

查看到cache agent和rep agent均在运行:

$ ttstatus
TimesTen status report as of Mon Dec 21 01:43:27 2020

Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Data store /u01/database/data/ttdb
Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
There are 26 connections to the data store
Shared Memory KEY 0x16030496 ID 1
PL/SQL Memory Key 0x17030496 ID 2 Address 0x5000000000
Type            PID     Context             Connection Name              ConnID
Cache Agent     2471    0x0000000002063ac0  Marker(140663752677120)           7
Cache Agent     2471    0x00007fee7c09ec50  LogSpaceMon(140663873083136)      6
Cache Agent     2471    0x00007fee8001ec70  Timer                             2
Cache Agent     2471    0x00007fee8010eca0  BMReporter(140663750571776)       5
Cache Agent     2471    0x00007fee840d8840  Refresher(S,5000)                 4
Cache Agent     2471    0x00007fee8804a1f0  Refresher(S,5000)(140663748466    3
Cache Agent     2471    0x00007feed807e390  Handler                           1
Server          826     0x0000000001b83070  TimesTen_Cache_Admin              8
    (Client Information: pid: 3288; IPC: TCP/IP;
        Node: ttadmin (10.0.0.2))
Replication     29024   0x00007fa6a80008c0  TRANSMITTER(M):140355214210816 2031
Replication     29024   0x00007fa6ac0008c0  RECEIVER:140353979041536       2030
Replication     29024   0x00007fa6b00008c0  REPLISTENER:140355220510464    2033
Replication     29024   0x00007fa6f00009b0  LOGFORCE:140355217360640       2032
Replication     29024   0x00007fa6f40008c0  REPHOLD:140355223660288        2034
Subdaemon       2065    0x000000000100a560  Manager                        2047
Subdaemon       2065    0x000000000108b530  Rollback                       2046
Subdaemon       2065    0x000000000110a200  AsyncMV                        2042
Subdaemon       2065    0x00007f78600008c0  Garbage Collector              2043
Subdaemon       2065    0x00007f786007f330  Log Marker                     2041
Subdaemon       2065    0x00007f78680008c0  IndexGC                        2045
Subdaemon       2065    0x00007f78680dafc0  Checkpoint                     2036
Subdaemon       2065    0x00007f786c0008c0  XactId Rollback                2044
Subdaemon       2065    0x00007f786c07f330  Aging                          2037
Subdaemon       2065    0x00007f78700008c0  HistGC                         2040
Subdaemon       2065    0x00007f787007f330  Deadlock Detector              2039
Subdaemon       2065    0x00007f78b40008c0  Monitor                        2038
Subdaemon       2065    0x00007f78b407f330  Flusher                        2035
Open for user connections
RAM residence policy: Always
Replication policy  : Manual
Replication agent is running.
Cache Agent policy  : Always
Cache agent is running.
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report

删除读写缓存组, 写缓存组删除前必须停止复制代理:

$ ttisql "uid=cacheadm;pwd=timesten;dsn=ttdb;oraclepwd=oracle"
Command> cachegroups

Cache Group CACHEADM.READCACHE:

  Cache Group Type: Read Only
  Autorefresh: Yes
  Autorefresh Mode: Incremental
  Autorefresh State: On
  Autorefresh Interval: 5 Seconds
  Autorefresh Status: ok
  Aging: No aging defined

  Root Table: ORATT.READTAB
  Table Type: Read Only

Cache Group CACHEADM.WRITECACHE:

  Cache Group Type: Asynchronous Writethrough (Dynamic)
  Autorefresh: No
  Aging: LRU on

  Root Table: ORATT.WRITETAB
  Table Type: Propagate

2 cache groups found.

Command> drop cache group readcache;
Command> drop cache group writecache;
 5245: The operation cannot be executed while the Replication Agent for this database is running.
The command failed.

Command> call ttrepstop();
Command> drop cache group writecache;

Command> call ttcachestop();
10021: Cache agent was not stopped due to cache agent policy setting.
The command failed.

停止缓存代理出错,是因为policy设置成了always:

$ ttadmin ttdb
RAM Residence Policy            : always
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : always
Cache Agent Manually Started    : True
Database State                  : Open

将cache policy修改为manual:

$ ttadmin -cachepolicy manual ttdb
RAM Residence Policy            : always
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : True
Database State                  : Open

确认缓存代理和复制代理未运行:

$ ttstatus
TimesTen status report as of Mon Dec 21 02:14:26 2020

Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Data store /u01/database/data/ttdb
Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
There are 14 connections to the data store
Shared Memory KEY 0x16030496 ID 1
PL/SQL Memory Key 0x17030496 ID 2 Address 0x5000000000
Type            PID     Context             Connection Name              ConnID
Server          826     0x0000000001b83070  TimesTen_Cache_Admin              8
    (Client Information: pid: 3288; IPC: TttstatCP/IP;
        Node: ttadmin (10.0.0.2))
Subdaemon       2065    0x000000000100a560  Manager                        2047
Subdaemon       2065    0x000000000108b530  Rollback                       2046
Subdaemon       2065    0x000000000110a200  AsyncMV                        2042
Subdaemon       2065    0x00007f78600008c0  Garbage Collector              2043
Subdaemon       2065    0x00007f786007f330  Log Marker                     2041
Subdaemon       2065    0x00007f78680008c0  IndexGC                        2045
Subdaemon       2065    0x00007f78680dafc0  Checkpoint                     2036
Subdaemon       2065    0x00007f786c0008c0  XactId Rollback                2044
Subdaemon       2065    0x00007f786c07f330  Aging                          2037
Subdaemon       2065    0x00007f78700008c0  HistGC                         2040
Subdaemon       2065    0x00007f787007f330  Deadlock Detector              2039
Subdaemon       2065    0x00007f78b40008c0  Monitor                        2038
Subdaemon       2065    0x00007f78b407f330  Flusher                        2035
Open for user connections
RAM residence policy: Always
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report

删除数据库,首先需要断开所有的客户端连接。

查看到有一个来自10.0.0.2的连接,实际上是Windows上安装的SQL Developer,在SQL Developer中断开连接就好了:

$ ttstatus
TimesTen status report as of Mon Dec 21 02:19:00 2020

Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Data store /u01/database/data/ttdb
Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
There are 14 connections to the data store
Shared Memory KEY 0x16030496 ID 1
PL/SQL Memory Key 0x17030496 ID 2 Address 0x5000000000
Type            PID     Context             Connection Name              ConnID
Server          826     0x0000000001b83070  TimesTen_Cache_Admin              8
    (Client Information: pid: 3288; IPC: TCP/IP;
        Node: ttadmin (10.0.0.2))
...

以下删除数据库,删除前请做好数据库备份:

[oracle@ttserver ~]$ ttdestroy ttdb
Failed to destroy data store: TT0839: Cannot access database because it is in use. A database may be considered to be in use due to its RAM Policy setting, even though there are no active connections to it. -- file "db.c", lineno 6078, procedure "sbDbDestroy"
[oracle@ttserver ~]$ ttadmin ttdb
RAM Residence Policy            : always
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open
[oracle@ttserver ~]$ ttadmin -rampolicy manual ttdb
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

[oracle@ttserver ~]$ ttadmin -ramunload ttdb
RAM Residence Policy            : manual
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
[oracle@ttserver ~]$ ttdestroy ttdb

确保所有数据库都已删除。

现在还有timesten守护进程在运行:

$ ttstatus
TimesTen status report as of Mon Dec 21 02:26:08 2020

Daemon pid 2060 port 6624 instance tt181
TimesTen server pid 2067 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Accessible by group timesten
End of report

[oracle@ttserver ~]$ ttstatus
ttStatus: Could not connect to the TimesTen daemon.
If the TimesTen daemon is not running, please start it
by running "ttDaemonAdmin -start".
/home/oracle/tt181/info/daemon.status says:
2020-12-21 02:27:37 daemon shutting down due to user request

最后删除timesten实例和软件:

$ ttinstancedestroy

** WARNING **

   The uninstallation has been executed by a non-root user.
   If the TimesTen daemon startup scripts were installed,
   you must run $TIMESTEN_HOME/bin/setuproot -uninstall
   to remove them. If you proceed with this uninstallation, you
   will have to remove the startup scripts manually.

** WARNING **

   All files in the directory:

   /home/oracle/tt181

   will be removed, including any file that you or other users
   may have created.

   Are you sure you want to completely remove this instance? [ yes ]
ttDaemonAdmin: daemon is not running
   Installation will remove all the files from /home/oracle/tt181.
   Do you want to continue? [ yes ]

NOTE: /home/oracle/tt181/info contains information related to the data stores
      that have been created with this release. If you remove
      /home/oracle/tt181/info
      you will no longer be able to access your data stores,
      nor would you be able to restore nor migrate your data.


NOTE: /home/oracle/tt181/conf contains information related to the instance configuration.
/home/oracle/tt181 Removed
The TimesTen instance tt181 has been destroyed.

$ chmod -R 750 /u01/installation/tt18.1.4.1.0/
$ rm -rf /u01/installation/tt18.1.4.1.0/

还剩instance admin用户没删,略。

 类似资料: