[20191211]hugepages pagetables.txt

lfree發表於2019-12-13

[20191211]hugepages pagetables.txt

--//前幾天寫的http://blog.itpub.net/267265/viewspace-2666410/=>[20191202]關於oracle例項是否使用hugepages問題.txt
--//裡面提到檢視/proc/<spid>/numa_maps相關資訊,我實際上參考了
--//裡面看到huge dirty是否就是pagetables的數量呢?
--//我一直有1個疑問.重點是如何驗證.例子:
$ ps -ef | grep "[o]ra_pmon_.*" | awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps
60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=25 N0=1
60c00000 default file=/SYSV00000000\040(deleted) huge dirty=35 mapmax=25 N0=28 N1=7
86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) huge dirty=1 mapmax=25 N0=1

--//自己做一些探究可能完全不對,希望大家給一些建議或者有什麼命令可以看程式使用頁面表的數量以及大小.

1.環境:
SYS@book> @ 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

2.測試一:
--//首先想到的是設定*.pre_page_sga=true.
--//這樣每個連線都會touch 頁面表,至少11g是這樣設計的.

SYS@book> show parameter pre_page_sga
NAME         TYPE    VALUE
------------ ------- -----
pre_page_sga boolean TRUE

SCOTT@book> @ spid

       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
         1         13 63150                    DEDICATED 63151       24          6 alter system kill session '1,13' immediate;

$ grep 'huge dirty=' /proc/63151/numa_maps
60000000 default file=/SYSV00000000\040(deleted) huge dirty=3 mapmax=26 N0=2 N1=1
60c00000 default file=/SYSV00000000\040(deleted) huge dirty=302 mapmax=26 N0=49 N1=253
86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) huge dirty=1 mapmax=26 N0=1
--//huge dirty相加,3+302+1 = 306.

$ grep -i page /proc/meminfo
AnonPages:        479504 kB
PageTables:        15424 kB
AnonHugePages:         0 kB
HugePages_Total:     309
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:      205
Hugepagesize:       2048 kB

--//總hugepages頁面表數量是309.我前面將huge dirty相加等於306,視乎非常接近.

$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps | grep 60c00000 | uniq -c
     26 60c00000 default file=/SYSV00000000\040(deleted) huge dirty=302 mapmax=26 N0=49 N1=253
--//每個連線都是一樣的.並且注意1個情況N0+N1=dirty.N0,N1表示什麼不懂.

$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps | grep 60000000 | uniq -c
      8 60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=26 N0=1
      3 60000000 default file=/SYSV00000000\040(deleted) huge dirty=3 mapmax=26 N0=2 N1=1
      1 60000000 default file=/SYSV00000000\040(deleted) huge dirty=5 mapmax=26 N0=2 N1=3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      2 60000000 default file=/SYSV00000000\040(deleted) huge dirty=4 mapmax=26 N0=2 N1=2
      1 60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=26 N0=1
      1 60000000 default file=/SYSV00000000\040(deleted) huge dirty=4 mapmax=26 N0=2 N1=2
      3 60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=26 N0=1
      1 60000000 default file=/SYSV00000000\040(deleted) huge dirty=3 mapmax=26 N0=2 N1=1
      3 60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=26 N0=1
      1 60000000 default file=/SYSV00000000\040(deleted) huge dirty=3 mapmax=26 N0=2 N1=1
      2 60000000 default file=/SYSV00000000\040(deleted) huge dirty=1 mapmax=26 N0=1
--//有1個huge dirty=5的情況.mapmax等於attach共享記憶體段的程式數量.

$ ps -ef |grep 6303[9]
oracle   63039     1  0 11:34 ?        00:00:01 ora_lgwr_book

$ cat /proc/63039/numa_maps | grep SYSV
60000000 default file=/SYSV00000000\040(deleted) huge dirty=5 mapmax=27 N0=2 N1=3
60c00000 default file=/SYSV00000000\040(deleted) huge dirty=302 mapmax=27 N0=49 N1=253
86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) huge dirty=1 mapmax=27 N0=1
--// 5+302+1 = 308,grep -i page /proc/meminfo看到的HugePages_Total=309,僅僅相差1.

