[20170221]nocache工具的小測試.txt
[20170221]nocache工具的小測試.txt
--nocache 這個小工具可以顯示檔案在快取的數量.
--其中 cachestats 有一個-v 引數可以以表格形式顯示.看看它的標識是否正確.
1.環境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> show parameter filesystem
NAME TYPE VALUE
-------------------- ------ ------
filesystemio_options string none
SCOTT@book> select rowid,dept.* from dept ;
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAVRCAAEAAAACHAAA 10 ACCOUNTING NEW YORK
AAAVRCAAEAAAACHAAB 20 RESEARCH DALLAS
AAAVRCAAEAAAACHAAC 30 SALES CHICAGO
AAAVRCAAEAAAACHAAD 40 OPERATIONS BOSTON
SCOTT@book> @ &r/rowid AAAVRCAAEAAAACHAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
87106 4 135 0 0x1000087 4,135 alter system dump datafile 4 block 135 ;
--//在塊4,135位置.
SCOTT@book> alter system flush buffer_cache;
System altered.
--//注意要執行這個.因為我前面已經清除檔案快取,不然執行select rowid,dept.* from dept where rowid='AAAVRCAAEAAAACHAAA';因為這時在資料庫快取裡面,
--//檔案系統快取不存在.
2.測試:
$ cachedel /mnt/ramdisk/book/users01.dbf
$ cachestats -v /mnt/ramdisk/book/users01.dbf | head -20
/mnt/ramdisk/book/users01.dbf pages in cache: 0/554242 (0.0%) [filesize=2216968.0K, pagesize=4K]
cache map:
0: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
32: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
64: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
96: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
128: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
160: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
192: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
224: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
256: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
288: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
320: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
352: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
384: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
416: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
448: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
480: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
512: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
SCOTT@book> select rowid,dept.* from dept where rowid='AAAVRCAAEAAAACHAAA';
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAVRCAAEAAAACHAAA 10 ACCOUNTING NEW YORK
$ cachestats -v /mnt/ramdisk/book/users01.dbf | head -20
/mnt/ramdisk/book/users01.dbf pages in cache: 16/554242 (0.0%) [filesize=2216968.0K, pagesize=4K]
cache map:
0: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
32: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
64: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
96: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
128: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
160: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
192: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
224: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
256: |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x| | | | | | | | | | | | | | | | |
288: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
320: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
352: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
384: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
416: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
448: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
480: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
512: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
--//資料塊8k,而pagesize=4K,135*8/4=270.上面256位置顯示16個x,快取64K??重複幾次都是一樣.
3.換另外一個塊看看:
SCOTT@book> select rowid,emp.* from emp where rowid='AAAVREAAEAAAACXAAA';
ROWID EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------------------ ---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
AAAVREAAEAAAACXAAA 7369 SMITH CLERK 7902 1980-12-17 00:00:00 800 20
SCOTT@book> @ &r/rowid AAAVREAAEAAAACXAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
87108 4 151 0 0x1000097 4,151 alter system dump datafile 4 block 151 ;
SCOTT@book> alter system flush buffer_cache;
System altered.
SCOTT@book> alter system flush buffer_cache;
System altered.
$ cachedel /mnt/ramdisk/book/users01.dbf
SCOTT@book> select rowid,emp.* from emp where rowid='AAAVREAAEAAAACXAAA';
ROWID EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------------------ ---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
AAAVREAAEAAAACXAAA 7369 SMITH CLERK 7902 1980-12-17 00:00:00 800 20
$ cachestats -v /mnt/ramdisk/book/users01.dbf | head -20
/mnt/ramdisk/book/users01.dbf pages in cache: 16/554242 (0.0%) [filesize=2216968.0K, pagesize=4K]
cache map:
0: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
32: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
64: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
96: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
128: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
160: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
192: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
224: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
256: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
288: |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x| | | | | | | | | | | | | | | | |
320: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
352: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
384: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
416: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
448: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
480: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
512: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
--// 151*8/4=302. 讀1個塊確實快取64K,位置是正確的,具體為什麼快取64K,OS的東西我就不清楚了.^_^.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2134054/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20170224]nocache工具的小測試2.txt
- [20171117]nocache的編譯.txt編譯
- (小組)目前流行的單元測試工具有哪些
- 軟體測試工具QTP學習小結QT
- Oracle Sequence NocacheOracle
- [測試工具]
- 雜亂的小測試
- 軟體測試常用的工具都有哪些-測試常用工具
- 鴻蒙 OS 的測試工具鴻蒙
- 效能測試工具的原理
- Java單元測試常用工具類小結Java
- 在微信小程式中打造 MQTT 連線測試工具微信小程式MQQT
- [20170221]資料檔案與檔案系統快取.txt快取
- 介面測試工具
- 安全測試工具
- 【DNS】測試工具DNS
- 測試工具集合
- 效能測試工具
- Jmeter測試工具的實際專案測試案例JMeter
- 測試管理及測試工具盒集
- 軟體測試工具之開源測試工具彙總
- 小程式自動化測試--測試3
- 自動化測試工具縮小開發和交付差距
- Angular 測試小窺Angular
- 常用的api管理測試工具API
- 常用的軟體測試工具
- 我瞭解的測試工具
- 開源的負載測試/壓力測試工具 NBomber負載
- 【工具】ORION I/O 測試工具
- oracle hint_cache_nocacheOracle
- websocket線上測試工具Web
- 單元測試工具
- 測試工具-XPath使用
- 效能測試工具Locust
- mysqlslap 效能測試工具MySql
- 軟體測試工具
- RESTful測試工具 RESTClientRESTclient
- 壓力測試工具