建立 DB2 表空間後,如何快速確認其是否啟用了自動儲存?本文介紹前兩種最常用的檢查方法,操作簡單、資訊直觀。
$ db2 get snapshot for tablespaces on sample
...
Tablespace name = SYSCATSPACE
Tablespace ID = 0
Tablespace Type = Database managed space
Tablespace Content Type = All permanent data. Regular table space.
Tablespace Page size (bytes) = 4096
Tablespace Extent size (pages) = 4
Automatic Prefetch size enabled = Yes
Buffer pool ID currently in use = 1
Buffer pool ID next startup = 1
Using automatic storage = Yes
...
輸出中 Using automatic storage = Yes 即表示該表空間已啟用自動儲存;若為 No 則未啟用。
透過 SQL 查詢,適合腳本整合與批量檢查:
$ db2 "select char(TBSP_NAME,30) as TBSP_NAME, TBSP_ID, TBSP_USING_AUTO_STORAGE
from table(snap_get_tbsp('sample',-1)) as tbsp"
結果中 TBSP_USING_AUTO_STORAGE:
1 = 已啟用自動儲存0 = 未啟用下篇將介紹 db2pd 工具法與從備份映像檔離線檢測技巧,敬請期待。