--//而且你可以發現有趣的情況,如果出現沒有active的行,N0+N1=huge dirty.或者N0=dirty(不存在N1的情況)

$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 419168256  oracle    640        12582912   27
0x00000000 419201025  oracle    640        633339904  27
0xe8a8ec10 419233794  oracle    640        2097152    27

--//12582912/2048/1024 = 6
--//633339904/2048/1024 = 302
--//2097152/2048/1024 = 1
--//合計 302+6+1 = 309

--//我特意找2臺連線很多的伺服器,一臺沒有開啟hugepages.一臺開啟hugepages測試,只要查詢不存在active的行都存在N0+N1=dirty的情況.注N1不存在當作是0.或者N0=dirty.

# ps -ef|egrep "[o]ra_.*_fyhis1|[o]raclefyhis1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $4";"$5";"$6";"$7}'|tr 'N' 'n'| grep n1=|xargs -IQ echo 'Q;nx=n0+n1;nx;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'
# ps -ef|egrep "[o]ra_.*_fyhis1|[o]raclefyhis1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $4";"$5";"$6";"$7}'|tr 'N' 'n'| grep -v n1=|xargs -IQ echo 'Q;n0;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'

--//使用hugepages執行如下:
ps -ef|egrep "[o]ra_.*_dbcn1|[o]racledbcn1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $5";"$6";"$7";"$8}'|tr 'N' 'n'| grep n1=|xargs -IQ echo 'Q;nx=n0+n1;nx;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'
ps -ef|egrep "[o]ra_.*_dbcn1|[o]racledbcn1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $5";"$6";"$7";"$8}'|tr 'N' 'n'| grep -v n1=|xargs -IQ echo 'Q;n0;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'

ps -ef|egrep "[o]ra_.*_book|[o]raclebook"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $5";"$6";"$7";"$8}'|tr 'N' 'n'| grep n1=|xargs -IQ echo 'Q;nx=n0+n1;nx;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'
ps -ef|egrep "[o]ra_.*_book|[o]raclebook"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep -v active|awk '{print $5";"$6";"$7";"$8}'|tr 'N' 'n'| grep -v n1=|xargs -IQ echo 'Q;n0;dirty'|bc|paste - -|awk ' $1!=$2 {print "not equal"}'

--//另外很奇怪我在測試環境無論如何都看不到active的情況.
$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps | grep active

3.繼續測試:
$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps | grep 60c00000 | uniq -c
     27 60c00000 default file=/SYSV00000000\040(deleted) huge dirty=302 mapmax=27 N0=49 N1=253

--//無論我做任何操作N0,N1都沒有變化.我重啟看到的情況
$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'huge dirty=' /proc/Q/numa_maps | grep 60c00000 | uniq -c
     23 60c00000 default file=/SYSV00000000\040(deleted) huge dirty=302 mapmax=23 N0=252 N1=50

--//不知道N0,N1表示什麼.
--//另外我發現mapmax應該等於attache共享記憶體段的程式數量. 前面的23=mapmax
--//我反覆啟動資料庫多次,都是出現這2種情況.N0=49 N1=253或者N0=252 N1=50.

3.測試:
--//繼續測試不使用hugepages的情況:
*.use_large_pages='false'
*.pre_page_sga=true

$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'SYSV' /proc/Q/numa_maps | grep 60c00000| uniq -c
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42431 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42423 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42421 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42423 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42420 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42544 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42420 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=44111 mapped=154624 mapmax=23 N0=77312 N1=77312
      4 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42424 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42426 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=43206 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42432 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=44986 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42423 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42421 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42404 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=47936 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42418 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42422 mapped=154624 mapmax=23 N0=77312 N1=77312
      1 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=42719 mapped=154624 mapmax=23 N0=77312 N1=77312
--//這次的情況是N0+N1=mapped.
--//77312+77312 = 154624

