理解TimesTen記憶體資料庫DBI檔案的作用以及相關故障處理
DBI(DataBase Information)的作用是記錄TimesTen例項的DSN註冊資訊,在Daemon程式啟動時會讀取該註冊資訊,顯示DSN的元件啟動策略。我們在實際運維過程中,基本沒有人會關心DBI檔案的存在,甚至有一些童鞋做了一兩年的TimesTen運維,都不知道有這麼一個檔案存在。但是,我們在實際故障處理中,如果需要用到該檔案進行處理時,都是比較嚴重的故障,而且TimesTen一般承載的業務都是比較核心的,分分鐘都會直接影響客戶的感知度;在我看的點中,也有不少地方出現過,每次客戶打電話給我的時候都是非常的緊張,群友也有問到過,這裡根據各種不同的情況總結說明。
1. 主機異常重啟,Checkpoint檔案目錄沒有掛載
所有關於這種型別的故障基本上都屬於這種情況,由於考慮到I/O問題,我們經常都會在系統規劃階段,將Checkpoint檔案系統和TransLog檔案系統與軟體安裝目錄分開,採用外部的儲存來存放Checkpoint檔案和TransLog檔案;但是由於儲存方面的考慮,這些檔案系統一般都不會設定成自動掛載,當主機異常重啟時,由於故障期間運維人員容易第一時間恢復資料庫,而忽略了啟動之前的一些檢查;此時,如果在Checkpoint檔案系統沒有掛載的情況下啟動daemon程式,Daemon程式讀取註冊資訊時找不到註冊資訊中記錄的Checkpoint檔案,TimesTen會將原來的DBI檔案重新命名為原來檔名加'~'的檔案,同時會生成一個新的DBI檔案,由於此時Checkpoint目錄不存在,所以根據sys.odbc.ini檔案的配置資訊也無法建立新的DSN;原來的DSN也無法載入,由於DBI檔案已經修改,所以即使再次重啟也只會讀取已經被修改過的DBI檔案讀取最新的註冊資訊。
2. 主機異常重啟,DBI檔案丟失/損壞
這種情況是比較極端的,一般情況下改檔案不會出現丟失,因為丟失或被刪除後,在有會話連線到DSN時,Daemon程式會自動生成新的同名的DBI檔案;但是如果該檔案損壞就悲劇了,因為檔案存在的情況下不會自動修復損壞的檔案,所以我們在運維過程中,建立完DSN後建議備份該檔案。
下面我們模擬以上場景及其解決辦法
1. 主機異常重啟,Checkpoint檔案目錄沒有掛載
-首先模擬主機異常當機或Daemon程式異常
透過ttstatus找到Daemon程式號,並直接kill
$ ttstatus|grep -E "Daemon pid"
Daemon pid 15752 port 53396 instance tt1122
$ kill -9 15752
$ ttstatus|grep -E "Daemon pid"
ttStatus: Could not connect to the TimesTen daemon.
If the TimesTen daemon is not running, please start it
by running "ttDaemonAdmin -start".
-模擬主機檔案系統沒有掛載
$ cd $TT_HOME/info
$ cat sys.odbc.ini|grep -E "DataStore="
DataStore=/ttchk/tt1122/DataStore/TYINFO/tyinfodata #當然,這裡如果有配置多個DSN的話需要自己區分一下
$ cd /ttchk/tt1122/DataStore
$ ls
TYINFO
$ mv TYINFO TYINFO1
-然後我們先看一下info目錄中的檔案
$ cd $TT_HOME/info
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 20 08:51 DBI54928054.0
-rw------- 1 timesten timesten 3520 Jan 1 01:53 DBI54928054.01~
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 6 Jan 20 08:51 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-啟動daemon程式
$ ttDaemonAdmin -start
Pid file exists: /TimesTen/tt1122/info/timestend.pid.
To start anyway, use -force.
$ ttDaemonAdmin -start -force
/TimesTen/tt1122/info/timestend.pid file exists, attempt start due to -force option.
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Tue Jan 20 09:14:48 2015
Daemon pid 15902 port 53396 instance tt1122
TimesTen server pid 15917 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-這個時候悲劇發生了,ttstatus看不到例項的DSN註冊資訊,而且無論我們怎麼重啟,怎麼折騰都找不到。
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
830: Cannot create data store file. OS-detected error: No such file or directory
The command failed.
Done.
$ ttadmin -ramload tyinfo
ttAdmin: TimesTen Error: 10002; No record of a data store located in '/ttchk/tt1122/DataStore/TYINFO/tyinfodata'
-我們這個時候模擬檔案系統掛載回來
$ mv TYINFO1 TYINFO
-接著我們再怎麼折騰,都找不到例項DSN的註冊資訊
$ ttstatus
TimesTen status report as of Tue Jan 20 09:21:29 2015
Daemon pid 15902 port 53396 instance tt1122
TimesTen server pid 15917 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
10003: Unexpected data store file exists for new data store: /ttchk/tt1122/DataStore/TYINFO/tyinfodata.ds0.
The command failed.
Done.
$ ttadmin -ramload tyinfo
ttAdmin: TimesTen Error: 10002; No record of a data store located in '/ttchk/tt1122/DataStore/TYINFO/tyinfodata'
$ ttdaemonadmin -restart
TimesTen Daemon stopped.
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Tue Jan 20 09:22:03 2015
Daemon pid 16028 port 53396 instance tt1122
TimesTen server pid 16044 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-下面再看一下info目錄中的檔案
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 20 08:51 DBI54928054.0~
-rw------- 1 timesten timesten 3520 Jan 1 01:53 DBI54928054.01~
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 6 Jan 20 09:14 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-原來的DBI54928054.0已經被重新命名為DBI54928054.0~
-透過還原原來的DBI檔案,重啟Daemon程式,恢復故障
$ mv DBI54928054.0~ DBI54928054.0
$ ttstatus
TimesTen status report as of Tue Jan 20 09:29:21 2015
Daemon pid 16028 port 53396 instance tt1122
TimesTen server pid 16044 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttdaemonadmin -restart
TimesTen Daemon stopped.
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Tue Jan 20 09:29:39 2015
Daemon pid 16112 port 53396 instance tt1122
TimesTen server pid 16132 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are no connections to the data store
RAM residence policy: Manual
Data store is manually unloaded from RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttadmin -ramload tyinfo
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
2. 主機異常重啟,DBI檔案丟失/損壞
-首先模擬DBI檔案丟失
$ ttstatus
TimesTen status report as of Wed Jan 21 08:38:44 2015
Daemon pid 3014 port 53396 instance tt1122
TimesTen server pid 3023 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are 11 connections to the data store
Shared Memory KEY 0x1f01f762 ID 32769
Type PID Context Connection Name ConnID
Subdaemon 3020 0x0000000001fb4d00 Manager 127
Subdaemon 3020 0x000000000200bba0 Rollback 126
Subdaemon 3020 0x00000000020d9fc0 Flusher 125
Subdaemon 3020 0x000000000212ee70 Monitor 124
Subdaemon 3020 0x00000000021a4510 Deadlock Detector 123
Subdaemon 3020 0x00000000021f93c0 Checkpoint 122
Subdaemon 3020 0x000000000224e270 Aging 121
Subdaemon 3020 0x00000000022a3120 Log Marker 120
Subdaemon 3020 0x00000000022f7fd0 AsyncMV 119
Subdaemon 3020 0x000000000234ce80 HistGC 118
Subdaemon 3020 0x00000000023a1d30 IndexGC 117
RAM residence policy: Manual
Data store is manually loaded into RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 21 08:38 DBI54928054.0
-rw------- 1 timesten timesten 3524 Jan 21 05:41 DBI54928054.0~
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 08:37 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-我們看到上面DSN正常執行,而且DBI檔案存在,下面刪除DBI檔案
$ rm -f DBI*
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 08:37 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-這個時候DBI檔案已經丟失,下面測試只有有會話連線到DSN,Daemon程式會自動建立DBI檔案,而且檔名與原來相同
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
Connection successful: DSN=TYINFO;UID=timesten;DataStore=/ttchk/tt1122/DataStore/TYINFO/tyinfodata;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;LogFileSize=128;DRIVER=/TimesTen/tt1122/lib/libtten.so;SMPOptLevel=1;LogDir=/ttlog/tt1122/TYINFO;PermSize=128;TempSize=64;Connections=80;CkptFrequency=600;RecoveryThreads=4;TypeMode=0;PLSQL=0;CacheGridEnable=0;LogBufMB=64;ReceiverThreads=1;
(Default setting AutoCommit=1)
Command> exit
Disconnecting...
Done.
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 21 08:42 DBI54928054.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 08:37 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-可以看到有會話連線DSN後,Daemon程式生成了新的DBI檔案。
-下面模擬DSN正常執行,但是DBI檔案損壞
$ ttstatus
TimesTen status report as of Wed Jan 21 08:55:42 2015
Daemon pid 3014 port 53396 instance tt1122
TimesTen server pid 3023 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are 11 connections to the data store
Shared Memory KEY 0x1f01f762 ID 32769
Type PID Context Connection Name ConnID
Subdaemon 3020 0x0000000001fb4d00 Manager 127
Subdaemon 3020 0x000000000200bba0 Rollback 126
Subdaemon 3020 0x00000000020d9fc0 Flusher 125
Subdaemon 3020 0x000000000212ee70 Monitor 124
Subdaemon 3020 0x00000000021a4510 Deadlock Detector 123
Subdaemon 3020 0x00000000021f93c0 Checkpoint 122
Subdaemon 3020 0x000000000224e270 Aging 121
Subdaemon 3020 0x00000000022a3120 Log Marker 120
Subdaemon 3020 0x00000000022f7fd0 AsyncMV 119
Subdaemon 3020 0x000000000234ce80 HistGC 118
Subdaemon 3020 0x00000000023a1d30 IndexGC 117
RAM residence policy: Manual
Data store is manually loaded into RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 21 08:42 DBI54928054.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 08:37 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-這裡看到例項是正常執行的,而且DSN也是裝載的,可以看到DBI檔案的大小為3520Bytes,下面手動編輯DBI檔案,模擬檔案損壞
$ vi DBI54928054.0
^K^@^B^@^B^@^G^@^D^
"DBI54928054.0" [converted] 1L, 3578C written
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3550 Jan 21 08:58 DBI54928054.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 08:37 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-這個時候DBI檔案已經被手動編輯,大小也變為3550Bytes,例項和DSN都不會受到影響,有新的session連線和退出是Daemon程式也不會更新DBI檔案,但是如果這個時候解除安裝DSN並停止Daemon程式,悲劇就發生了。
$ ttadmin -ramunload tyinfo
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
$ ttstatus
TimesTen status report as of Wed Jan 21 09:01:53 2015
Daemon pid 3014 port 53396 instance tt1122
TimesTen server pid 3023 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are no connections to the data store
RAM residence policy: Manual
Data store is manually unloaded from RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttdaemonadmin -stop
TimesTen Daemon stopped.
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3550 Jan 21 09:01 DBI54928054.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
$ ttdaemonadmin -start
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Wed Jan 21 09:02:19 2015
Daemon pid 3196 port 53396 instance tt1122
TimesTen server pid 3216 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-透過ttstatus已經看不到DSN的註冊資訊了,而且已經回到前面的CheckPoint檔案丟失的現象,這個時候已經再沒有辦法恢復了,只能透過備份的DBI檔案來恢復DSN的註冊資訊。當然,如果實在沒有備份的情況下,我們可以嘗試從其他地方複製一個DBI檔案來修改,當然,DBI檔案是二進位制檔案,可能修改起來比較麻煩。
$ ttstatus
TimesTen status report as of Wed Jan 21 09:59:15 2015
Daemon pid 4203 port 53396 instance tt1122
TimesTen server pid 4218 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are 11 connections to the data store
Shared Memory KEY 0x0301f765 ID 360449
Type PID Context Connection Name ConnID
Subdaemon 4216 0x0000000018c52070 Manager 127
Subdaemon 4216 0x0000000018ca8dd0 Rollback 126
Subdaemon 4216 0x0000000018d569a0 Flusher 125
Subdaemon 4216 0x0000000018dab850 Monitor 124
Subdaemon 4216 0x0000000018e00700 Deadlock Detector 123
Subdaemon 4216 0x0000000018e555b0 Checkpoint 122
Subdaemon 4216 0x0000000018eaa460 Aging 121
Subdaemon 4216 0x0000000018f0b230 Log Marker 120
Subdaemon 4216 0x0000000018f5fec0 AsyncMV 119
Subdaemon 4216 0x0000000018fb4b50 HistGC 118
Subdaemon 4216 0x00000000190097e0 IndexGC 117
RAM residence policy: Manual
Data store is manually loaded into RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ kill -9 4203
$ rm DBI*
$ ttdaemonadmin -start -force
/TimesTen/tt1122/info/timestend.pid file exists, attempt start due to -force option.
TimesTen Daemon startup OK.
[timesten@tony5 info]$ ttstatus
TimesTen status report as of Wed Jan 21 10:00:43 2015
Daemon pid 4309 port 53396 instance tt1122
TimesTen server pid 4324 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-DBI檔案丟失,例項異常當機,這個時候又無法看到註冊資訊,也無法載入DSN
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
10003: Unexpected data store file exists for new data store: /ttchk/tt1122/DataStore/TYINFO/tyinfodata.ds0.
The command failed.
Done.
$ ttadmin -ramload tyinfo
ttAdmin: TimesTen Error: 10002; No record of a data store located in '/ttchk/tt1122/DataStore/TYINFO/tyinfodata'
-下面透過其他地方複製DBI檔案,恢復DSN註冊資訊。
$ ls -l
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 21 10:03 DBI54928054.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 10:00 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
$ ttdaemonadmin -restart
TimesTen Daemon stopped.
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Wed Jan 21 10:04:05 2015
Daemon pid 4394 port 53396 instance tt1122
TimesTen server pid 4409 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are no connections to the data store
RAM residence policy: Manual
Data store is manually unloaded from RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
-這樣就完成透過備份或者是其他地方複製還原的DBI檔案恢復DSN的註冊資訊,載入DSN了。
-當然,在這種異常當機,同時DBI檔案又丟失的極端情況,我們還可以用另外一種方式恢復;就是先移開Trans Log檔案和CheckPoint檔案,建立新的DSN後,停止Daemon程式替換原來的Trans Log檔案和CheckPoint檔案;但是,這種方式千萬要小心,一旦操作失誤,將無法補救。下面演示一下操作方法:
$ ttstatus
TimesTen status report as of Wed Jan 21 10:19:12 2015
Daemon pid 4722 port 53396 instance tt1122
TimesTen server pid 4739 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are 11 connections to the data store
Shared Memory KEY 0x1d01f765 ID 622596
Type PID Context Connection Name ConnID
Subdaemon 4729 0x000000001af9dd00 Manager 127
Subdaemon 4729 0x000000001aff4ba0 Rollback 126
Subdaemon 4729 0x000000001b0c2fc0 Flusher 125
Subdaemon 4729 0x000000001b117e70 AsyncMV 119
Subdaemon 4729 0x000000001b138660 Monitor 124
Subdaemon 4729 0x000000001b18d510 Deadlock Detector 123
Subdaemon 4729 0x000000001b1e23c0 Checkpoint 122
Subdaemon 4729 0x000000001b237270 Aging 121
Subdaemon 4729 0x000000001b28c120 Log Marker 120
Subdaemon 4729 0x000000001b321010 HistGC 118
Subdaemon 4729 0x000000001b375ca0 IndexGC 117
RAM residence policy: Manual
Data store is manually loaded into RAM
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ kill -9 4722
$ ttstatus
ttStatus: Could not connect to the TimesTen daemon.
If the TimesTen daemon is not running, please start it
by running "ttDaemonAdmin -start".
$ rm DBI*
$ ttdaemonadmin -start -force
/TimesTen/tt1122/info/timestend.pid file exists, attempt start due to -force option.
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Wed Jan 21 10:19:54 2015
Daemon pid 4810 port 53396 instance tt1122
TimesTen server pid 4830 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-DSN資訊已經註冊不到了
$ ls -l
total 48
-rw------- 1 timesten timesten 3520 Jan 21 05:23 aa
-rw------- 1 timesten timesten 3520 Jan 21 05:55 bb
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Dec 4 10:51 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
-rw-r--r-- 1 timesten timesten 5 Jan 21 10:19 timestend.pid
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-DBI檔案也不存在了。
$ ttdaemonadmin -stop
TimesTen Daemon stopped.
-下面將原來的Trans Log檔案和CheckPoint檔案移開
$ cd /ttchk/tt1122/DataStore
$ mv TYINFO/ TYINFO1
$ mkdir TYINFO
$ cd /ttlog/tt1122/
$ mv TYINFO/ TYINFO1
$ mkdir TYINFO
$ ttdaemonadmin -start
TimesTen Daemon startup OK.
$ ttstatus
TimesTen status report as of Wed Jan 21 10:21:49 2015
Daemon pid 4886 port 53396 instance tt1122
TimesTen server pid 4901 started on port 53397
------------------------------------------------------------------------
Accessible by group timesten
End of report
-這裡考慮到檔案系統空間和恢復時間問題,修改sys.odbc.ini檔案將PermSize修改小一些
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
Connection successful: DSN=TYINFO;UID=timesten;DataStore=/ttchk/tt1122/DataStore/TYINFO/tyinfodata;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;LogFileSize=128;DRIVER=/TimesTen/tt1122/lib/libtten.so;SMPOptLevel=1;LogDir=/ttlog/tt1122/TYINFO;PermSize=100;TempSize=64;Connections=80;CkptFrequency=600;RecoveryThreads=4;TypeMode=0;PLSQL=0;CacheGridEnable=0;LogBufMB=64;ReceiverThreads=1;
(Default setting AutoCommit=1)
Command> exit
Disconnecting...
Done.
$ ttstatus
TimesTen status report as of Wed Jan 21 10:23:32 2015
Daemon pid 4886 port 53396 instance tt1122
TimesTen server pid 4901 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are no connections to the data store
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttdaemonadmin -stop
TimesTen Daemon stopped.
-將sys.odbc.ini檔案的PermSize修改回來
$ cd /ttlog/tt1122
$ mv TYINFO TYINFO2
$ mv TYINFO1 TYINFO
$ cd /ttchk/tt1122/DataStore
$ mv TYINFO TYINFO2
$ mv TYINFO1 TYINFO
$ ttstatus
ttStatus: Could not connect to the TimesTen daemon.
If the TimesTen daemon is not running, please start it
by running "ttDaemonAdmin -start".
$ cd $TT_HOME/info
-rw-r----- 1 timesten timesten 3251 Dec 4 09:54 cluster.oracle.ini
-rw------- 1 timesten timesten 3520 Jan 21 10:23 DBI54bf0d81.0
-rw-r----- 1 timesten timesten 349 Dec 4 09:54 snmp.ini
-rw-rw---- 1 timesten timesten 12946 Jan 21 10:23 sys.odbc.ini
-rw-rw---- 1 timesten timesten 422 Dec 4 09:54 sys.ttconnect.ini
drwxr-x--- 2 timesten timesten 4096 Jul 8 2014 ttcacheadvisor
-rw-r----- 1 timesten timesten 316 Dec 4 10:42 ttendaemon.options
-啟動Daemon程式
$ ttdaemonadmin -start
TimesTen Daemon startup OK.
-下面就可以看到DSN的註冊資訊了
$ ttstatus
TimesTen status report as of Wed Jan 21 10:25:30 2015
Daemon pid 4995 port 53396 instance tt1122
TimesTen server pid 5015 started on port 53397
------------------------------------------------------------------------
Data store /ttchk/tt1122/DataStore/TYINFO/tyinfodata
There are no connections to the data store
Replication policy : Manual
Cache Agent policy : Manual
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ttadmin -ramload tyinfo
ttAdmin: TimesTen Error: 10009; RAM load ignored due to ramPolicy setting
$ ttadmin -rampolicy manual tyinfo
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
$ ttadmin -ramload tyinfo
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
$ ttisql tyinfo
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=tyinfo";
Connection successful: DSN=TYINFO;UID=timesten;DataStore=/ttchk/tt1122/DataStore/TYINFO/tyinfodata;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;LogFileSize=128;DRIVER=/TimesTen/tt1122/lib/libtten.so;SMPOptLevel=1;LogDir=/ttlog/tt1122/TYINFO;PermSize=128;TempSize=64;Connections=80;CkptFrequency=600;RecoveryThreads=4;TypeMode=0;PLSQL=0;CacheGridEnable=0;LogBufMB=64;ReceiverThreads=1;
(Default setting AutoCommit=1)
Command> select * from tangyun.t;
< 1, snc >
1 row found.
Command> exit
Disconnecting...
Done.
-可以看到已經恢復原來的DSN資訊。
-透過上面的不同場景,在使用DBI恢復和處理故障都會存在一定的麻煩和風險;所以,在我們實際運維中,建議備份DBI檔案,做到有備無患。
Created by Tony.Tang[TangYun]2015.01
--------End-------------------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24930246/viewspace-1410008/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【記憶體資料庫】TimesTen記憶體資料庫
- 記憶體資料庫TimesTen介紹記憶體資料庫
- Oralce記憶體資料庫TimesTen簡介記憶體資料庫
- 採用java連結timesten記憶體資料庫Java記憶體資料庫
- 表空間資料檔案故障處理
- timesten資料庫ttcserver程式的作用資料庫Server
- MySQL 磁碟空間滿導致表空間相關資料檔案損壞故障處理MySql
- 合理配置TimesTen記憶體資料庫Hash索引的PAGES引數記憶體資料庫索引
- 幾個例子理解不同資料型別的堆疊記憶體處理資料型別記憶體
- 與作用域相關的閉包、記憶體洩漏、this記憶體
- 從Oracle資料庫故障到AIX記憶體管理Oracle資料庫AI記憶體
- JavaScript 中的記憶體洩漏以及如何處理JavaScript記憶體
- JavaScript中的記憶體洩漏以及如何處理JavaScript記憶體
- 誤刪資料庫資料檔案的處理方法資料庫
- informix資料庫頁故障的處理方法ORM資料庫
- Oracle與TimesTen記憶體資料庫Cache Group同步效率與TimesTen主備資料同步機制研究Oracle記憶體資料庫
- SQL Server 記憶體資料庫原理解析SQLServer記憶體資料庫
- TimesTen記憶體資料庫評估和計算表大小及碎片記憶體資料庫
- JavaScript變數,資料和記憶體的相關問題JavaScript變數記憶體
- 【故障處理】DG環境主庫丟失歸檔情況下資料檔案的恢復
- 關於資料庫事務併發的理解和處理資料庫
- phpexcel 處理大量資料時記憶體溢位PHPExcel記憶體溢位
- 記憶體資料庫記憶體資料庫
- 歸檔日誌滿導致的資料庫掛起故障處理資料庫
- otedisk OCR 檔案管理故障處理
- Java記憶體對映,上G大檔案輕鬆處理Java記憶體
- timesten 資料庫sys.tables共享鎖長期存在的處理資料庫
- 資料庫timesten與 oracle 處理日期上寫法上的不同資料庫Oracle
- Oracle 資料庫常見檔案及相關操作Oracle資料庫
- TimesTen記憶體庫monitor表引數說明記憶體
- UNDO表空間資料檔案丟失處理(二)正常關閉資料庫資料庫
- 【恢復】非歸檔模式下因誤刪除資料檔案導致資料庫無法OPEN的故障處理模式資料庫
- 記憶體優化相關記憶體優化
- iOS記憶體管理相關iOS記憶體
- 資料庫伺服器記憶體資源消耗100%問題處理案例資料庫伺服器記憶體
- Mongodb記憶體資料庫MongoDB記憶體資料庫
- 記一次Oracle資料庫無響應(hang住)故障的處理Oracle資料庫
- 重建控制檔案時,與資料檔案相關的Checkpoint資訊來自何處