TimesTen 自動刷新的 cachegroup 數據不同步

     話說本人有一套TT的測試環境,架構是一個TT內存庫+一個oracle數據庫,分別部署在不同的機器上。 TT上定義了一個autorefresh 的cachgroup 關聯oracle 中的某張單表。

測試的時候,跑得好好的,昨天突然就不更新數據了。然後各種檢查,發現cacheagent 是活着的,最後刷新時間停留在前天晚上(昨天早上發現數據不能同步的)。我就納悶了,這是爲什麼呢? 突然想到,前天晚上電力調整,TT所關聯的oracle 數據庫被關閉過,來電之後再起的。所以懷疑是oracle關閉之後,cacheagent 嘗試與之聯繫,發現總是不能聯繫上,當達到一個最大嘗試次數之後,就不再嘗試,所以當oracle 起來之後,依然數據不進行更新。

     抱着這個猜測,重啓TT 的cacheagent 。

Command> call ttCacheStop;
Command> call ttCacheStart;


哈哈,發現數據上來了。

所以,在這裏總結一下,當TT所關聯的oracle數據庫故障之後,最好重啓一下cacheagent  ,以避免cachegroup 刷新失敗。



問題:自動刷新的cachegroup 數據不同步(刷新失敗)

問題着手點:

1、檢查cacheagent
[timesten@timesten ~]$ ttStatus

2、檢查cachegroup 相關信息

使用 ttCacheAutorefreshStatsGet 存儲過程來返回指定的cache group最近10個自動刷新操作。
如:
ttIsql "DSN=tt_1122;UID=cacheuser;PWD=timesten;OraclePWD=oracle"
Command> call ttcacheautorefreshstatsget('user1','testcache');

< 1164260, 2007-07-23 15:43:52.000000, 850280, 44, 0, 75464, 528255, 75464, 310, 110, 6800,
1890912, 12439795, 1890912, 160020, InProgress >
< 1164260, 2007-07-23 15:43:33.000000, 831700, 43, 13550, 108544, 759808, 108544, 1030, 230,
12290, 1815448, 11911540, 1815448, 160020, Complete >
< 1164260, 2007-07-23 15:43:12.000000, 810230, 42, 17040, 115712, 809984, 115712, 610, 330,
16090, 1706904, 11151732, 1706904, 146470, Complete >
< 1164260, 2007-07-23 15:42:52.000000, 790190, 41, 14300, 94208, 659456, 94208,560, 320,
13410, 1591192, 10341748, 1591192, 129430, Complete >
< 1164260, 2007-07-23 15:42:32.000000, 770180, 40, 12080, 99328, 695296, 99328,450, 290,
11340, 1496984, 9682292, 1496984, 115130, Complete >
< 1164260, 2007-07-23 15:42:12.000000, 750130, 39, 10380, 86016, 598368, 86016,430, 230,
9720, 1397656, 8986996, 1397656, 103050, Complete >
< 1164260, 2007-07-23 15:41:52.000000, 730130, 38, 13530, 112640, 700768, 112640, 530, 220,
12780, 1311640, 8388628, 1311640, 92670, Complete >
< 1164260, 2007-07-23 15:41:32.000000, 710120, 37, 9370, 56320, 326810, 56320, 310, 160,
8900, 1199000, 7687860, 1199000, 79140, Complete >
< 1164260, 2007-07-23 15:41:22.000000, 700120, 36, 2120, 10240, 50330, 10240, 50, 200, 1870,
1142680, 7361050, 1142680, 69770, Complete >
< 1164260, 2007-07-23 15:41:12.000000, 690110, 35, 0, 0, 0, 0, 0, 0, 0, 1132440, 7310720,
1132440, 67650, Complete >
10 rows found.

關於以上返回信息,可參見官方文檔 Troubleshooting Guide ---Troubleshooting Oracle In-Memory Database Cache ---Monitoring autorefresh cache groups。

另外通過在相關聯的oracle數據庫上執行以下腳本,來監控cachegroup。
install_dir/oraclescripts/cacheInfo.sql

The cacheInfo script displays the following information for each cached table:

% cd TimesTen_install_dir/oraclescripts
% sqlplus cacheuser/oracle
SQL> @cacheInfo
*************Autorefresh Objects Information ***************
Host name: sys1
Timesten datastore name: /users/OracleCache/alone1
Cache table name: ORATT.ORDERS
Change log table name: tt_06_69245_L
Number of rows in change log table: 100000
Maximum logseq on the change log table: 38
Timesten has autorefreshed updates up to logseq: 38
Number of updates waiting to be autorefreshed: 0
Number of updates that has not been marked with a valid logseq: 0
****************************

二、診斷自動刷新cache group 的性能問題
使用該命令
ttTraceMon




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章