20170224測試資料庫塊在檔案系統快取多少

lfree發表於2017-02-27

[20170224]測試資料庫塊在檔案系統快取多少.txt

--//生產系統一個小資料庫測試看看快取多少.

1.安裝nocache:
略.

2.執行如下:
# find oradata -name *.* -print | xargs -I {} cachestats {}
oradata/xxxxxx/undotbs01.dbf             pages in cache: 12902/465922 (2.8%)  [filesize=1863688.0K, pagesize=4K]
oradata/xxxxxx/redostb03.rbo             pages in cache: 0/12801 (0.0%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/redo01.log                pages in cache: 9511/12801 (74.3%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/zzzzzz_his01.dbf          pages in cache: 368953/1835010 (20.1%)  [filesize=7340040.0K, pagesize=4K]
oradata/xxxxxx/sysaux01.dbf              pages in cache: 53541/304642 (17.6%)  [filesize=1218568.0K, pagesize=4K]
oradata/xxxxxx/control02.ctl             pages in cache: 244/2884 (8.5%)  [filesize=11536.0K, pagesize=4K]
oradata/xxxxxx/tsp_audit01.dbf           pages in cache: 22/98306 (0.0%)  [filesize=393224.0K, pagesize=4K]
oradata/xxxxxx/redostb01.rbo             pages in cache: 0/12801 (0.0%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/zzzzzz01.dbf              pages in cache: 2706/393218 (0.7%)  [filesize=1572872.0K, pagesize=4K]
oradata/xxxxxx/redo02.log                pages in cache: 11433/12801 (89.3%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/redostb02.rbo             pages in cache: 0/12801 (0.0%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/temp01.dbf                pages in cache: 32/425986 (0.0%)  [filesize=1703944.0K, pagesize=4K]
oradata/xxxxxx/control01.ctl             pages in cache: 2876/2884 (99.7%)  [filesize=11536.0K, pagesize=4K]
oradata/xxxxxx/users01.dbf               pages in cache: 6/1282 (0.5%)  [filesize=5128.0K, pagesize=4K]
oradata/xxxxxx/system01.dbf              pages in cache: 15620/258562 (6.0%)  [filesize=1034248.0K, pagesize=4K]
oradata/xxxxxx/redo03.log                pages in cache: 11428/12801 (89.3%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/redostb04.rbo             pages in cache: 0/12801 (0.0%)  [filesize=51200.5K, pagesize=4K]
oradata/xxxxxx/zzzzzz_emr01.dbf          pages in cache: 166/131074 (0.1%)  [filesize=524296.0K, pagesize=4K]

# find oradata -name *.* -print | xargs -I {} cachestats {}  | cut -d":" -f2 | cut -d"/" -f1 | sed -e '1,$s/$/+/'  -e '$s/+$//' | xargs |bc
489496

--//489496*4096/1024/1024=1912M.

# free -m
             total       used       free     shared    buffers     cached
Mem:          7908       6480       1427          0        323       3922
-/+ buffers/cache:       2234       5673
Swap:        20002          0      20002

3.清除快取:
# find oradata -name *.* -print | xargs -I {} cachedel {}

# free -m
             total       used       free     shared    buffers     cached
Mem:          7908       4566       3341          0        323       2010
-/+ buffers/cache:       2232       5675
Swap:        20002          0      20002

--//3341-1427=1914,基本接近.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2134321/,如需轉載,請註明出處,否則將追究法律責任。

相關文章