$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'SYSV' /proc/Q/numa_maps |grep  -v mapped | grep -v active| uniq -c
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=68 mapmax=25 N0=31 N1=37
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=68 mapmax=25 N0=31 N1=37
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=69 mapmax=25 N0=32 N1=37
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=68 mapmax=25 N0=31 N1=37
      2 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=70 mapmax=25 N0=33 N1=37
      8 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=87 mapmax=25 N0=43 N1=44
      3 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=63 mapmax=25 N0=27 N1=36
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=57 mapmax=25 N0=23 N1=34
      2 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=71 mapmax=25 N0=31 N1=40
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=70 mapmax=25 N0=31 N1=39
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=87 mapmax=25 N0=43 N1=44
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=72 mapmax=25 N0=33 N1=39
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=78 mapmax=25 N0=37 N1=41
      1 86800000 interleave:0-1 file=/SYSVe8a8ec10\040(deleted) dirty=1 mapmax=25 N1=1
--//奇怪這裡僅僅出現N1沒有N0的情況
--//一樣滿足前面的情況只要沒有mapped,active

$ ps -ef | egrep '[o]ra_.*_book|[o]raclebook'|awk '{print $2}' | xargs -IQ grep 'SYSV' /proc/Q/numa_maps |grep  -v mapped | grep  active| uniq -c
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=89 mapmax=25 active=85 N0=42 N1=47
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=85 mapmax=25 active=84 N0=42 N1=43
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=72 mapmax=25 active=71 N0=34 N1=38
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=81 mapmax=25 active=77 N0=38 N1=43
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=78 mapmax=25 active=75 N0=35 N1=43
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=79 mapmax=25 active=75 N0=35 N1=44
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=1876 mapmax=25 active=72 N0=934 N1=942
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=167 mapmax=25 active=80 N0=79 N1=88
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=98 mapmax=25 active=90 N0=47 N1=51
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=111 mapmax=25 active=91 N0=52 N1=59
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=83 mapmax=25 active=81 N0=42 N1=41
      1 60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=103 mapmax=25 active=92 N0=50 N1=53
--//排除active行.無論是否active都出現 N0+N1=dirty ,dirty=N1(注這裡不是N0).我僅僅找規律.

$ ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 419954688  oracle    640        12582912   25
0x00000000 419987457  oracle    640        633339904  25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xe8a8ec10 420020226  oracle    640        2097152    25

--//12582912/4096 = 3072
--//633339904/4096 = 154624
--//2097152/4096 = 512
--//可以猜測pre_page_sga=true的情況下,實際上是對映中間部分.

--//我找一臺設定pre_page_sga=false的機器,沒有開啟hugepages:
# ps -ef|egrep "[o]ra_.*_fyhis1|[o]raclefyhis1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep  mapped
68000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=3090 mapped=3100 mapmax=440 active=2485 N0=1558 N1=1542
--//僅僅出現1個存在mapped的行,而使用hugepages的,沒有設定pre_page_sga=true的機器,沒有輸出.
#  ps -ef|egrep "[o]ra_.*_dbcn1|[o]racledbcn1"|awk '{print $2}'|xargs -IQ grep "/SYSV" /proc/Q/numa_maps|grep  mapped

--//確定出現mapped的是那個程式.
# ps -ef|egrep "[o]ra_.*_fyhis1|[o]raclefyhis1"|awk '{print $2}'|xargs -IQ bash -c "echo Q; grep "/SYSV" /proc/Q/numa_maps"| grep -B4 mapped
68000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=36437 mapmax=424 active=36379 N0=18204 N1=18233
518000000 interleave:0-1 file=/SYSV5145def4\040(deleted) dirty=1 mapmax=424 N0=1
21527
60000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=107 mapmax=424 N0=56 N1=51
68000000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=3090 mapped=3100 mapmax=424 active=2485 N0=1558 N1=1542

# ps -ef|  grep 2152[7]
oracle   21527     1  0 Nov01 ?        00:34:12 ora_diag_fyhis1
--//不知道為什麼.

3.自己設計1個測試環境:
--//啟動環境:
*.use_large_pages='false'
*.pre_page_sga=flase

SCOTT@book> create table t as select rownum id  from dual connect by level<=2;
Table created.

SCOTT@book> alter table t minimize records_per_block;
Table altered.

SCOTT@book> delete from t;
2 rows deleted.

SCOTT@book> commit ;
Commit complete.

SCOTT@book> insert into t  select rownum  from dual connect by level<=100;
100 rows created.

SCOTT@book> commit ;
Commit complete.

--//這樣建立1塊2條記錄的表.
SCOTT@book> select 'select id from t where rowid='''||rowid||''';' c60 ,t.* from t where mod(id,2)=1;
C60                                                ID
-------------------------------------------------- --
select id from t where rowid='AAAWG7AAEAAAAeTAAA';  1
select id from t where rowid='AAAWG7AAEAAAAeUAAA';  3
select id from t where rowid='AAAWG7AAEAAAAeVAAA';  5
select id from t where rowid='AAAWG7AAEAAAAeWAAA';  7
select id from t where rowid='AAAWG7AAEAAAAeXAAA';  9
select id from t where rowid='AAAWG7AAEAAAAeYAAA'; 11
select id from t where rowid='AAAWG7AAEAAAAeZAAA'; 13
select id from t where rowid='AAAWG7AAEAAAAeaAAA'; 23
select id from t where rowid='AAAWG7AAEAAAAebAAA'; 25
select id from t where rowid='AAAWG7AAEAAAAecAAA'; 15
select id from t where rowid='AAAWG7AAEAAAAedAAA'; 17
select id from t where rowid='AAAWG7AAEAAAAeeAAA'; 19
select id from t where rowid='AAAWG7AAEAAAAefAAA'; 21
select id from t where rowid='AAAWG7AAEAAAAehAAA'; 35
select id from t where rowid='AAAWG7AAEAAAAeiAAA'; 37
select id from t where rowid='AAAWG7AAEAAAAejAAA'; 39
select id from t where rowid='AAAWG7AAEAAAAekAAA'; 27
select id from t where rowid='AAAWG7AAEAAAAelAAA'; 29
select id from t where rowid='AAAWG7AAEAAAAemAAA'; 31
select id from t where rowid='AAAWG7AAEAAAAenAAA'; 33
select id from t where rowid='AAAWG7AAEAAAAeoAAA'; 41
select id from t where rowid='AAAWG7AAEAAAAepAAA'; 43
select id from t where rowid='AAAWG7AAEAAAAeqAAA'; 53
select id from t where rowid='AAAWG7AAEAAAAerAAA'; 55
select id from t where rowid='AAAWG7AAEAAAAesAAA'; 45
select id from t where rowid='AAAWG7AAEAAAAetAAA'; 47
select id from t where rowid='AAAWG7AAEAAAAeuAAA'; 49
select id from t where rowid='AAAWG7AAEAAAAevAAA'; 51
select id from t where rowid='AAAWG7AAEAAAAexAAA'; 65
select id from t where rowid='AAAWG7AAEAAAAeyAAA'; 67
select id from t where rowid='AAAWG7AAEAAAAezAAA'; 69
select id from t where rowid='AAAWG7AAEAAAAe0AAA'; 57
select id from t where rowid='AAAWG7AAEAAAAe1AAA'; 59
select id from t where rowid='AAAWG7AAEAAAAe2AAA'; 61
select id from t where rowid='AAAWG7AAEAAAAe3AAA'; 63
select id from t where rowid='AAAWG7AAEAAAAe4AAA'; 71
select id from t where rowid='AAAWG7AAEAAAAe5AAA'; 73
select id from t where rowid='AAAWG7AAEAAAAe6AAA'; 83
select id from t where rowid='AAAWG7AAEAAAAe7AAA'; 85
select id from t where rowid='AAAWG7AAEAAAAe8AAA'; 75
select id from t where rowid='AAAWG7AAEAAAAe9AAA'; 77
select id from t where rowid='AAAWG7AAEAAAAe+AAA'; 79
select id from t where rowid='AAAWG7AAEAAAAe/AAA'; 81
select id from t where rowid='AAAWG7AAEAAAAfBAAA'; 95
select id from t where rowid='AAAWG7AAEAAAAfCAAA'; 97
select id from t where rowid='AAAWG7AAEAAAAfDAAA'; 99
select id from t where rowid='AAAWG7AAEAAAAfEAAA'; 87
select id from t where rowid='AAAWG7AAEAAAAfFAAA'; 89
select id from t where rowid='AAAWG7AAEAAAAfGAAA'; 91
select id from t where rowid='AAAWG7AAEAAAAfHAAA'; 93
50 rows selected.

--//儲存前面的輸出為檔案z1.txt
--//修改如下:
$ cat z1.txt
select sysdate from dual;
select id from t where rowid='AAAWG7AAEAAAAeTAAA';
host sleep 2
select id from t where rowid='AAAWG7AAEAAAAeUAAA';
host sleep 2
select id from t where rowid='AAAWG7AAEAAAAeVAAA';
host sleep 2
select id from t where rowid='AAAWG7AAEAAAAeWAAA';
host sleep 2
select id from t where rowid='AAAWG7AAEAAAAeXAAA';
...

select sysdate from dual;
--//也就是中間加入host sleep 2.

SCOTT@book> alter system set cursor_sharing =force scope=memory;
System altered.
--//退出:

SCOTT@book> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
        72          9 6003                     DEDICATED 6006        29          4 alter system kill session '72,9' immediate;

--//執行如下命令:
$ seq 100 | xargs -IQ bash -c "sleep 1;grep SYSV /proc/6006/numa_maps | grep 60c00000 | ts.awk" | tee /tmp/z3.txt

--//回到session 1:
SCOTT@book> @ z1.txt

--//檢視/tmp/z3.txt檔案:

$ seq 100 | xargs -IQ bash -c "sleep 2;grep SYSV /proc/8846/numa_maps | grep 60c00000 | ts.awk" | tee /tmp/z3.txt
[2019-12-12 08:21:25] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=1404 mapmax=26 active=1403 N0=691 N1=713
[2019-12-12 08:21:27] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=1404 mapmax=26 active=1403 N0=691 N1=713
[2019-12-12 08:21:29] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=1404 mapmax=26 active=1403 N0=691 N1=713
[2019-12-12 08:21:31] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2169 mapmax=26 active=2168 N0=1089 N1=1080 <--指令碼開始
[2019-12-12 08:21:33] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2175 mapmax=26 active=2174 N0=1091 N1=1084
[2019-12-12 08:21:35] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2181 mapmax=26 active=2180 N0=1093 N1=1088
[2019-12-12 08:21:37] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2187 mapmax=26 active=2186 N0=1097 N1=1090
[2019-12-12 08:21:39] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2194 mapmax=26 active=2193 N0=1102 N1=1092
[2019-12-12 08:21:41] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2197 mapmax=26 active=2196 N0=1104 N1=1093
[2019-12-12 08:21:43] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2204 mapmax=26 active=2203 N0=1108 N1=1096
[2019-12-12 08:21:45] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2211 mapmax=26 active=2210 N0=1111 N1=1100
[2019-12-12 08:21:47] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2217 mapmax=26 active=2216 N0=1113 N1=1104
[2019-12-12 08:21:49] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2224 mapmax=26 active=2223 N0=1117 N1=1107
[2019-12-12 08:21:51] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2232 mapmax=26 active=2231 N0=1120 N1=1112
[2019-12-12 08:21:53] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2238 mapmax=26 active=2237 N0=1123 N1=1115
[2019-12-12 08:21:55] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2246 mapmax=26 active=2245 N0=1129 N1=1117
[2019-12-12 08:21:57] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2266 mapmax=26 active=2265 N0=1131 N1=1135
[2019-12-12 08:21:59] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2273 mapmax=26 active=2272 N0=1135 N1=1138
[2019-12-12 08:22:01] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2279 mapmax=26 active=2278 N0=1136 N1=1143
[2019-12-12 08:22:03] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2285 mapmax=26 active=2284 N0=1139 N1=1146
[2019-12-12 08:22:05] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2291 mapmax=26 active=2290 N0=1143 N1=1148
[2019-12-12 08:22:07] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2300 mapmax=26 active=2299 N0=1148 N1=1152
[2019-12-12 08:22:09] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2306 mapmax=26 active=2305 N0=1153 N1=1153
[2019-12-12 08:22:11] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2313 mapmax=26 active=2312 N0=1155 N1=1158
[2019-12-12 08:22:13] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2316 mapmax=26 active=2315 N0=1156 N1=1160
[2019-12-12 08:22:15] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2322 mapmax=26 active=2321 N0=1160 N1=1162
[2019-12-12 08:22:17] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2327 mapmax=26 active=2326 N0=1162 N1=1165
[2019-12-12 08:22:19] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2331 mapmax=26 active=2330 N0=1165 N1=1166
[2019-12-12 08:22:21] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2336 mapmax=26 active=2335 N0=1167 N1=1169
[2019-12-12 08:22:23] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2350 mapmax=26 active=2349 N0=1169 N1=1181
[2019-12-12 08:22:25] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2356 mapmax=26 active=2355 N0=1173 N1=1183
[2019-12-12 08:22:27] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2364 mapmax=26 active=2363 N0=1178 N1=1186
[2019-12-12 08:22:29] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2372 mapmax=26 active=2371 N0=1185 N1=1187
[2019-12-12 08:22:31] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2379 mapmax=26 active=2378 N0=1187 N1=1192
[2019-12-12 08:22:33] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2388 mapmax=26 active=2387 N0=1190 N1=1198
[2019-12-12 08:22:35] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2395 mapmax=26 active=2394 N0=1196 N1=1199
[2019-12-12 08:22:37] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2402 mapmax=26 active=2401 N0=1199 N1=1203
[2019-12-12 08:22:39] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2410 mapmax=26 active=2409 N0=1204 N1=1206
[2019-12-12 08:22:41] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2416 mapmax=26 active=2415 N0=1209 N1=1207
[2019-12-12 08:22:43] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2423 mapmax=26 active=2422 N0=1213 N1=1210
[2019-12-12 08:22:45] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2431 mapmax=26 active=2430 N0=1215 N1=1216
[2019-12-12 08:22:47] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2438 mapmax=26 active=2437 N0=1218 N1=1220
[2019-12-12 08:22:49] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2445 mapmax=26 active=2444 N0=1222 N1=1223
[2019-12-12 08:22:51] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2453 mapmax=26 active=2452 N0=1227 N1=1226
[2019-12-12 08:22:53] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2460 mapmax=26 active=2459 N0=1232 N1=1228
[2019-12-12 08:22:55] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2466 mapmax=26 active=2465 N0=1234 N1=1232
[2019-12-12 08:22:57] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2472 mapmax=26 active=2471 N0=1236 N1=1236
[2019-12-12 08:22:59] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2477 mapmax=26 active=2476 N0=1238 N1=1239
[2019-12-12 08:23:01] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2489 mapmax=26 active=2488 N0=1242 N1=1247
[2019-12-12 08:23:03] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2493 mapmax=26 active=2492 N0=1244 N1=1249
[2019-12-12 08:23:05] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2495 mapmax=26 active=2494 N0=1244 N1=1251
[2019-12-12 08:23:07] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2503 mapmax=26 active=2502 N0=1250 N1=1253  
[2019-12-12 08:23:09] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253  <-指令碼結束
[2019-12-12 08:23:11] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253

--//dirty增加沒有規律.active視乎表示變化的次數.dirty至少跟touch pagetables有關.

$ cat /tmp/z3.txt |awk '{print $6}' | cut -f2 -d= | awk 'NR==1{a=$1} NR>1{print $1-a;a=$1}' | sort -nr | uniq -c
      1 765
      1 20
      1 14
      1 12
      2 9
      8 8
     13 7
     14 6
      3 5
      2 4
      2 3
      1 2
      1 1
      3 0
--//變化主要集中在6,7,8.我開始以為這樣測試會出現每次2個的變化.因為每次執行要訪問1個資料塊(8K),相當於2個pagetables(每個4K).
--//可以測試情況不是,我不知道為什麼.也許還要訪問共享池,還是這些頁面已經touch了.不理解.
--//我更加願意相信dirty就是表示會話touch頁面表的數量.

--//繼續重複執行z1.txt指令碼:
$ seq 100 | xargs -IQ bash -c "sleep 2;grep SYSV /proc/8846/numa_maps | grep 60c00000 | ts.awk" | tee /tmp/z4.txt
[2019-12-12 08:28:38] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:40] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:42] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:44] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:46] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:48] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:50] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:52] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:54] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:56] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:28:58] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:00] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:02] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:04] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:06] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:08] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:10] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:12] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:14] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:16] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:18] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:20] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:22] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:24] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:26] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:28] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:30] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:32] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:34] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:36] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:38] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:40] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:42] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:44] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:46] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:48] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:50] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:52] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:54] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:56] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:29:58] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:00] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:02] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:04] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:06] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:08] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:10] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2504 mapmax=26 active=2503 N0=1251 N1=1253
[2019-12-12 08:30:12] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2505 mapmax=26 active=2504 N0=1252 N1=1253
[2019-12-12 08:30:14] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2505 mapmax=26 active=2504 N0=1252 N1=1253
[2019-12-12 08:30:17] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2506 mapmax=26 active=2505 N0=1252 N1=1254
[2019-12-12 08:30:19] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2506 mapmax=26 active=2505 N0=1252 N1=1254
[2019-12-12 08:30:21] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2506 mapmax=26 active=2505 N0=1252 N1=1254
[2019-12-12 08:30:23] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2506 mapmax=26 active=2505 N0=1252 N1=1254
[2019-12-12 08:30:25] 60c00000 interleave:0-1 file=/SYSV00000000\040(deleted) dirty=2506 mapmax=26 active=2505 N0=1252 N1=1254
--//dirty基本不變化.

總結:
--//1.mapmax表示atach 共享記憶體段的程式數,這點沒有問題.
--//2.*.pre_page_sga=true的情況下,最大的共享記憶體段每個連線程式要touch全部頁面表.至少11g的情況是這樣.12c,18c的情況未必.
--//3.dirty 我個人傾向與表示會話touch頁面表的數量.
--//浪費上午1小時,整個下午3個小時探究這個,有點浪費時間,不知道自己的分析理解是否正確.本來不想貼出來.對於OS的許多理解是一篇空白.
--//許多僅僅是自己的異臆想和猜測.

補充:
SYS@orclcdb> select BANNER from v$version;
BANNER
----------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

SYS@orclcdb> show parameter pre_page_sga
NAME         TYPE    VALUE
------------ ------- ------
pre_page_sga boolean TRUE

# ps -ef |grep lgwr
root      3801  3744  0 10:43 pts/0    00:00:00 grep --color=auto lgwr
oracle   13632     1  0 12月05 ?      00:00:15 asm_lgwr_+ASM
oracle   16189     1  0 12月05 ?      00:00:35 ora_lgwr_orclcdb

# cat /proc/16189/numa_maps | grep  SYSV
60000000 default file=/SYSV00000000\040(deleted)
60001000 default file=/SYSV00000000\040(deleted) dirty=104 mapmax=66 N0=104 kernelpagesize_kB=4
61000000 default file=/SYSV00000000\040(deleted) dirty=819 mapmax=66 active=785 N0=819 kernelpagesize_kB=4
185000000 default file=/SYSV00000000\040(deleted) dirty=13335 mapmax=20 active=13122 N0=13335 kernelpagesize_kB=4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189000000 default file=/SYSVd48cd3f0\040(deleted) dirty=1 mapmax=66 N0=1 kernelpagesize_kB=4
--//rh 7.0版本加入了,kernelpagesize_kB=4.
--//奇怪有1共享記憶體段的mapmax=20的情況.

$ ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 294912     oracle     777        16384      1          dest
0x00000000 327681     oracle     777        4325376    2          dest
0x00000000 589826     oracle     777        4325376    2          dest
0x00000000 557059     oracle     600        524288     2          dest
0x00000000 688132     oracle     600        524288     2          dest
0x56538844 720901     oracle     600        24576      25
0x00000000 753670     oracle     600        524288     2          dest
0x00000000 917512     oracle     600        524288     2          dest
0x00000000 983050     oracle     600        8908800    132
0x00000000 1015819    oracle     600        4898947072 66
0x00000000 1048588    oracle     600        58200064   66
0xd48cd3f0 1081357    oracle     600        24576      66

--//亂,看不懂. mapmax=20來自那個共享記憶體段.

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

相關文章